-
Notifications
You must be signed in to change notification settings - Fork 2
/
flake.nix
68 lines (60 loc) · 1.99 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
{
description = "Infrastructure for exploring ADP-1997";
inputs = {
cardano-node.url = "github:input-output-hk/cardano-node?ref=refs/tags/1.35.2";
nix.url = "github:NixOS/nix/master";
nixpkgs.follows = "haskellNix/nixpkgs-unstable";
haskellNix = {
url = "github:input-output-hk/haskell.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
flake-utils.url = "github:numtide/flake-utils";
iohkNix = {
url = "github:input-output-hk/iohk-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, haskellNix, flake-utils, iohkNix, ... } @ inputs:
let
inherit (nixpkgs) lib;
inherit (lib) head systems mapAttrs recursiveUpdate mkDefault
getAttrs optionalAttrs nameValuePair attrNames;
inherit (flake-utils.lib) eachSystem mkApp flattenTree;
inherit (iohkNix.lib) prefixNamesWith collectExes;
overlays = [
haskellNix.overlay
iohkNix.overlays.haskell-nix-extra
iohkNix.overlays.utils
iohkNix.overlays.crypto
(final: prev: {
gitrev = self.rev or "dirty";
commonLib = lib // iohkNix.lib;
})
(import ./nix/build-tools.nix)
(import ./nix/lib.nix)
];
in
flake-utils.lib.eachDefaultSystem (system:
rec {
legacyPackages = import nixpkgs {
inherit system overlays;
inherit (haskellNix) config;
};
pkgs = legacyPackages;
project = (import ./nix/haskell.nix pkgs.haskell-nix);
flake = project.flake {};
packages = collectExes flake.packages;
devShell = (project.appendModule { deferPluginErrors = true; }).shell;
}) //
{
nixosConfigurations =
let
nixosSystem = nixpkgs.lib.makeOverridable nixpkgs.lib.nixosSystem;
in {
sandbox = nixosSystem (import ./nixos/sandbox inputs);
};
nixosModules = {
cardano-node-cluster = (import ./nixos/cardano-node-cluster inputs);
};
};
}