-
Notifications
You must be signed in to change notification settings - Fork 3
/
flake.nix
107 lines (95 loc) · 2.72 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
{
description = "Hydra control plane";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
rust-overlay.url = "github:oxalica/rust-overlay";
flake-utils.url = "github:numtide/flake-utils";
cardano-node.url = "github:intersectmbo/cardano-node/9.0.0";
hydra.url = "github:cardano-scaling/hydra/0.17.0";
gitignore = {
url = "github:hercules-ci/gitignore.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-inclusive.url = "github:input-output-hk/nix-inclusive";
};
nixConfig = {
trusted-public-keys = [
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ="
];
substituters = [
"https://cache.nixos.org/"
"https://cache.iog.io/"
];
};
outputs =
{
nixpkgs,
rust-overlay,
flake-utils,
cardano-node,
hydra,
...
}@inputs:
flake-utils.lib.eachDefaultSystem (
system:
let
overlays = [ (import rust-overlay) ];
pkgs = import nixpkgs {
inherit system overlays;
};
inherit (pkgs) makeRustPlatform mkShell rust-bin;
inherit (pkgs.lib) optionals;
inherit (pkgs.stdenv) isDarwin;
rust = rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
platform = makeRustPlatform {
rustc = rust;
cargo = rust;
};
in
{
packages.default = platform.buildRustPackage {
name = "hydra-control-plane";
src = inputs.nix-inclusive.lib.inclusive ./. [
./Cargo.lock
./Cargo.toml
./rust-toolchain.toml
./src
];
nativeBuildInputs = with pkgs; [ pkg-config ];
buildInputs =
with pkgs;
(
[
openssl
]
++ optionals isDarwin [
darwin.apple_sdk.frameworks.SystemConfiguration
]
);
cargoLock = {
lockFile = ./Cargo.lock;
outputHashes = {
"pallas-0.29.0" = "sha256-P//R/17kMaqN4JGHFFTMy2gbo7k+xWUaqkF0LFVUxWQ=";
};
};
meta.mainProgram = "hydra_control_plane";
};
devShells.default = mkShell {
buildInputs =
[
# Runtime dependencies
cardano-node.packages.${system}.cardano-cli
hydra.packages.${system}.hydra-node
# Rust Environment
rust
pkgs.pkg-config
pkgs.openssl
]
++ optionals isDarwin [
pkgs.darwin.apple_sdk.frameworks.SystemConfiguration
];
};
}
);
}