-
Notifications
You must be signed in to change notification settings - Fork 2
/
flake.nix
79 lines (70 loc) · 2.53 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
{
inputs.nix-bitcoin = {
url = "github:erikarvstedt/nix-bitcoin?ref=clnrest";
inputs.extra-container.follows = "extra-container";
};
inputs.nixos-mailserver = {
url = "gitlab:simple-nixos-mailserver/nixos-mailserver/nixos-24.05";
inputs.nixpkgs.follows = "nixpkgs";
inputs.nixpkgs-24_05.follows = "nixpkgs";
inputs.utils.follows = "nix-bitcoin/flake-utils";
};
inputs.extra-container = {
url = "github:erikarvstedt/extra-container/container-checking";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "nix-bitcoin/flake-utils";
};
inputs.nixpkgs.follows = "nix-bitcoin/nixpkgs";
inputs.nixpkgs-unstable.follows = "nix-bitcoin/nixpkgs-unstable";
outputs = { self, nixpkgs, ... }@inputs:
let
system = "x86_64-linux";
scenarios = import ./test/scenarios.nix self nixpkgs.lib;
in {
configModules = [
(import ./configuration.nix inputs)
./lib/deployment.nix
];
nixosConfigurations.default = nixpkgs.lib.nixosSystem {
inherit system;
modules = self.configModules ++ [
(import ./lib/nixos-flakes-interactive.nix inputs)
];
};
# Useful for eval'ing system options: nix eval .#system.config.networking.hostName
system = self.nixosConfigurations.default;
systemDrv = self.system.config.system.build.toplevel;
flakeInputs = nixpkgs.legacyPackages.${system}.writeText "flake-inputs"
(builtins.concatStringsSep "\n" (builtins.attrValues inputs));
} // (
inputs.nix-bitcoin.inputs.flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
devEnv = import ./lib/dev-env.nix inputs pkgs;
in
{
legacyPackages = {
tests = let
inherit (inputs.nix-bitcoin.legacyPackages.${system}) makeTestBasic;
makeTest = name: config:
makeTestBasic {
inherit name;
config = {
imports = [
scenarios.base
config
];
# Share the same pkgs instance among tests
nixpkgs.pkgs = pkgs.lib.mkDefault pkgs;
};
};
in
builtins.mapAttrs makeTest scenarios;
};
devShells.default = devEnv.makeShell {};
# Called by ./shell.nix
inherit (devEnv) makeShell;
}
)
);
}