-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
61 lines (61 loc) · 1.39 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
57
58
59
60
61
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
naersk = {
url = "github:nmattia/naersk/master";
inputs.nixpkgs.follows = "nixpkgs";
};
flake-utils.url = "github:numtide/flake-utils";
};
outputs =
{ self
, nixpkgs
, flake-utils
, naersk
, fenix
}:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
};
toolchain = fenix.packages.${system}.stable;
naersk' = pkgs.callPackage naersk {
rustc = toolchain.rustc;
cargo = toolchain.cargo;
};
in
rec {
packages = {
forest-ds = naersk'.buildPackage {
src = ./.;
copyBins = false;
copyLibs = true;
};
default = packages.forest-ds;
};
devShells = {
default =
let
toolchain = (fenix.packages.${system}.latest);
in
pkgs.mkShell {
inputsFrom = [
packages.forest-ds
];
packages = with pkgs; [
pre-commit
toolchain.rustc
toolchain.cargo
toolchain.rust-analyzer
toolchain.clippy
toolchain.rustfmt
];
};
};
});
}