-
Notifications
You must be signed in to change notification settings - Fork 0
/
nixie.nix
109 lines (98 loc) · 2.57 KB
/
nixie.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
108
{ dataDir
, appData
, secretData
, ...
}: {
# Support for cross compilation
boot.binfmt.emulatedSystems = [
"aarch64-linux"
];
# For compiling hosts that contain or are sourced from private inputs
# Potentially required by the 'nixie' or 'refindGenerate' modules
# You can remove this when Nixie is someday open-sourced
fileSystems."/root/.ssh" = {
device = "${secretData}/kari/ssh";
options = [ "bind" "mode=700" ];
};
# Create directories, not necessarily persistent
systemd.tmpfiles.rules = [
"d /root/.ssh 700 root root -"
"d ${appData}/nixie 755 root root -"
"d ${appData}/nixie/netboot 755 root root -"
"d ${appData}/nixie/logs 755 root root -"
];
# Mount '/nix/.rw-store' and '/tmp' to disk
services.nixRemount = {
enable = true;
where = "${dataDir}/store";
type = "none";
options = [ "bind" ];
};
# Update the rEFInd boot manager
services.refindGenerate = {
enable = true;
where = "/dev/sda1";
flakeUrl = "github:tupakkatapa/nix-config";
hosts = [ "vladof" "bandit" ];
default = "vladof";
timeout = 1;
};
services.nixie = {
enable = true;
dataDir = "${appData}/nixie/netboot";
logDir = "${appData}/nixie/logs";
file-server = {
https = {
enable = false;
address = "ipxe.coditon.com";
};
menus = [
{
name = "kaakkuri-ephemeral-alpha";
flakeUrl = "github:ponkila/homestaking-infra\?ref=jesse/kaakkuri-mainnet";
hosts = [ "kaakkuri-ephemeral-alpha" ];
timeout = 1;
}
{
name = "torgue";
flakeUrl = "github:tupakkatapa/nix-config";
hosts = [ "torgue" "bandit" ];
default = "torgue";
timeout = 3;
}
];
};
dhcp = {
enable = true;
subnets = [
{
name = "upstream";
serve = true;
address = "192.168.1.8";
interfaces = [ "enp0s31f6" ];
clients = [
{
menu = "torgue";
mac = "d4:5d:64:d1:12:52";
address = "192.168.1.7";
}
{
menu = "kaakkuri-ephemeral-alpha";
mac = "70:85:c2:b5:be:db";
address = "192.168.1.25";
}
];
poolStart = "192.168.1.30";
poolEnd = "192.168.1.59";
}
];
};
};
# TODO: Binary cache
# services.nix-serve = {
# enable = true;
# secretKeyFile = "/var/cache-priv-key.pem";
# port = 5000;
# openFirewall = true;
# };
}