-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathflake.nix
52 lines (48 loc) · 1.67 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
{
description = "Flake for development workflows.";
inputs = {
rainix.url = "github:rainprotocol/rainix";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, flake-utils, rainix }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = rainix.pkgs.${system};
rust-toolchain = rainix.rust-toolchain.${system};
in rec {
packages = rec {
mkBin = (pkgs.makeRustPlatform{
rustc = rust-toolchain;
cargo = rust-toolchain;
}).buildRustPackage {
src = ./.;
doCheck = false;
name = "rain-metadata";
cargoLock.lockFile = ./Cargo.lock;
# allows for git deps to be resolved without the need to specify their outputHash
cargoLock.allowBuiltinFetchGit = true;
buildPhase = ''
cargo build --release --bin rain-metadata --all-features
'';
installPhase = ''
mkdir -p $out/bin
cp target/release/rain-metadata $out/bin/
'';
buildInputs = with pkgs; [
openssl
];
nativeBuildInputs = with pkgs; [
pkg-config
] ++ lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.SystemConfiguration
];
};
} // rainix.packages.${system};
devShells.default = pkgs.mkShell {
shellHook = rainix.devShells.${system}.default.shellHook;
buildInputs = rainix.devShells.${system}.default.buildInputs;
nativeBuildInputs = rainix.devShells.${system}.default.nativeBuildInputs;
};
}
);
}