-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtalos.nix
150 lines (144 loc) · 4.4 KB
/
talos.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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
{ config, pkgs, ... }:
let
control-1 = {
name = "galaxy-controlplane-1";
memory = 1024;
vcpus = 1;
diskSize = 20;
iso = pkgs.fetchurl {
url = "https://github.com/siderolabs/talos/releases/download/v1.7.5/talosctl-linux-amd64";
sha256 = "285a8d8d2a0601e4e9ff55972afb9bc0b4f23745d56dfa96e10cc3bafa13de26";
};
network = {
type = "bridge";
bridge = "br0";
mac = "52:54:00:00:00:01";
ip = "192.168.1.101";
gateway = "192.168.1.1";
};
};
control-2 = {
name = "galaxy-controlplane-2";
memory = 1024;
vcpus = 1;
diskSize = 20;
iso = pkgs.fetchurl {
url = "https://github.com/siderolabs/talos/releases/download/v1.7.5/talosctl-linux-amd64";
sha256 = "285a8d8d2a0601e4e9ff55972afb9bc0b4f23745d56dfa96e10cc3bafa13de26";
};
network = {
type = "bridge";
bridge = "br0";
mac = "52:54:00:00:00:02";
ip = "192.168.1.102";
gateway = "192.168.1.1";
};
};
control-3 = {
name = "galaxy-controlplane-3";
memory = 1024;
vcpus = 1;
diskSize = 20;
iso = pkgs.fetchurl {
url = "https://github.com/siderolabs/talos/releases/download/v1.7.5/talosctl-linux-amd64";
sha256 = "285a8d8d2a0601e4e9ff55972afb9bc0b4f23745d56dfa96e10cc3bafa13de26";
};
network = {
type = "bridge";
bridge = "br0";
mac = "52:54:00:00:00:03";
ip = "192.168.1.103";
gateway = "192.168.1.1";
};
};
worker-1 = {
name = "galaxy-worker-1";
memory = 1024;
vcpus = 1;
diskSize = 10;
iso = pkgs.fetchurl {
url = "https://github.com/siderolabs/talos/releases/download/v1.7.5/talosctl-linux-amd64";
sha256 = "285a8d8d2a0601e4e9ff55972afb9bc0b4f23745d56dfa96e10cc3bafa13de26";
};
network = {
type = "bridge";
bridge = "br0";
mac = "52:54:00:00:00:04";
ip = "192.168.1.104";
gateway = "192.168.1.1";
};
};
worker-2 = {
name = "galaxy-worker-2";
memory = 1024;
vcpus = 1;
diskSize = 10;
iso = pkgs.fetchurl {
url = "https://github.com/siderolabs/talos/releases/download/v1.7.5/talosctl-linux-amd64";
sha256 = "285a8d8d2a0601e4e9ff55972afb9bc0b4f23745d56dfa96e10cc3bafa13de26";
};
network = {
type = "bridge";
bridge = "br0";
mac = "52:54:00:00:00:05";
ip = "192.168.1.105";
gateway = "192.168.1.1";
};
};
worker-3 = {
name = "galaxy-worker-3";
memory = 1024;
vcpus = 1;
diskSize = 10;
iso = pkgs.fetchurl {
url = "https://github.com/siderolabs/talos/releases/download/v1.7.5/talosctl-linux-amd64";
sha256 = "285a8d8d2a0601e4e9ff55972afb9bc0b4f23745d56dfa96e10cc3bafa13de26";
};
network = {
type = "bridge";
bridge = "br0";
mac = "52:54:00:00:00:06";
ip = "192.168.1.106";
gateway = "192.168.1.1";
};
};
in
{
imports = [
<nixpkgs/nixos/modules/virtualisation/libvirtd.nix>
];
virtualisation.libvirtd = {
enable = true;
virtmanager = true;
qemu = {
enable = true;
user = "root";
};
guests = [
{
name = control-1.name;
memory = control-1.memory;
vcpus = control-1.vcpus;
diskSize = control-1.diskSize;
iso = control-1.iso;
network = control-1.network;
}
{
name = control-2.name;
memory = control-2.memory;
vcpus = control-2.vcpus;
diskSize = control-2.diskSize;
iso = control-2.iso;
network = control-2.network;
}
{
name = control-3.name;
memory = control-3.memory;
vcpus = control-3.vcpus;
diskSize = control-3.diskSize;
iso = control-3.iso;
network = control-3.network;
}
];
};
}