Compare commits
No commits in common. "cfe166f68a857b09a414c4cbfd7b13d2a01b2fe6" and "ad392f8557199d9056b2f3948dffa1d8137db2a5" have entirely different histories.
cfe166f68a
...
ad392f8557
|
@ -310,11 +310,7 @@
|
|||
templates = {
|
||||
rust = {
|
||||
description = "A rust flake template based on flake.parts";
|
||||
welcomeText = ''
|
||||
welcome to a new rust project ミ(・・)ミ
|
||||
|
||||
run `direnv allow` and `cargo init` to start a new project
|
||||
'';
|
||||
welcomeText = "Run `cargo init` to start a new project";
|
||||
path = ./templates/rust;
|
||||
};
|
||||
};
|
||||
|
|
|
@ -35,10 +35,6 @@
|
|||
mkdcd = {
|
||||
argumentNames = [ "target" ];
|
||||
body = ''
|
||||
if test -z "$target"
|
||||
echo "mkdcd requires an argument" 1>&2
|
||||
return 1
|
||||
end
|
||||
mkdir -p $target
|
||||
cd $target
|
||||
'';
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
/.direnv
|
||||
/result
|
||||
/target
|
||||
/.pre-commit-config.yaml
|
|
@ -7,39 +7,40 @@
|
|||
crane.url = "github:ipetkov/crane";
|
||||
crane.inputs.nixpkgs.follows = "nixpkgs";
|
||||
pre-commit.url = "github:cachix/pre-commit-hooks.nix";
|
||||
pre-commit.inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
outputs = { self, flake-parts, crane, pre-commit, ... }:
|
||||
outputs = { self, flake-parts, ... }:
|
||||
flake-parts.lib.mkFlake { inherit self; } {
|
||||
imports = [ pre-commit.flakeModule ];
|
||||
systems = [
|
||||
"aarch64-darwin"
|
||||
"aarch64-linux"
|
||||
"x86_64-darwin"
|
||||
"x86_64-linux"
|
||||
];
|
||||
perSystem = { config, pkgs, system, ... }:
|
||||
perSystem = { self', inputs', pkgs, ... }:
|
||||
let
|
||||
crane-lib = crane.lib.${system};
|
||||
inherit (inputs') crane pre-commit;
|
||||
crane-lib = crane.lib;
|
||||
package = crane-lib.buildPackage {
|
||||
src = crane-lib.cleanCargoSource ./.;
|
||||
nativeBuildInputs = [ pkgs.libiconv ];
|
||||
};
|
||||
in
|
||||
{
|
||||
pre-commit.settings.hooks = {
|
||||
rustfmt.enable = true;
|
||||
clippy.enable = true;
|
||||
cargo-check.enable = true;
|
||||
checks = {
|
||||
inherit package;
|
||||
pre-commit = pre-commit.lib.run {
|
||||
src = ./.;
|
||||
hooks = {
|
||||
rustfmt.enable = true;
|
||||
clippy.enable = true;
|
||||
cargo-check.enable = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
checks = { inherit package; };
|
||||
packages.default = package;
|
||||
devShells.default = pkgs.mkShell {
|
||||
shellHook = ''
|
||||
${config.pre-commit.installationScript}
|
||||
echo "welcome to your rust project ミ(・・)ミ" 1>&2
|
||||
'';
|
||||
inherit (self'.checks.pre-commit) shellHook;
|
||||
inputsFrom = builtins.attrValues self.checks;
|
||||
|
||||
RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}";
|
||||
|
|
Loading…
Reference in New Issue