-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathmk-system.nix
More file actions
82 lines (79 loc) · 2.43 KB
/
Copy pathmk-system.nix
File metadata and controls
82 lines (79 loc) · 2.43 KB
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
{
nixpkgs,
bitte,
priv,
}: {
pkgs,
# Different mkSystem service levels:
# - While systems might share the foundations herein
# - Not all are customized with self, inputs, nodeName, etc.
# This is no contradiction.
self ? null,
inputs ? null,
modules ? [],
nodeName ? null,
}: let
bitteSystem = specializationModule: let
res = nixpkgs.lib.nixosSystem {
inherit pkgs;
inherit (pkgs) system;
modules =
[
./mk-system/constants-module.nix
./mk-system/show-warnings-and-assertions-module.nix
bitte.nixosModule
specializationModule
]
++ modules;
specialArgs = {
inherit nodeName self inputs;
inherit (priv) terranix nomad-driver-nix nomad-follower;
bittelib = bitte.lib;
inherit (bitte.lib) terralib;
};
};
in
builtins.seq res.config.showWarningsAndAssertions res;
bitteProtoSystem = bitteSystem {
imports = [
../profiles/auxiliaries/nix.nix
../profiles/consul/policies.nix
# This module purely exists to appease failing assertions on evaluating
# the proto system. The protosystem is only used to obtain the tf config.
({lib, ...}: {
# assertion: The ‘fileSystems’ option does not specify your root file system.
fileSystems."/" =
lib.mkDefault {device = "/dev/disk/by-label/nixos";};
# assertion: You must set the option ‘boot.loader.grub.devices’ or 'boot.loader.grub.mirroredBoots' to make the system bootable.
boot.loader.grub.enable = lib.mkDefault false;
})
];
};
bitteAmazonSystem = bitteSystem ({modulesPath, ...}: {
imports = ["${modulesPath}/../maintainers/scripts/ec2/amazon-image.nix"];
});
bitteAmazonSystemBaseAMI = bitteSystem ({modulesPath, ...}: {
imports = [
"${modulesPath}/../maintainers/scripts/ec2/amazon-image.nix"
../profiles/ami-base-config.nix
];
});
bitteAmazonZfsSystem = bitteSystem ({modulesPath, ...}: {
imports = ["${modulesPath}/../maintainers/scripts/ec2/amazon-image-zfs.nix"];
});
bitteAmazonZfsSystemBaseAMI = bitteSystem ({modulesPath, ...}: {
imports = [
"${modulesPath}/../maintainers/scripts/ec2/amazon-image-zfs.nix"
../profiles/ami-base-config.nix
];
});
in {
inherit
bitteSystem
bitteProtoSystem
bitteAmazonSystem
bitteAmazonSystemBaseAMI
bitteAmazonZfsSystem
bitteAmazonZfsSystemBaseAMI
;
}