From f398c44307998f81c30fc211214d309f378e070a Mon Sep 17 00:00:00 2001 From: Ryan Yin Date: Thu, 26 Mar 2026 13:29:29 +0800 Subject: [PATCH] chore: homelab - use proxyGateway's dns service --- hosts/idols-aquamarine/default.nix | 3 ++- hosts/idols-kana/default.nix | 3 ++- hosts/idols-ruby/default.nix | 3 ++- lib/genKubeVirtGuestModule.nix | 13 ++++++++----- lib/genKubeVirtHostModule.nix | 3 ++- 5 files changed, 16 insertions(+), 9 deletions(-) diff --git a/hosts/idols-aquamarine/default.nix b/hosts/idols-aquamarine/default.nix index 73a6ffdf..ea023bb1 100644 --- a/hosts/idols-aquamarine/default.nix +++ b/hosts/idols-aquamarine/default.nix @@ -58,7 +58,8 @@ in matchConfig.Name = [ iface ]; networkConfig = { Address = [ ipv4WithMask ]; - DNS = nameservers; + # DNS = nameservers; + DNS = [ proxyGateway ]; DHCP = "ipv6"; # enable DHCPv6 only, so we can get a GUA. IPv6AcceptRA = true; # for Stateless IPv6 Autoconfiguraton (SLAAC) LinkLocalAddressing = "ipv6"; diff --git a/hosts/idols-kana/default.nix b/hosts/idols-kana/default.nix index 9d402474..ab84fdf6 100644 --- a/hosts/idols-kana/default.nix +++ b/hosts/idols-kana/default.nix @@ -51,7 +51,8 @@ in matchConfig.Name = [ iface ]; networkConfig = { Address = [ ipv4WithMask ]; - DNS = nameservers; + # DNS = nameservers; + DNS = [ proxyGateway ]; DHCP = "ipv6"; # enable DHCPv6 only, so we can get a GUA. IPv6AcceptRA = true; # for Stateless IPv6 Autoconfiguraton (SLAAC) LinkLocalAddressing = "ipv6"; diff --git a/hosts/idols-ruby/default.nix b/hosts/idols-ruby/default.nix index 7cfa505d..dc8093ff 100644 --- a/hosts/idols-ruby/default.nix +++ b/hosts/idols-ruby/default.nix @@ -60,7 +60,8 @@ in matchConfig.Name = [ iface ]; networkConfig = { Address = [ ipv4WithMask ]; - DNS = nameservers; + # DNS = nameservers; + DNS = [ proxyGateway ]; DHCP = "ipv6"; # enable DHCPv6 only, so we can get a GUA. IPv6AcceptRA = true; # for Stateless IPv6 Autoconfiguraton (SLAAC) LinkLocalAddressing = "ipv6"; diff --git a/lib/genKubeVirtGuestModule.nix b/lib/genKubeVirtGuestModule.nix index 513d704e..98b7e15e 100644 --- a/lib/genKubeVirtGuestModule.nix +++ b/lib/genKubeVirtGuestModule.nix @@ -3,11 +3,13 @@ hostName, networking, ... -}: let +}: +let inherit (networking) proxyGateway proxyGateway6 nameservers; inherit (networking.hostsAddr.${hostName}) iface ipv4; ipv4WithMask = "${ipv4}/24"; -in { +in +{ # supported file systems, so we can mount any removable disks with these filesystems boot.supportedFilesystems = [ "ext4" @@ -29,10 +31,11 @@ in { systemd.network.enable = true; systemd.network.networks."10-${iface}" = { - matchConfig.Name = [iface]; + matchConfig.Name = [ iface ]; networkConfig = { - Address = [ipv4WithMask]; - DNS = nameservers; + Address = [ ipv4WithMask ]; + # DNS = nameservers; + DNS = [ proxyGateway ]; DHCP = "ipv6"; # enable DHCPv6 only, so we can get a GUA. IPv6AcceptRA = true; # for Stateless IPv6 Autoconfiguraton (SLAAC) LinkLocalAddressing = "ipv6"; diff --git a/lib/genKubeVirtHostModule.nix b/lib/genKubeVirtHostModule.nix index 2f80a2eb..54623c28 100644 --- a/lib/genKubeVirtHostModule.nix +++ b/lib/genKubeVirtHostModule.nix @@ -110,7 +110,8 @@ in matchConfig.Name = [ "ovsbr1" ]; networkConfig = { Address = [ ipv4WithMask ]; - DNS = nameservers; + # DNS = nameservers; + DNS = [ proxyGateway ]; DHCP = "ipv6"; # enable DHCPv6 only, so we can get a GUA. IPv6AcceptRA = true; # for Stateless IPv6 Autoconfiguraton (SLAAC) LinkLocalAddressing = "ipv6";