@cryptotaxi247 / infra / commits / 01de4aba

rhea: refactor networkd usage, enable resolved

- Disable the network.interfaces translation mechanism - Align networkd configuration with those of our other machines

Martin Weinelt committed Feb 11, 2024 at 20:53 UTC 01de4aba86c75c39fe3877437ff8ece389b70d77
3 files changed +25 -32
delft/rhea/configuration.nix
+1
@@ -3,6 +3,7 @@
3 imports =
4 [ ./hardware-configuration.nix
5 ./hetzner.nix
6 + ./network.nix
7 ../common.nix
8 ../hydra.nix
9 ../hydra-proxy.nix
delft/rhea/hetzner.nix
-32
@@ -1,36 +1,4 @@
1 {
2 boot.loader.systemd-boot.enable = true;
3 boot.loader.efi.canTouchEfiVariables = true;
4 -
5 - networking.hostId = "9cd372da";
6 - networking.useNetworkd = true;
7 - systemd.network.networks."40-enp7s0" = {
8 - matchConfig = {
9 - MACAddress = "50:eb:f6:22:f0:3a";
10 - };
11 -
12 - addresses = [
13 - {
14 - addressConfig.Address = "5.9.122.43/27";
15 - }
16 - {
17 - addressConfig.Address = "2a01:4f8:162:71eb::/64";
18 - }
19 - ];
20 - routes = [
21 - {
22 - routeConfig.Gateway = "5.9.122.33";
23 - }
24 - {
25 - routeConfig.Gateway = "fe80::1";
26 - }
27 - ];
28 -
29 - dns = [
30 - "185.12.64.1"
31 - "185.12.64.2"
32 - "2a01:4ff:ff00::add:1"
33 - "2a01:4ff:ff00::add:2"
34 - ];
35 - };
4 }
delft/rhea/network.nix new
+24
@@ -0,0 +1,24 @@
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 + routeConfig.Gateway = "5.9.122.33";
19 + } {
20 + routeConfig.Gateway = "fe80::1";
21 + } ];
22 + };
23 + };
24 +}