-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathflake.nix
56 lines (48 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
49
50
51
52
53
54
55
56
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
naersk = {
url = "github:nix-community/naersk";
inputs.nixpkgs.follows = "nixpkgs";
};
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, naersk, fenix }:
let
system = "x86_64-linux";
pkgs = import nixpkgs { inherit system; };
toolchain = fenix.packages.${system}.fromToolchainName {
name = "stable";
sha256 = "sha256-rLP8+fTxnPHoR96ZJiCa/5Ans1OojI7MLsmSqR2ip8o=";
};
package-name = (naersk.lib.${system}.override {
inherit (toolchain) cargo rustc;
}).buildPackage { src = ./.; };
in {
packages.${system} = {
default = package-name;
inherit package-name;
};
devShells.${system}.default = nixpkgs.legacyPackages.${system}.mkShell {
packages = [
(toolchain.withComponents [
"cargo"
"rustc"
"rust-src"
"rustfmt"
"clippy"
])
fenix.packages.${system}.rust-analyzer
pkgs.cargo-audit
pkgs.cargo-bloat
pkgs.cargo-outdated
pkgs.cargo-release
pkgs.cargo-watch
];
RUST_BACKTRACE = 1;
};
};
}