diff --git a/machines/loki/configuration.nix b/machines/loki/configuration.nix index 4f36160..3109dcd 100644 --- a/machines/loki/configuration.nix +++ b/machines/loki/configuration.nix @@ -199,107 +199,110 @@ sudo.enable = false; }; - systemd.network = { - enable = true; + systemd = { - wait-online = { - anyInterface = true; - }; + network = { + enable = true; - netdevs = { - "10-wghorus" = { - netdevConfig = { - Kind = "wireguard"; - MTUBytes = "1420"; - Name = "wghorus"; - }; - - wireguardConfig = { - PrivateKeyFile = config.sops.secrets.wireguard-horus-privkey.path; - ListenPort = 51820; - }; - - wireguardPeers = [ - { - wireguardPeerConfig = { - PublicKey = "6faxlUG8+F7uVrKk/OJqqy5k2+OzrhXc/cV6Zsfbl0c="; - AllowedIPs = [ "192.168.4.0/23" "192.168.6.0/24" "192.168.7.0/24" "192.168.8.0/24" ]; - Endpoint = "212.45.34.195:51820"; - PersistentKeepalive = 25; - }; - } - ]; + wait-online = { + anyInterface = true; }; - }; - networks = { - "40-enp4s0" = { - matchConfig = { - Name = "enp4s0"; - }; + netdevs = { + "10-wghorus" = { + netdevConfig = { + Kind = "wireguard"; + MTUBytes = "1420"; + Name = "wghorus"; + }; - networkConfig = { - DHCP = "yes"; + wireguardConfig = { + PrivateKeyFile = config.sops.secrets.wireguard-horus-privkey.path; + ListenPort = 51820; + }; + + wireguardPeers = [ + { + wireguardPeerConfig = { + PublicKey = "6faxlUG8+F7uVrKk/OJqqy5k2+OzrhXc/cV6Zsfbl0c="; + AllowedIPs = [ "192.168.4.0/23" "192.168.6.0/24" "192.168.7.0/24" "192.168.8.0/24" ]; + Endpoint = "212.45.34.195:51820"; + PersistentKeepalive = 25; + }; + } + ]; }; }; - "40-wghorus" = { - matchConfig = { - Name = "wghorus"; + + networks = { + "40-enp4s0" = { + matchConfig = { + Name = "enp4s0"; + }; + + networkConfig = { + DHCP = "yes"; + }; }; + "40-wghorus" = { + matchConfig = { + Name = "wghorus"; + }; - linkConfig = { - ActivationPolicy = "manual"; - }; + linkConfig = { + ActivationPolicy = "manual"; + }; - networkConfig = { - DHCP = "no"; - DNS = "192.168.4.1"; - Domains = [ "bedum.horus.nu" "internal.horus.nu" ]; - }; + networkConfig = { + DHCP = "no"; + DNS = "192.168.4.1"; + Domains = [ "bedum.horus.nu" "internal.horus.nu" ]; + }; - address = [ - "10.10.4.2/24" - ]; + address = [ + "10.10.4.2/24" + ]; - routes = [ - { - routeConfig = - { - Destination = "192.168.4.0/23"; + routes = [ + { + routeConfig = + { + Destination = "192.168.4.0/23"; + Scope = "link"; + }; + } + { + routeConfig = { + Destination = "192.168.6.0/24"; Scope = "link"; }; - } - { - routeConfig = { - Destination = "192.168.6.0/24"; - Scope = "link"; - }; - } - { - routeConfig = - { - Destination = "192.168.7.0/24"; - Scope = "link"; - }; - } - { - routeConfig = - { - Destination = "192.168.8.0/24"; - Scope = "link"; - }; - } - ]; + } + { + routeConfig = + { + Destination = "192.168.7.0/24"; + Scope = "link"; + }; + } + { + routeConfig = + { + Destination = "192.168.8.0/24"; + Scope = "link"; + }; + } + ]; + }; }; - }; - links = { - "40-enp4s0" = { - matchConfig = { - OriginalName = "enp4s0"; - }; - linkConfig = { - WakeOnLan = "magic"; + links = { + "40-enp4s0" = { + matchConfig = { + OriginalName = "enp4s0"; + }; + linkConfig = { + WakeOnLan = "magic"; + }; }; }; };