-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
50 lines (46 loc) · 1.25 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
{
inputs = {
cargo2nix.url = "github:cargo2nix/cargo2nix";
cargo2nix.inputs.nixpkgs.follows = "nixpkgs";
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
flake-utils.follows = "cargo2nix/flake-utils";
nixpkgs.url = "github:NixOS/nixpkgs";
};
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.61.0";
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 {
devShell = workspaceShell;
packages = {
cli = (rustPkgs.workspace.cargo-free {}).bin;
lib = (rustPkgs.workspace.cargo-free {});
};
default = packages.cli;
}
);
}