pluto: init
Martin Weinelt committed
Feb 21, 2024 at 22:48 UTC
bff6d3dd8c0638913ac2c43ae0a06670c8726e0e
8 files changed
+203
-1
delft/flake.lock
+21
@@ -63,6 +63,26 @@
63
"type": "github"
64
}
65
},
66
+ "disko": {
67
+ "inputs": {
68
+ "nixpkgs": [
69
+ "nixpkgs"
70
+ ]
71
+ },
72
+ "locked": {
73
+ "lastModified": 1708305517,
74
+ "narHash": "sha256-WYnEspeTTksC21obnnxWOGOAQbnBD0GES0S0XOLsJjs=",
75
+ "owner": "nix-community",
76
+ "repo": "disko",
77
+ "rev": "1ae1f57dad13595600dd57b6a55fcbaef6673804",
78
+ "type": "github"
79
+ },
80
+ "original": {
81
+ "owner": "nix-community",
82
+ "repo": "disko",
83
+ "type": "github"
84
+ }
85
+ },
86
"flake-compat": {
87
"flake": false,
88
"locked": {
@@ -373,6 +393,7 @@
393
"root": {
394
"inputs": {
395
"agenix": "agenix",
396
+ "disko": "disko",
397
"hydra": "hydra",
398
"hydra-scale-equinix-metal": "hydra-scale-equinix-metal",
399
"nix": [
delft/flake.nix
+14
-1
@@ -4,6 +4,9 @@
4
inputs.agenix.url = "github:ryantm/agenix";
5
inputs.agenix.inputs.nixpkgs.follows = "nixpkgs";
6
7
+ inputs.disko.url = "github:nix-community/disko";
8
+ inputs.disko.inputs.nixpkgs.follows = "nixpkgs";
9
+
10
inputs.hydra.url = "github:NixOS/hydra/nix-2.19";
11
inputs.nix.follows = "hydra/nix";
12
@@ -17,13 +20,14 @@
20
inputs.rfc39.url = "github:NixOS/rfc39";
21
inputs.rfc39.inputs.nixpkgs.follows = "nixpkgs";
22
20
- outputs = flakes @ { self, agenix, hydra, hydra-scale-equinix-metal, nix, nixpkgs, nixos-channel-scripts, nix-netboot-serve, rfc39 }:
23
+ outputs = flakes @ { self, agenix, disko, hydra, hydra-scale-equinix-metal, nix, nixpkgs, nixos-channel-scripts, nix-netboot-serve, rfc39 }:
24
let
25
inherit (nixpkgs) lib;
26
27
flakesModule = {
28
imports = [
29
agenix.nixosModules.age
30
+ disko.nixosModules.disko
31
hydra.nixosModules.hydra
32
hydra-scale-equinix-metal.nixosModules.default
33
nix-netboot-serve.nixosModules.nix-netboot-serve
@@ -56,6 +60,15 @@
60
];
61
};
62
63
+ nixosConfigurations.pluto = nixpkgs.lib.nixosSystem {
64
+ system = "x86_64-linux";
65
+
66
+ modules = [
67
+ flakesModule
68
+ ./pluto
69
+ ];
70
+ };
71
+
72
nixosConfigurations.rhea = nixpkgs.lib.nixosSystem {
73
system = "x86_64-linux";
74
delft/pluto/boot.nix
new
+20
@@ -0,0 +1,20 @@
1
+{
2
+ boot = {
3
+ supportedFilesystems = [ "zfs" ];
4
+ loader = {
5
+ efi.canTouchEfiVariables = false;
6
+ grub = {
7
+ enable = true;
8
+ efiSupport = true;
9
+ efiInstallAsRemovable = true;
10
+ mirroredBoots = [ {
11
+ devices = [ "nodev" ];
12
+ path = "/efi/a";
13
+ } {
14
+ devices = [ "nodev" ];
15
+ path = "/efi/b";
16
+ } ];
17
+ };
18
+ };
19
+ };
20
+}
delft/pluto/default.nix
new
+18
@@ -0,0 +1,18 @@
1
+{
2
+ imports = [
3
+ ../common.nix
4
+ ./boot.nix
5
+ ./disko.nix
6
+ ./network.nix
7
+ ];
8
+
9
+ networking = {
10
+ hostName = "pluto";
11
+ domain = "nixos.org";
12
+ hostId = "e4c9bd10";
13
+ };
14
+
15
+ nixpkgs.hostPlatform = "x86_64-linux";
16
+
17
+ system.stateVersion = "23.11";
18
+}
delft/pluto/disko.nix
new
+90
@@ -0,0 +1,90 @@
1
+{
2
+ disko.devices = {
3
+ disk = {
4
+ nvme0n1 = {
5
+ type = "disk";
6
+ device = "/dev/disk/by-id/nvme-SAMSUNG_MZVL2512HDJD-00B07_S782NE0W900172";
7
+ content = {
8
+ type = "gpt";
9
+ partitions = {
10
+ esp = {
11
+ size = "1G";
12
+ type = "EF00";
13
+ content = {
14
+ type = "filesystem";
15
+ format = "vfat";
16
+ mountpoint = "/efi/a";
17
+ };
18
+ };
19
+ swap = {
20
+ size = "16G";
21
+ content = {
22
+ type = "swap";
23
+ };
24
+ };
25
+ zfs = {
26
+ size = "100%";
27
+ content = {
28
+ type = "zfs";
29
+ pool = "zroot";
30
+ };
31
+ };
32
+ };
33
+ };
34
+ };
35
+ nvme1n1 = {
36
+ type = "disk";
37
+ device = "/dev/disk/by-id/nvme-SAMSUNG_MZVL2512HDJD-00B07_S782NE0W900175";
38
+ content = {
39
+ type = "gpt";
40
+ partitions = {
41
+ esp = {
42
+ size = "1G";
43
+ type = "EF00";
44
+ content = {
45
+ type = "filesystem";
46
+ format = "vfat";
47
+ mountpoint = "/efi/b";
48
+ };
49
+ };
50
+ swap = {
51
+ size = "16G";
52
+ content = {
53
+ type = "swap";
54
+ };
55
+ };
56
+ zfs = {
57
+ size = "100%";
58
+ content = {
59
+ type = "zfs";
60
+ pool = "zroot";
61
+ };
62
+ };
63
+ };
64
+ };
65
+ };
66
+ };
67
+ zpool = {
68
+ zroot = {
69
+ type = "zpool";
70
+ options = {
71
+ ashift = "12";
72
+ autotrim = "on";
73
+ };
74
+ mode = "mirror";
75
+ rootFsOptions = {
76
+ acltype = "posixacl";
77
+ compression = "zstd";
78
+ mountpoint = "none";
79
+ };
80
+
81
+ datasets = {
82
+ root = {
83
+ type = "zfs_fs";
84
+ mountpoint = "/";
85
+ };
86
+ };
87
+ };
88
+ };
89
+ };
90
+}
delft/pluto/network.nix
new
+24
@@ -0,0 +1,24 @@
1
+{
2
+ systemd.network = {
3
+ enable = true;
4
+ networks = {
5
+ "30-enp5s0" = {
6
+ matchConfig = {
7
+ MACAddress = "08:bf:b8:18:2e:23";
8
+ Type = "ether";
9
+ };
10
+ linkConfig.RequiredForOnline = true;
11
+ networkConfig.Description = "WAN";
12
+ address = [
13
+ "37.27.99.100/26"
14
+ "2a01:4f9:3070:15e0::1/64"
15
+ ];
16
+ routes = [ {
17
+ routeConfig.Gateway = "37.27.99.65";
18
+ } {
19
+ routeConfig.Gateway = "fe80::1";
20
+ } ];
21
+ };
22
+ };
23
+ };
24
+}
modules/wireguard-hosts.toml
+6
@@ -43,6 +43,12 @@ ip = "10.254.1.5"
43
port = 51820
44
publicKey = "eIsaf/JYsxL/G5pCzKo10GeiqgdEwp8v9G4BSUBo3h0="
45
46
+[hosts.pluto]
47
+endpoint = "37.27.99.100"
48
+ip = "10.254.1.6"
49
+port = 51820
50
+publicKey = "ZDJhWcITV4SC7RHJRLMqiwjIXYC8Ac56XH4RR0C5IhI="
51
+
52
[hosts.haumea]
53
endpoint = "46.4.89.205"
54
ip = "10.254.1.9"
terraform/dns.tf
+10
@@ -61,6 +61,16 @@ locals {
61
type = "A"
62
value = "138.201.32.77"
63
},
64
+ {
65
+ hostname = "pluto.nixos.org"
66
+ type = "A"
67
+ value = "37.27.99.100"
68
+ },
69
+ {
70
+ hostname = "pluto.nixos.org"
71
+ type = "AAAA"
72
+ value = "2a01:4f9:3070:15e0::1"
73
+ },
74
{
75
hostname = "rhea.nixos.org"
76
type = "A"