-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathflake.nix
43 lines (41 loc) · 1.16 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
{
inputs = {
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
naersk.url = "github:nix-community/naersk";
flake-utils = {url = "github:numtide/flake-utils"; };
};
outputs = {self, nixpkgs, flake-utils, rust-overlay, naersk}:
flake-utils.lib.eachDefaultSystem (system: let
overlays = [
rust-overlay.overlays.default
];
pkgs = import nixpkgs { inherit system overlays; };
my-rust-bin = pkgs.rust-bin.stable.latest.default;
naersk-lib = pkgs.callPackage naersk {
rustc = my-rust-bin;
cargo = my-rust-bin;
};
project = naersk-lib.buildPackage {
src = ./.;
root = ./.;
nativeBuildInputs = [pkgs.pkg-config];
buildInputs =
(
if pkgs.stdenv.isDarwin
then with pkgs.darwin.apple_sdk.frameworks; [Security SystemConfiguration]
else [pkgs.openssl]
)
++ [my-rust-bin];
};
in
{
packages.default = project;
rust-bin = pkgs.rust-bin;
devShells.default = pkgs.mkShell {
nativeBuildInputs = with pkgs; [ gnumake my-rust-bin rust-analyzer cargo-tarpaulin ];
};
});
}