-
Notifications
You must be signed in to change notification settings - Fork 1
/
flake.nix
56 lines (54 loc) · 1.41 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
{
description = "mithril";
inputs = {
nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-24.11";
flake-utils.url = "github:numtide/flake-utils";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs = {
nixpkgs.follows = "nixpkgs-stable";
};
};
pre-commit-hooks = {
url = "github:cachix/git-hooks.nix";
inputs.nixpkgs-stable.follows = "nixpkgs-stable";
};
};
outputs =
{
self,
rust-overlay,
nixpkgs-stable,
flake-utils,
pre-commit-hooks,
...
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = nixpkgs-stable.legacyPackages.${system}.extend (import rust-overlay);
rustToolchain = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
buildInputs = [
rustToolchain
self.checks.${system}.pre-commit-check.enabledPackages
];
in
{
devShells.default = pkgs.mkShell {
inherit (self.checks.${system}.pre-commit-check) shellHook;
inherit buildInputs;
};
formatter = pkgs.nixfmt-rfc-style;
checks = {
pre-commit-check = pre-commit-hooks.lib.${system}.run {
src = ./.;
hooks = {
clippy.enable = true;
rustfmt.enable = true;
cargo-check.enable = true;
};
};
};
}
);
}