yep, more dotfiles

weird-row-server: fix networking config

wiro.world 7037142c 2509ab43

verified
+31 -39
+6
Justfile
··· 26 26 --flake .#{{host}} \ 27 27 --target-host {{host}} \ 28 28 --sudo {{args}} 29 + 30 + test-target host *args: 31 + nixos-rebuild test \ 32 + --flake .#{{host}} \ 33 + --target-host {{host}} \ 34 + --sudo {{args}}
+1 -1
globals.nix
··· 35 35 hosts = { 36 36 weird-row-server = { 37 37 ip = "91.99.55.74"; 38 - ip-prefix-length = 1; 38 + ip-prefix-length = 32; 39 39 ip6 = "2a01:4f8:c2c:76d2::1"; 40 40 ip6-prefix-length = 64; 41 41 ip6-agnos = "2a01:4f8:c2c:76d2::2";
+24 -38
hosts/weird-row-server/default.nix
··· 6 6 7 7 let 8 8 inherit (self.inputs) srvos; 9 - 10 - ext-if = "eth0"; 11 - external-gateway = "144.x.x.255"; 12 - external-gateway6 = "fe80::1"; 13 9 in 14 10 { 15 11 imports = [ ··· 53 49 "ext4" 54 50 ]; 55 51 56 - networking = { 57 - # Single network card is `eth0` 58 - usePredictableInterfaceNames = false; 52 + networking.nameservers = [ 53 + "2001:4860:4860::8888" 54 + "2001:4860:4860::8844" 55 + ]; 56 + 57 + # Single network card is `eth0` 58 + networking.usePredictableInterfaceNames = false; 59 59 60 - nameservers = [ 61 - "2001:4860:4860::8888" 62 - "2001:4860:4860::8844" 60 + systemd.network.networks."40-eth0" = { 61 + matchConfig.Name = "eth0"; 62 + address = [ 63 + "${globals.hosts.weird-row-server.ip}/${toString globals.hosts.weird-row-server.ip-prefix-length}" 64 + "${globals.hosts.weird-row-server.ip6}/${toString globals.hosts.weird-row-server.ip6-prefix-length}" 65 + "${globals.hosts.weird-row-server.ip6-agnos}/${toString globals.hosts.weird-row-server.ip6-prefix-length}" 63 66 ]; 64 - 65 - interfaces.${ext-if} = { 66 - ipv4.addresses = [ 67 - { 68 - address = globals.hosts.weird-row-server.ip; 69 - prefixLength = globals.hosts.weird-row-server.ip-prefix-length; 70 - } 71 - ]; 72 - ipv6.addresses = [ 73 - { 74 - address = globals.hosts.weird-row-server.ip6; 75 - prefixLength = globals.hosts.weird-row-server.ip6-prefix-length; 76 - } 77 - { 78 - address = globals.hosts.weird-row-server.ip6-agnos; 79 - prefixLength = globals.hosts.weird-row-server.ip6-prefix-length; 80 - } 81 - ]; 82 - }; 83 - defaultGateway = { 84 - interface = ext-if; 85 - address = external-gateway; 86 - }; 87 - defaultGateway6 = { 88 - interface = ext-if; 89 - address = external-gateway6; 90 - }; 67 + routes = [ 68 + { 69 + Gateway = "172.31.1.1"; 70 + GatewayOnLink = true; 71 + } 72 + { Gateway = "fe80::1"; } 73 + ]; 74 + linkConfig.RequiredForOnline = "routable"; 75 + }; 91 76 92 - }; 77 + # wrote a file in /etc/systemd/networking/ that override networking.interfaces 78 + services.cloud-init.network.enable = false; 93 79 94 80 services.qemuGuest.enable = true; 95 81