From 046ed0c005028c2464054e53e230139bbbf404d0 Mon Sep 17 00:00:00 2001 From: Tom Hubrecht Date: Sun, 15 Dec 2024 17:59:50 +0100 Subject: [PATCH] chore(networking): Attributes have to me moved up --- machines/nixos/vault01/networking.nix | 60 ++++++++++----------------- modules/nixos/dgn-network.nix | 6 +-- 2 files changed, 24 insertions(+), 42 deletions(-) diff --git a/machines/nixos/vault01/networking.nix b/machines/nixos/vault01/networking.nix index c1eb018..fbacb96 100644 --- a/machines/nixos/vault01/networking.nix +++ b/machines/nixos/vault01/networking.nix @@ -61,28 +61,22 @@ let linkConfig.Promiscuous = true; addresses = [ { - addressConfig = { - Address = "${servIP}/27"; - AddPrefixRoute = false; - }; + Address = "${servIP}/27"; + AddPrefixRoute = false; } ]; routes = [ { - routeConfig = { - Destination = "${netIP}/27"; - Table = "user"; - }; + Destination = "${netIP}/27"; + Table = "user"; } ]; routingPolicyRules = [ { - routingPolicyRuleConfig = { - From = "${netIP}/27"; - To = "10.0.0.0/27"; - IncomingInterface = interfaceName; - Table = "user"; - }; + From = "${netIP}/27"; + To = "10.0.0.0/27"; + IncomingInterface = interfaceName; + Table = "user"; } ]; }; @@ -105,11 +99,9 @@ let extraNetwork.routes = [ { - routeConfig = { - # Get the public ip from the metadata - PreferredSource = builtins.head meta.network.${name}.addresses.ipv4; - Gateway = uplink.router; - }; + # Get the public ip from the metadata + PreferredSource = builtins.head meta.network.${name}.addresses.ipv4; + Gateway = uplink.router; } ]; }; @@ -124,11 +116,9 @@ let address = [ "fd26:baf9:d250:8001::1/64" ]; extraNetwork.ipv6Prefixes = [ { - ipv6PrefixConfig = { - AddressAutoconfiguration = false; - OnLink = false; - Prefix = "fd26:baf9:d250:8001::/64"; - }; + AddressAutoconfiguration = false; + OnLink = false; + Prefix = "fd26:baf9:d250:8001::/64"; } ]; }; @@ -156,18 +146,14 @@ in ]; routes = [ { - routeConfig = { - Destination = "10.0.0.0/27"; - Table = "user"; - }; + Destination = "10.0.0.0/27"; + Table = "user"; } ]; routingPolicyRules = [ { - routingPolicyRuleConfig = { - IncomingInterface = "lo"; - Table = "user"; - }; + IncomingInterface = "lo"; + Table = "user"; } ]; }; @@ -248,12 +234,10 @@ in wireguardPeers = [ { - wireguardPeerConfig = { - AllowedIPs = [ - "10.10.17.0/30" - ]; - PublicKey = "g6S3gBx1Hf2iX41tokD+m8WfzJJTTcsKifOkn+Wcd00="; - }; + AllowedIPs = [ + "10.10.17.0/30" + ]; + PublicKey = "g6S3gBx1Hf2iX41tokD+m8WfzJJTTcsKifOkn+Wcd00="; } ]; }; diff --git a/modules/nixos/dgn-network.nix b/modules/nixos/dgn-network.nix index 6bfa8b8..6b2e3a8 100644 --- a/modules/nixos/dgn-network.nix +++ b/modules/nixos/dgn-network.nix @@ -18,10 +18,8 @@ let mkAddress = { address, prefixLength, ... }: "${address}/${builtins.toString prefixLength}"; mkRoute = gateway: { - routeConfig = { - Gateway = gateway; - GatewayOnLink = true; - }; + Gateway = gateway; + GatewayOnLink = true; }; mkInterface = interface: net: {