Skip to content

Commit 1267f1f

Browse files
committed
chore(nix): add formatter and cargo-nextest
1 parent 162448d commit 1267f1f

File tree

1 file changed

+40
-35
lines changed

1 file changed

+40
-35
lines changed

flake.nix

Lines changed: 40 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -16,39 +16,44 @@
1616
};
1717
};
1818

19-
outputs = {
20-
self,
21-
nixpkgs,
22-
flake-utils,
23-
rust-overlay,
24-
naersk,
25-
}:
26-
flake-utils.lib.eachDefaultSystem (system: let
27-
overlays = [ (import rust-overlay) ];
28-
29-
pkgs = import nixpkgs {
30-
inherit system overlays;
31-
};
32-
33-
toolchain = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
34-
35-
naersk' = pkgs.callPackage naersk {
36-
cargo = toolchain;
37-
rustc = toolchain;
38-
clippy = toolchain;
39-
};
40-
41-
belalang = naersk'.buildPackage {
42-
name = "belalang";
43-
version = "0.1.0";
44-
src = ./.;
45-
};
46-
in {
47-
packages.default = belalang;
48-
49-
devShells.default = pkgs.mkShell {
50-
name = "belalang";
51-
buildInputs = [toolchain];
52-
};
53-
});
19+
outputs =
20+
{
21+
self,
22+
nixpkgs,
23+
flake-utils,
24+
rust-overlay,
25+
naersk,
26+
}:
27+
flake-utils.lib.eachDefaultSystem (
28+
system:
29+
let
30+
overlays = [ (import rust-overlay) ];
31+
32+
pkgs = import nixpkgs { inherit system overlays; };
33+
34+
toolchain = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
35+
36+
naersk' = pkgs.callPackage naersk {
37+
cargo = toolchain;
38+
rustc = toolchain;
39+
clippy = toolchain;
40+
};
41+
42+
belalang = naersk'.buildPackage {
43+
name = "belalang";
44+
version = "0.1.0";
45+
src = ./.;
46+
};
47+
in
48+
{
49+
formatter = pkgs.nixfmt-rfc-style;
50+
51+
packages.default = belalang;
52+
53+
devShells.default = pkgs.mkShell {
54+
name = "belalang";
55+
buildInputs = [ toolchain pkgs.cargo-nextest ];
56+
};
57+
}
58+
);
5459
}

0 commit comments

Comments
 (0)