-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
48 lines (45 loc) · 1.32 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
{
inputs = {
cargo2nix.url = "github:cargo2nix/cargo2nix";
cargo2nix.inputs.flake-utils.follows = "flake-utils";
cargo2nix.inputs.nixpkgs.follows = "nixpkgs";
cargo2nix.inputs.rust-overlay.follows = "rust-overlay";
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:NixOS/nixpkgs";
rust-overlay.url = "github:oxalica/rust-overlay";
};
outputs = inputs: with inputs;
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ cargo2nix.overlays.default ];
};
rustPkgs = pkgs.rustBuilder.makePackageSet {
# rustVersion = "1.67.0";
rustChannel = "nightly"; # needed for cargo-expand.
packageFun = import ./Cargo.nix;
extraRustComponents = [ "clippy" "rustfmt" ];
};
workspaceShell = rustPkgs.workspaceShell {
packages = with pkgs; [
# CI.
cargo-audit
cargo-auditable
cargo-deny
codespell
eclint
# Development.
cargo-expand
cargo-watch
];
};
in rec {
devShells.default = workspaceShell;
}
);
}