forked from cardano-scaling/hydra
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
90 lines (85 loc) · 2.8 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
{
inputs = {
nixpkgs.follows = "haskellNix/nixpkgs";
haskellNix.url = "github:input-output-hk/haskell.nix";
iohk-nix.url = "github:input-output-hk/iohk-nix";
flake-utils.url = "github:numtide/flake-utils";
CHaP = {
url = "github:input-output-hk/cardano-haskell-packages?ref=repo";
flake = false;
};
# Use a patched 2.6.0.0 as we are also affected by
# https://github.com/haskell/haskell-language-server/issues/4046
hls = {
url = "github:cardano-scaling/haskell-language-server?ref=2.6-patched";
flake = false;
};
cardano-node.url = "github:intersectmbo/cardano-node/8.7.3";
mithril.url = "github:input-output-hk/mithril/2347.0";
};
outputs =
{ self
, flake-utils
, nixpkgs
, cardano-node
, ...
} @ inputs:
flake-utils.lib.eachSystem [
"x86_64-linux"
"x86_64-darwin"
"aarch64-darwin"
]
(system:
let
pkgs = import inputs.nixpkgs { inherit system; };
hydraProject = import ./nix/hydra/project.nix {
inherit (inputs) haskellNix iohk-nix CHaP;
inherit system nixpkgs;
};
hydraPackages = import ./nix/hydra/packages.nix {
inherit hydraProject system pkgs inputs;
gitRev = self.rev or "dirty";
};
hydraImages = import ./nix/hydra/docker.nix {
inherit hydraPackages system nixpkgs;
};
prefixAttrs = s: attrs:
with pkgs.lib.attrsets;
mapAttrs' (name: value: nameValuePair (s + name) value) attrs;
in
rec {
inherit hydraProject;
packages =
{ default = hydraPackages.hydra-node; } //
hydraPackages //
prefixAttrs "docker-" hydraImages // {
spec = import ./spec { inherit pkgs; };
};
devShells = (import ./nix/hydra/shell.nix {
inherit inputs hydraProject system;
}) // {
ci = (import ./nix/hydra/shell.nix {
inherit inputs hydraProject system;
withoutDevTools = true;
}).default;
};
# Build selected derivations in CI for caching
hydraJobs = pkgs.lib.optionalAttrs (!pkgs.stdenv.isDarwin) {
packages = { inherit (packages) hydra-node hydra-tui hydraw spec; };
devShells = { inherit (devShells) default ci; };
};
});
nixConfig = {
extra-substituters = [
"https://cache.iog.io"
"https://hydra-node.cachix.org"
"https://cardano-scaling.cachix.org"
];
extra-trusted-public-keys = [
"hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ="
"hydra-node.cachix.org-1:vK4mOEQDQKl9FTbq76NjOuNaRD4pZLxi1yri31HHmIw="
"cardano-scaling.cachix.org-1:RKvHKhGs/b6CBDqzKbDk0Rv6sod2kPSXLwPzcUQg9lY="
];
allow-import-from-derivation = true;
};
}