@cryptotaxi247 / infra / commits / 211023cf

build: drop rhea

Martin Weinelt committed Dec 11, 2024 at 03:28 UTC 211023cfe3fa2462169c418afaa14cf06911566d
14 files changed -556
build/flake.nix
-9
@@ -79,15 +79,6 @@
79 ];
80 };
81
82 - nixosConfigurations.rhea = nixpkgs.lib.nixosSystem {
83 - system = "x86_64-linux";
84 -
85 - modules = [
86 - flakesModule
87 - ./rhea/configuration.nix
88 - ];
89 - };
90 -
82 nixosConfigurations.mimas = nixpkgs.lib.nixosSystem {
83 system = "x86_64-linux";
84
build/pluto/prometheus/default.nix
-1
@@ -23,7 +23,6 @@
23 ];
24
25 networking.extraHosts = ''
26 - 10.254.1.5 rhea
26 10.254.1.6 pluto
27
28 10.254.1.9 haumea
build/pluto/prometheus/exporters/nixos.nix
-1
@@ -6,7 +6,6 @@
6 {
7 labels.role = "hydra";
8 targets = [
9 - "rhea:9300"
9 "mimas.nixos.org:9300"
10 ];
11 }
build/pluto/prometheus/exporters/node.nix
-1
@@ -9,7 +9,6 @@
9 {
10 labels.role = "hydra";
11 targets = [
12 - "rhea:9100"
12 "mimas.nixos.org:9100"
13 ];
14 }
build/pluto/prometheus/exporters/zfs.nix
-1
@@ -6,7 +6,6 @@
6 static_configs = [
7 {
8 targets = [
9 - "rhea:9134"
9 "haumea:9134"
10 "pluto:9134"
11 "mimas.nixos.org:9134"
build/rhea/.terraform.lock.hcl deleted
-95
@@ -1,95 +0,0 @@
1 -# This file is maintained automatically by "terraform init".
2 -# Manual edits may be lost in future updates.
3 -
4 -provider "registry.terraform.io/hashicorp/aws" {
5 - version = "5.78.0"
6 - hashes = [
7 - "h1:/EKXECKi3XzLR0SwaEyQucvsQx2TdyIF2DYabr9DVqM=",
8 - "h1:15pt02WPsTWUsLi37o791kSplIqEf2Ihl+zFdBOpKnY=",
9 - "h1:3TLJUm+6523EtS8W8G4f22e0bp2MpZ72f9qptc31WD8=",
10 - "h1:EGEcXHT4WdxUTRSPzjevCNXStQ+u2eeQB4EmOSp2nPc=",
11 - "h1:GwVGbd+IHAq+qwGs2QKuxazKzrJhSWVicYyGBPftuG0=",
12 - "h1:OUmta/bL/0S6g4K/Mn1LBkEnMWNCq4dLsfYrdrllcEo=",
13 - "h1:cxjNJTMeoxw0csix1iWp4m2esNUOuFfVbIAacUGjYSQ=",
14 - "h1:kB3dnSsazjI63RZdz2gldCkDFw8KI0IJd6RbhqxrE6I=",
15 - "h1:o7jz+dFixEcwjfdubken5ldmDJm1tkvM2adPtNDei3g=",
16 - "h1:vIzenE93tNUfA/hFcwB6wouenp59n9g2J6FNPfJAOpg=",
17 - "h1:zA5P+U4hv2P52fwfLNjAIA2jS9xOn4xCmrXrOMKH8gs=",
18 - "h1:zKNuYrqjerfmrU0bgKQtubN/NiMLRXP4HTThTm1WfJE=",
19 - "h1:zYvhhpw56OF8ClJezKBdKV0+6elVM3FYEAjaNWAinjk=",
20 - "h1:zel31ZX4jCQoeQXydOfcm4ncD9aj+437F9Cr1eoCumM=",
21 - "zh:0ae7d41b96441d0cf7ce2e1337657bdb2e1e5c9f1c2227b0642e1dcec2f9dfba",
22 - "zh:21f8f1edf477681ea3b095c02cad6b8e85262e45015de58e84e0c7b2bfe9a1f6",
23 - "zh:2bdc335e341bf98445255549ae93d66cfb9bca706e62b949da98fe467c182cad",
24 - "zh:2fe4096e260367a225a9faf4a424d62b87e5498f12cb43bdb6f4e713d11b82c3",
25 - "zh:3c63bb7a7925d65118d17461f4691a22dbb55ea39a7404e4d71f6ccca8765f8b",
26 - "zh:6609a28a1c638a1901d8007b5386868ccfd313b4df2e98b35d9fdef436974e3b",
27 - "zh:7ae3aef43bc4b365824cca4659cf92459d766800656e354bdbf83feabab835e8",
28 - "zh:9b12af85486a96aedd8d7984b0ff811a4b42e3d88dad1a3fb4c0b580d04fa425",
29 - "zh:c314efe454adc6ca483261c6906e64315aeb9db0c0332818714e9b81e07df0f0",
30 - "zh:cd3e30396b554bbc1d260252db8a0f344065d619038fe60ea870689cd32c6aa9",
31 - "zh:d1ba48fd9d8a1cb1daa927fb9e8bb708b857f2792d796e110460c6fdcd896a47",
32 - "zh:d31c8abe75cb9cdc1c59ad9d356a1c3ae1ba8cd29ac15eb7e01b6cd01221ab04",
33 - "zh:dc27c5c2116b4d9b404753f73bccaa635bce21f3bfb4bb7bc8e63225c36c98fe",
34 - "zh:de491f0d05408378413187475c815d8cb2ac6bfa63d0b42a30ad5ee492e51c07",
35 - "zh:eb44b45a40f80a309dd5b0eb7d7fcb2cbfe588fe2f18b173ef5851346898a662",
36 - ]
37 -}
38 -
39 -provider "registry.terraform.io/hashicorp/external" {
40 - version = "2.3.4"
41 - hashes = [
42 - "h1:+vGNrgIvJPzMpvFu83JJinMdkhIuvhEZ19GXZhbrnZ8=",
43 - "h1:6GqYfx2rlvNWemfIrN9FywbRCsCdyS95GWP1qX9BUZw=",
44 - "h1:8mByRL3zDm50yiEXMrKtWC2FaLwuvvyjKI+eWuD1dn0=",
45 - "h1:8wUm19ayDX5J9uPOWKfp92DDnAyQ8wjCq+k0ra67R6E=",
46 - "h1:Dp/bAH/npXxNkkhLzU09Oj5oLneVU6W0o6oqBp3Akq8=",
47 - "h1:GOSuOGp/zly9gp/2iTqL99pfMXM1SB7+RjTEORlMqTs=",
48 - "h1:U6W8rgrdmR2pZ2cicFoGOSQ4GXuIf/4EK7s0vTJN7is=",
49 - "h1:XWkRZOLKMjci9/JAtE8X8fWOt7A4u+9mgXSUjc4Wuyo=",
50 - "h1:cCabxnWQ5fX1lS7ZqgUzsvWmKZw9FA7NRxAZ94vcTcc=",
51 - "h1:fjJwsIgh+BJEy8FsSt6HD0rKgA9iDCC+Rkv7IGNdNxc=",
52 - "h1:mDbSNa5y81vhKRLypnhOokr2JpKg9pZsWG5EwJiK3qI=",
53 - "zh:037fd82cd86227359bc010672cd174235e2d337601d4686f526d0f53c87447cb",
54 - "zh:0ea1db63d6173d01f2fa8eb8989f0809a55135a0d8d424b08ba5dabad73095fa",
55 - "zh:17a4d0a306566f2e45778fbac48744b6fd9c958aaa359e79f144c6358cb93af0",
56 - "zh:298e5408ab17fd2e90d2cd6d406c6d02344fe610de5b7dae943a58b958e76691",
57 - "zh:38ecfd29ee0785fd93164812dcbe0664ebbe5417473f3b2658087ca5a0286ecb",
58 - "zh:59f6a6f31acf66f4ea3667a555a70eba5d406c6e6d93c2c641b81d63261eeace",
59 - "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3",
60 - "zh:ad0279dfd09d713db0c18469f585e58d04748ca72d9ada83883492e0dd13bd58",
61 - "zh:c69f66fd21f5e2c8ecf7ca68d9091c40f19ad913aef21e3ce23836e91b8cbb5f",
62 - "zh:d4a56f8c48aa86fc8e0c233d56850f5783f322d6336f3bf1916e293246b6b5d4",
63 - "zh:f2b394ebd4af33f343835517e80fc876f79361f4688220833bc3c77655dd2202",
64 - "zh:f31982f29f12834e5d21e010856eddd19d59cd8f449adf470655bfd19354377e",
65 - ]
66 -}
67 -
68 -provider "registry.terraform.io/hashicorp/null" {
69 - version = "3.2.3"
70 - hashes = [
71 - "h1:+AnORRgFbRO6qqcfaQyeX80W0eX3VmjadjnUFUJTiXo=",
72 - "h1:I0Um8UkrMUb81Fxq/dxbr3HLP2cecTH2WMJiwKSrwQY=",
73 - "h1:KN+takGblkyoaNFclDjQavXC/FNz/CkF1UY0nqNCUHY=",
74 - "h1:et7UFgRi/FtALhVrItMeSWc/HPuMnnnkDw7fk18dkDQ=",
75 - "h1:i3HVDAY1s3/9EuPwV5QTBQSr/E/LOxUN3px1sUZGbkA=",
76 - "h1:lIvitiHbzf+j9amFhEXljXncNo3O/8SoVQYQ6O29CSI=",
77 - "h1:nKUqWEza6Lcv3xRlzeiRQrHtqvzX1BhIzjaOVXRYQXQ=",
78 - "h1:obXguGZUWtNAO09f1f9Cb7hsPCOGXuGdN8bn/ohKRBQ=",
79 - "h1:v4DuXoLvBGe0xRT5St53bNICRVbHRUO+m/TreMBCw/U=",
80 - "h1:xtNWHxcFgrYF1TwPSdVloQPPfzsva9lIy+D2avuvelw=",
81 - "h1:zxoDtu918XPWJ/Y6s4aFrZydn6SfqkRc5Ax1ZLnC6Ew=",
82 - "zh:22d062e5278d872fe7aed834f5577ba0a5afe34a3bdac2b81f828d8d3e6706d2",
83 - "zh:23dead00493ad863729495dc212fd6c29b8293e707b055ce5ba21ee453ce552d",
84 - "zh:28299accf21763ca1ca144d8f660688d7c2ad0b105b7202554ca60b02a3856d3",
85 - "zh:55c9e8a9ac25a7652df8c51a8a9a422bd67d784061b1de2dc9fe6c3cb4e77f2f",
86 - "zh:756586535d11698a216291c06b9ed8a5cc6a4ec43eee1ee09ecd5c6a9e297ac1",
87 - "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3",
88 - "zh:9d5eea62fdb587eeb96a8c4d782459f4e6b73baeece4d04b4a40e44faaee9301",
89 - "zh:a6355f596a3fb8fc85c2fb054ab14e722991533f87f928e7169a486462c74670",
90 - "zh:b5a65a789cff4ada58a5baffc76cb9767dc26ec6b45c00d2ec8b1b027f6db4ed",
91 - "zh:db5ab669cf11d0e9f81dc380a6fdfcac437aea3d69109c7aef1a5426639d2d65",
92 - "zh:de655d251c470197bcbb5ac45d289595295acb8f829f6c781d4a75c8c8b7c7dd",
93 - "zh:f5c68199f2e6076bce92a12230434782bf768103a427e9bb9abee99b116af7b5",
94 - ]
95 -}
build/rhea/configuration.nix deleted
-28
@@ -1,28 +0,0 @@
1 -{
2 - imports = [
3 - ./hardware-configuration.nix
4 - ./hetzner.nix
5 - ./network.nix
6 - ../common.nix
7 - ];
8 -
9 - networking = {
10 - hostName = "rhea";
11 - firewall.allowPing = true;
12 - };
13 -
14 - users.users.root.openssh.authorizedKeys.keys = [
15 - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIY0EGPGfXD1L+YdSJIKUzeFyuUfVW58kMh+mSflEFx1 root@mimas"
16 - ];
17 -
18 - system.stateVersion = "21.11";
19 -
20 - systemd.services.hydra-init = {
21 - after = [ "wireguard-wg0.service" ];
22 - requires = [ "wireguard-wg0.service" ];
23 - };
24 -
25 - # hydra-evaluator causes very sharp spikes in RAM usage on trunk-combined
26 - zramSwap.enable = true;
27 - zramSwap.memoryPercent = 150;
28 -}
build/rhea/hardware-configuration.nix deleted
-49
@@ -1,49 +0,0 @@
1 -{
2 - config,
3 - lib,
4 - modulesPath,
5 - ...
6 -}:
7 -
8 -{
9 - imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
10 -
11 - boot.initrd.availableKernelModules = [
12 - "ahci"
13 - "nvme"
14 - ];
15 - boot.initrd.kernelModules = [ ];
16 - boot.kernelModules = [ "kvm-amd" ];
17 - boot.extraModulePackages = [ ];
18 -
19 - fileSystems."/" = {
20 - device = "rpool/safe/root";
21 - fsType = "zfs";
22 - };
23 -
24 - fileSystems."/nix" = {
25 - device = "rpool/local/nix";
26 - fsType = "zfs";
27 - };
28 -
29 - fileSystems."/nix/var/nix/db" = {
30 - device = "rpool/local/nix/db";
31 - fsType = "zfs";
32 - neededForBoot = true;
33 - };
34 -
35 - fileSystems."/var" = {
36 - device = "rpool/local/var";
37 - fsType = "zfs";
38 - };
39 -
40 - fileSystems."/boot" = {
41 - device = "/dev/disk/by-uuid/073C-DDED";
42 - fsType = "vfat";
43 - };
44 -
45 - swapDevices = [ ];
46 -
47 - powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand";
48 - hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
49 -}
build/rhea/hetzner.nix deleted
-4
@@ -1,4 +0,0 @@
1 -{
2 - boot.loader.systemd-boot.enable = true;
3 - boot.loader.efi.canTouchEfiVariables = true;
4 -}
build/rhea/install.md deleted
-311
@@ -1,311 +0,0 @@
1 -# Setup
2 -
3 -## Switch to UEFI
4 -
5 -First submit a support ticket asking them to enable UEFI. See:
6 -https://docs.hetzner.com/robot/dedicated-server/operating-systems/uefi/
7 -
8 -# Correct the NVMe namespace's block size
9 -
10 -Verify the NVMe disks are formatted at the namespace level with 4096 blocks. See
11 -https://openzfs.github.io/openzfs-docs/Performance%20and%20Tuning/Hardware.html#nvme-low-level-formatting
12 -
13 -This disk's LBA is 512:
14 -
15 -```console
16 -root@rescue ~ # smartctl -a /dev/nvme1n1
17 -smartctl 7.2 2020-12-30 r5155 [x86_64-linux-5.16.5] (local build)
18 -Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org
19 -
20 -=== START OF INFORMATION SECTION ===
21 -Model Number: SAMSUNG MZQL23T8HCLS-00A07
22 -Serial Number: S64HNE0T226681
23 -Firmware Version: GDC5602Q
24 -PCI Vendor/Subsystem ID: 0x144d
25 -IEEE OUI Identifier: 0x002538
26 -Total NVM Capacity: 3,840,755,982,336 [3.84 TB]
27 -Unallocated NVM Capacity: 0
28 -Controller ID: 6
29 -NVMe Version: 1.4
30 -Number of Namespaces: 32
31 -Namespace 1 Size/Capacity: 3,840,755,982,336 [3.84 TB]
32 -Namespace 1 Utilization: 4,309,307,392 [4.30 GB]
33 -Namespace 1 Formatted LBA Size: 512
34 -Local Time is: Wed Mar 30 03:28:16 2022 CEST
35 -Firmware Updates (0x17): 3 Slots, Slot 1 R/O, no Reset required
36 -Optional Admin Commands (0x005f): Security Format Frmw_DL NS_Mngmt Self_Test MI_Snd/Rec
37 -Optional NVM Commands (0x005f): Comp Wr_Unc DS_Mngmt Wr_Zero Sav/Sel_Feat Timestmp
38 -Log Page Attributes (0x0e): Cmd_Eff_Lg Ext_Get_Lg Telmtry_Lg
39 -Maximum Data Transfer Size: 512 Pages
40 -Warning Comp. Temp. Threshold: 80 Celsius
41 -Critical Comp. Temp. Threshold: 83 Celsius
42 -Namespace 1 Features (0x1a): NA_Fields No_ID_Reuse NP_Fields
43 -
44 -Supported Power States
45 -St Op Max Active Idle RL RT WL WT Ent_Lat Ex_Lat
46 - 0 + 25.00W 14.00W - 0 0 0 0 70 70
47 - 1 + 8.00W 8.00W - 1 1 1 1 70 70
48 -
49 -Supported LBA Sizes (NSID 0x1)
50 -Id Fmt Data Metadt Rel_Perf
51 - 0 + 512 0 0
52 - 1 - 4096 0 0
53 -
54 -=== START OF SMART DATA SECTION ===
55 -SMART overall-health self-assessment test result: PASSED
56 -
57 -SMART/Health Information (NVMe Log 0x02)
58 -Critical Warning: 0x00
59 -Temperature: 43 Celsius
60 -Available Spare: 100%
61 -Available Spare Threshold: 10%
62 -Percentage Used: 0%
63 -Data Units Read: 187 [95.7 MB]
64 -Data Units Written: 8,423 [4.31 GB]
65 -Host Read Commands: 2,591
66 -Host Write Commands: 3,438
67 -Controller Busy Time: 0
68 -Power Cycles: 5
69 -Power On Hours: 203
70 -Unsafe Shutdowns: 0
71 -Media and Data Integrity Errors: 0
72 -Error Information Log Entries: 0
73 -Warning Comp. Temperature Time: 0
74 -Critical Comp. Temperature Time: 0
75 -Temperature Sensor 1: 43 Celsius
76 -Temperature Sensor 2: 53 Celsius
77 -
78 -Error Information (NVMe Log 0x01, 16 of 64 entries)
79 -No Errors Logged
80 -```
81 -
82 -and correctable with:
83 -
84 -```sh
85 -nvme format /dev/nvme0n1 -l 1
86 -```
87 -
88 -which yields a corrected formatting:
89 -
90 -```console
91 -root@rescue ~ # smartctl -a /dev/nvme1n1
92 -smartctl 7.2 2020-12-30 r5155 [x86_64-linux-5.16.5] (local build)
93 -Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org
94 -
95 -=== START OF INFORMATION SECTION ===
96 -Model Number: SAMSUNG MZQL23T8HCLS-00A07
97 -Serial Number: S64HNE0T226681
98 -Firmware Version: GDC5602Q
99 -PCI Vendor/Subsystem ID: 0x144d
100 -IEEE OUI Identifier: 0x002538
101 -Total NVM Capacity: 3,840,755,982,336 [3.84 TB]
102 -Unallocated NVM Capacity: 0
103 -Controller ID: 6
104 -NVMe Version: 1.4
105 -Number of Namespaces: 32
106 -Namespace 1 Size/Capacity: 3,840,755,982,336 [3.84 TB]
107 -Namespace 1 Utilization: 4,309,307,392 [4.30 GB]
108 -Namespace 1 Formatted LBA Size: 512
109 -Local Time is: Wed Mar 30 03:29:46 2022 CEST
110 -Firmware Updates (0x17): 3 Slots, Slot 1 R/O, no Reset required
111 -Optional Admin Commands (0x005f): Security Format Frmw_DL NS_Mngmt Self_Test MI_Snd/Rec
112 -Optional NVM Commands (0x005f): Comp Wr_Unc DS_Mngmt Wr_Zero Sav/Sel_Feat Timestmp
113 -Log Page Attributes (0x0e): Cmd_Eff_Lg Ext_Get_Lg Telmtry_Lg
114 -Maximum Data Transfer Size: 512 Pages
115 -Warning Comp. Temp. Threshold: 80 Celsius
116 -Critical Comp. Temp. Threshold: 83 Celsius
117 -Namespace 1 Features (0x1a): NA_Fields No_ID_Reuse NP_Fields
118 -
119 -Supported Power States
120 -St Op Max Active Idle RL RT WL WT Ent_Lat Ex_Lat
121 - 0 + 25.00W 14.00W - 0 0 0 0 70 70
122 - 1 + 8.00W 8.00W - 1 1 1 1 70 70
123 -
124 -Supported LBA Sizes (NSID 0x1)
125 -Id Fmt Data Metadt Rel_Perf
126 - 0 + 512 0 0
127 - 1 - 4096 0 0
128 -
129 -=== START OF SMART DATA SECTION ===
130 -SMART overall-health self-assessment test result: PASSED
131 -
132 -SMART/Health Information (NVMe Log 0x02)
133 -Critical Warning: 0x00
134 -Temperature: 43 Celsius
135 -Available Spare: 100%
136 -Available Spare Threshold: 10%
137 -Percentage Used: 0%
138 -Data Units Read: 187 [95.7 MB]
139 -Data Units Written: 8,423 [4.31 GB]
140 -Host Read Commands: 2,591
141 -Host Write Commands: 3,438
142 -Controller Busy Time: 0
143 -Power Cycles: 5
144 -Power On Hours: 203
145 -Unsafe Shutdowns: 0
146 -Media and Data Integrity Errors: 0
147 -Error Information Log Entries: 0
148 -Warning Comp. Temperature Time: 0
149 -Critical Comp. Temperature Time: 0
150 -Temperature Sensor 1: 43 Celsius
151 -Temperature Sensor 2: 53 Celsius
152 -
153 -Error Information (NVMe Log 0x01, 16 of 64 entries)
154 -No Errors Logged
155 -```
156 -
157 -We can now use an ashift of 12 (2^12 = 4096) without a performance penalty.
158 -
159 -## Partitioning
160 -
161 -The following script can be, and was run fully automatically:
162 -
163 -```sh
164 -set -eux
165 -
166 -if ! [ -e /usr/local/sbin/zfs ]; then
167 -echo "installing zfs..."
168 -bash -i -c 'echo y | zfsonlinux_install'
169 -fi
170 -
171 -umount -R /mnt || true
172 -
173 -zpool destroy rpool || true
174 -
175 -
176 -for disk in /dev/nvme0n1 /dev/nvme1n1; do
177 -echo "partitioning $disk..."
178 -index="${disk: -3:1}"
179 -parted -s $disk "mklabel gpt"
180 -parted -a optimal -s $disk "mkpart primary fat32 1m 512m"
181 -parted -a optimal -s $disk "mkpart primary zfs 512m 100%"
182 -parted -s $disk "set 1 esp on"
183 -udevadm settle
184 -mkfs.vfat -n BOOT$index ''${disk}p1
185 -done
186 -
187 -zpool create -f -o ashift=12 -o autotrim=on \
188 --O mountpoint=legacy -O atime=off -O compression=on \
189 -rpool mirror /dev/nvme0n1p2 /dev/nvme1n1p2
190 -
191 -zfs create rpool/local
192 -zfs create rpool/local/nix
193 -zfs create -o recordsize=4k rpool/local/nix/db
194 -zfs create -o xattr=sa -o acltype=posix rpool/local/var
195 -zfs create rpool/safe
196 -zfs create rpool/safe/root
197 -
198 -mkdir -p /mnt
199 -mount -t zfs rpool/safe/root /mnt
200 -
201 -mkdir -p /mnt/nix
202 -mount -t zfs rpool/local/nix /mnt/nix
203 -
204 -mkdir -p /mnt/nix/var/nix/db
205 -mount -t zfs rpool/local/nix/db /mnt/nix/var/nix/db
206 -
207 -mkdir -p /mnt/var
208 -mount -t zfs rpool/local/var /mnt/var
209 -
210 -mkdir -p /mnt/boot
211 -mount /dev/disk/by-label/BOOT0 /mnt/boot
212 -```
213 -
214 -## Installing Nix
215 -
216 -Install Nix into the rescue system as root:
217 -
218 -```sh
219 -groupadd -g 30000 nixbld
220 -useradd --system --groups nixbld nixbld1
221 -useradd --system --groups nixbld nixbld2
222 -useradd --system --groups nixbld nixbld3
223 -useradd --system --groups nixbld nixbld4
224 -useradd --system --groups nixbld nixbld5
225 -mkdir -m 0755 /nix && chown root /nix
226 -sh <(curl -L https://nixos.org/nix/install) --no-daemon
227 -```
228 -
229 -## Configure NixOS
230 -
231 -```sh
232 -nix-shell -p nixos-install-tools -I nixpkgs=channel:nixos-21.11
233 -
234 -nixos-generate-config --root /mnt
235 -```
236 -
237 -In the `configuration.nix`:
238 -
239 -1. Add `hetzner.nix` to the list of `imports` at the top.
240 -2. Add an authorized key and enable SSH. This will be removed later when it is
241 - imported into NixOps, so it is just for bootstrapping:
242 -
243 -```
244 -services.openssh.enable = true;
245 -users.users.root.openssh.authorizedKeys.keys = [ "ssh-..." ];
246 -```
247 -
248 -### Hardware Configuration Changes
249 -
250 -Edit `hardware-configuration.nix` and change the fileSystems value for
251 -`/nix/var/nix` to make it required for boot:
252 -
253 -```nix
254 -fileSystems."/nix/var/nix/db" =
255 - { device = "rpool/local/nix/db";
256 - fsType = "zfs";
257 - neededForBoot = true;
258 - };
259 -```
260 -
261 -### Hetzner.nix
262 -
263 -Then create a file, `hetzner.nix`.
264 -
265 -- The all-zeros hostId is fine, though I generated one with
266 - `head -c4 /dev/urandom | od -A none -t x4`
267 -- The `enp7s0` and `MACAddress` value I got from `ip addr`
268 -- The IP addresses and gateways I got from the Robot webpage under the IPs tab,
269 - hovering over the IPv4 and IPv6 addresses.
270 -- Thee DNS resolvers I got from
271 - https://docs.hetzner.com/dns-console/dns/general/recursive-name-servers/
272 -
273 -```nix
274 -{
275 - networking.hostId = "00000000";
276 - networking.useNetworkd = true;
277 - systemd.network.networks."40-enp7s0" = {
278 - matchConfig.MACAddress = "50:eb:f6:22:f0:3a";
279 -
280 - addresses = [
281 - {
282 - addressConfig.Address = "5.9.122.43/27";
283 - }
284 - {
285 - addressConfig.Address = "2a01:4f8:162:71eb::/64";
286 - }
287 - ];
288 - routes = [
289 - {
290 - Gateway = "5.9.122.33";
291 - }
292 - {
293 - Gateway = "fe80::1";
294 - }
295 - ];
296 -
297 - dns = [
298 - "185.12.64.1"
299 - "185.12.64.2"
300 - "2a01:4ff:ff00::add:1"
301 - "2a01:4ff:ff00::add:2"
302 - ];
303 - };
304 -}
305 -```
306 -
307 -Then run:
308 -
309 -```
310 -nixos-install -I nixpkgs=channel:nixos-21.11
311 -```
build/rhea/network.nix deleted
-23
@@ -1,23 +0,0 @@
1 -{
2 - networking.hostId = "9cd372da";
3 -
4 - systemd.network = {
5 - enable = true;
6 - networks."40-enp7s0" = {
7 - matchConfig = {
8 - MACAddress = "50:eb:f6:22:f0:3a";
9 - Type = "ether";
10 - };
11 - linkConfig.RequiredForOnline = "routable";
12 - networkConfig.Description = "WAN";
13 - address = [
14 - "5.9.122.43/27"
15 - "2a01:4f8:162:71eb::/64"
16 - ];
17 - routes = [
18 - { Gateway = "5.9.122.33"; }
19 - { Gateway = "fe80::1"; }
20 - ];
21 - };
22 - };
23 -}
build/rhea/terraform.tf deleted
-26
@@ -1,26 +0,0 @@
1 -terraform {
2 - backend "s3" {
3 - bucket = "nixos-terraform-state"
4 - encrypt = true
5 - key = "targets/rhea"
6 - region = "eu-west-1"
7 - }
8 -
9 - required_providers {
10 - aws = {
11 - source = "hashicorp/aws"
12 - }
13 - }
14 -}
15 -
16 -module "rhea_deploy" {
17 - source = "github.com/numtide/terraform-deploy-nixos-flakes"
18 -
19 - target_host = "5.9.122.43"
20 - target_user = "root"
21 -
22 - flake = path.module
23 - flake_host = "rhea"
24 -
25 - ssh_agent = true
26 -}
modules/wireguard-hosts.toml
-6
@@ -28,12 +28,6 @@ ip = "10.254.1.1"
28 port = 51820
29 publicKey = "h54X0ACbziEspzsYV2/5nSdg5ptdCrIRgpe9KJxNlyY="
30
31 -[hosts.rhea]
32 -endpoint = "5.9.122.43"
33 -ip = "10.254.1.5"
34 -port = 51820
35 -publicKey = "eIsaf/JYsxL/G5pCzKo10GeiqgdEwp8v9G4BSUBo3h0="
36 -
31 [hosts.pluto]
32 endpoint = "37.27.99.100"
33 ip = "10.254.1.6"
ssh-keys.nix
-1
@@ -32,7 +32,6 @@ rec {
32 machines = {
33 haumea = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBamzRwZmoLjBFoNruGSVJEahk02Ku7NrBOmqcRWxcPm";
34 pluto = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPzc6B1S4mp3T3oWZnqQDkDVWFBIzLtkgkdgstfYZ5d/";
35 - rhea = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHpWGtAp/AUzKPsCgcoxupr7vnganHKwxe6MVXd0Abs6";
35 mimas = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICzfTNppOS5b5IvZl1wqjGTUZE0D/o/MY8d7uKPWDvIp";
36 };
37 }