-
Notifications
You must be signed in to change notification settings - Fork 0
/
hosts.nix
133 lines (131 loc) · 4.25 KB
/
hosts.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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
let
hosts = {
dev-vm = mkHost {
type = "nixos";
address = "192.168.122.26";
hostPlatform = "x86_64-linux";
pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEJg26fCklaaX7aakk8YKsBE1cvZmK7BbGRepnlljO0A";
remoteBuild = false;
};
srxgp00 = mkHost {
type = "nixos";
address = "srxgp00.vpn.srx.dev";
hostPlatform = "x86_64-linux";
pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKTMIY7REnKImy/UZ5SBcFLVywHjNtJB+TkwfnI8oqR3";
remoteBuild = false;
};
srxgp01 = mkHost {
type = "nixos";
address = "srxgp01.vpn.srx.dev";
hostPlatform = "aarch64-linux";
pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIP4z3JIB0cwLTHpek2yXvFiUIzBkQf39Y0XE3tG8/02U";
remoteBuild = false;
};
srxgp02 = mkHost {
type = "nixos";
address = "srxgp02.vpn.srx.dev";
hostPlatform = "x86_64-linux";
pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILOatQqlVBjRGIK6Y95O73XOkvN6BOnn7xPTKA9olJYZ";
remoteBuild = false;
};
srxk8s00 = mkHost {
type = "nixos";
address = "srxk8s00.vpn.srx.dev";
hostPlatform = "aarch64-linux";
pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKnculMw+8hP3gix/K4OBqGqrx16Cs2ODxM0V52YXNrT";
remoteBuild = false;
};
srxnas00 = mkHost {
type = "nixos";
address = "srxnas00.vpn.srx.dev";
hostPlatform = "x86_64-linux";
pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHiUYwPlTez18gwbhWC3sB6LoYmDPz0suTF5n3zEGBhg";
remoteBuild = false;
};
srxnas01 = mkHost {
type = "nixos";
address = "srxnas01.vpn.srx.dev";
hostPlatform = "x86_64-linux";
pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDUTiU0WPTLF98yla0Mmit6eIfPpcrDKRemjM1VoHc9w";
remoteBuild = false;
};
srxws00 = mkHost {
type = "nixos";
address = "srxws00.vpn.srx.dev";
hostPlatform = "x86_64-linux";
pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFlG7m82O7W/Btp98ddipBiIvYkXAy1TP3kyRfYuL0aF";
remoteBuild = false;
};
srxnb00 = mkHost {
type = "nixos";
address = "srxnb00.vpn.srx.dev";
hostPlatform = "x86_64-linux";
pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAII+ylR/an6nDQR1CBlWjPnUGf+2JJ9S3APaERFiZ6exT";
remoteBuild = false;
};
srxws01 = mkHost {
type = "nixos";
address = "srxws01.vpn.srx.dev";
hostPlatform = "x86_64-linux";
pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM54ABNX402t+q3hNKjJc1rhXLJckgCLlaDug4+7nfN2";
remoteBuild = false;
};
srxtab00 = mkHost {
type = "nixos";
address = "srxtab00.vpn.srx.dev";
hostPlatform = "x86_64-linux";
pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDJf8iY3QMWoJdYibBsTA9CZE+GQluhp/N+0Vxid7nSP";
remoteBuild = false;
};
srxmc00 = mkHost {
type = "nixos";
address = "srxmc00.vpn.srx.dev";
hostPlatform = "x86_64-linux";
pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGXv0QxmY2C44SvnV3HZd+wBhxc//ox8YhfDnh2L1k4f";
remoteBuild = false;
};
srxfdm00 = mkHost {
type = "nixos";
address = "srxfdm00.vpn.srx.dev";
hostPlatform = "aarch64-linux";
pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIG2Z5iETExjTSn+F1QFwSnyrn5UdSnkn6C+rIM7Dssei";
remoteBuild = false;
};
};
hasSuffix =
suffix: content:
let
inherit (builtins) stringLength substring;
lenContent = stringLength content;
lenSuffix = stringLength suffix;
in
lenContent >= lenSuffix && substring (lenContent - lenSuffix) lenContent content == suffix;
mkHost =
{ type
, hostPlatform
, address ? null
, pubkey ? null
, homeDirectory ? null
, remoteBuild ? true
, large ? false
,
}:
if type == "nixos" then
assert address != null && pubkey != null;
assert (hasSuffix "linux" hostPlatform);
{ inherit type hostPlatform address pubkey remoteBuild large; }
else if type == "darwin" then
assert pubkey != null;
assert (hasSuffix "darwin" hostPlatform);
{ inherit type hostPlatform pubkey large; }
else if type == "home-manager" then
assert homeDirectory != null;
{ inherit type hostPlatform homeDirectory large; }
else
throw "unknown host type '${type}'";
in
{
flake = {
inherit hosts;
};
}