@cryptotaxi247 / infra / commits / e084825b

umbriel: init

This is an ARM64 VM at Hetzner Cloud, that we plan to use for the Matrix moderation bot Mjölnir.

Martin Weinelt committed Nov 13, 2023 at 23:01 UTC e084825bef2327ca9ca27545d458e26689855460
4 files changed +137
non-critical-infra/hosts/umbriel.nixos.org/default.nix new
+51
@@ -0,0 +1,51 @@
1 +{ inputs, lib, ... }:
2 +
3 +{
4 + imports =
5 + [
6 + ./hardware.nix
7 + inputs.srvos.nixosModules.server
8 + inputs.srvos.nixosModules.hardware-hetzner-cloud-arm
9 + ];
10 +
11 + # Bootloader.
12 + boot.loader.systemd-boot.enable = true;
13 + boot.loader.timeout = lib.mkForce 5;
14 + boot.loader.efi.efiSysMountPoint = "/efi";
15 + boot.supportedFilesystems = [ "zfs" ];
16 +
17 + # workaround because the console defaults to serial
18 + boot.kernelParams = [ "console=tty" ];
19 +
20 + services.cloud-init.enable = false;
21 +
22 + networking = {
23 + hostName = "umbriel";
24 + domain = "nixos.org";
25 + hostId = "36d29388";
26 + };
27 +
28 + disko.devices = import ./disko.nix;
29 +
30 + systemd.network.networks."10-uplink" = {
31 + matchConfig.MACAddress = "96:00:02:b5:f8:99";
32 + address = [
33 + "37.27.20.162/32"
34 + "2a01:4f9:c011:8fb5::1/64"
35 + ];
36 + routes = [
37 + { routeConfig.Gateway = "fe80::1"; }
38 + { routeConfig = {
39 + Gateway = "172.31.1.1";
40 + GatewayOnLink = true;
41 + }; }
42 + ];
43 + linkConfig.RequiredForOnline = "routable";
44 + };
45 +
46 + services.openssh.enable = true;
47 + users.users.root.openssh.authorizedKeys.keys = (import ../../../ssh-keys.nix).infra;
48 +
49 + system.stateVersion = "23.05";
50 +}
51 +
non-critical-infra/hosts/umbriel.nixos.org/disko.nix new
+62
@@ -0,0 +1,62 @@
1 +{
2 + disk = {
3 + main = {
4 + device = "/dev/sda";
5 + type = "disk";
6 + content = {
7 + type = "gpt";
8 + partitions = {
9 + esp = {
10 + type = "EF00";
11 + size = "1024M";
12 + content = {
13 + type = "filesystem";
14 + format = "vfat";
15 + mountpoint = "/efi";
16 + };
17 + };
18 + root = {
19 + size = "100%";
20 + content = {
21 + type = "zfs";
22 + pool = "zroot";
23 + };
24 + };
25 + };
26 + };
27 + };
28 + };
29 +
30 + zpool.zroot = {
31 + type = "zpool";
32 + options = {
33 + # smartctl --all /dev/sda
34 + # Logical block size: 512 bytes
35 + ashift = "9";
36 + };
37 + rootFsOptions = {
38 + acltype = "posixacl";
39 + compression = "zstd";
40 + mountpoint = "none";
41 + xattr = "sa";
42 + };
43 + datasets = {
44 + "root" = {
45 + type = "zfs_fs";
46 + mountpoint = "/";
47 + };
48 + "nix" = {
49 + type = "zfs_fs";
50 + mountpoint = "/nix";
51 + };
52 + "reserved" = {
53 + type = "zfs_fs";
54 + options = {
55 + canmount = "off";
56 + refreservation = "1G";
57 + };
58 + };
59 + };
60 + };
61 +}
62 +
non-critical-infra/hosts/umbriel.nixos.org/hardware.nix new
+14
@@ -0,0 +1,14 @@
1 +{ lib, ... }:
2 +
3 +{
4 +
5 + boot.initrd.availableKernelModules = [ "xhci_pci" "virtio_pci" "usbhid" "sr_mod" ];
6 + boot.initrd.kernelModules = [ "virtio_gpu" ];
7 + boot.kernelModules = [ ];
8 + boot.extraModulePackages = [ ];
9 +
10 + swapDevices = [ ];
11 +
12 + nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux";
13 +}
14 +
terraform/dns.tf
+10
@@ -260,6 +260,16 @@ locals {
260 hostname = "nixpkgs-merge-bot.nixos.org"
261 type = "A"
262 value = "37.27.11.42"
263 + },
264 + {
265 + hostname = "umbriel.nixos.org"
266 + type = "A"
267 + value = "37.27.20.162"
268 + },
269 + {
270 + hostname = "umbriel.nixos.org"
271 + type = "AAAA"
272 + value = "2a01:4f9:c011:8fb5::1"
273 }
274 ]
275 }