chore: homelab - use proxyGateway's dns service

This commit is contained in:
Ryan Yin
2026-03-26 13:29:29 +08:00
parent d2590d3653
commit f398c44307
5 changed files with 16 additions and 9 deletions
+2 -1
View File
@@ -58,7 +58,8 @@ in
matchConfig.Name = [ iface ]; matchConfig.Name = [ iface ];
networkConfig = { networkConfig = {
Address = [ ipv4WithMask ]; Address = [ ipv4WithMask ];
DNS = nameservers; # DNS = nameservers;
DNS = [ proxyGateway ];
DHCP = "ipv6"; # enable DHCPv6 only, so we can get a GUA. DHCP = "ipv6"; # enable DHCPv6 only, so we can get a GUA.
IPv6AcceptRA = true; # for Stateless IPv6 Autoconfiguraton (SLAAC) IPv6AcceptRA = true; # for Stateless IPv6 Autoconfiguraton (SLAAC)
LinkLocalAddressing = "ipv6"; LinkLocalAddressing = "ipv6";
+2 -1
View File
@@ -51,7 +51,8 @@ in
matchConfig.Name = [ iface ]; matchConfig.Name = [ iface ];
networkConfig = { networkConfig = {
Address = [ ipv4WithMask ]; Address = [ ipv4WithMask ];
DNS = nameservers; # DNS = nameservers;
DNS = [ proxyGateway ];
DHCP = "ipv6"; # enable DHCPv6 only, so we can get a GUA. DHCP = "ipv6"; # enable DHCPv6 only, so we can get a GUA.
IPv6AcceptRA = true; # for Stateless IPv6 Autoconfiguraton (SLAAC) IPv6AcceptRA = true; # for Stateless IPv6 Autoconfiguraton (SLAAC)
LinkLocalAddressing = "ipv6"; LinkLocalAddressing = "ipv6";
+2 -1
View File
@@ -60,7 +60,8 @@ in
matchConfig.Name = [ iface ]; matchConfig.Name = [ iface ];
networkConfig = { networkConfig = {
Address = [ ipv4WithMask ]; Address = [ ipv4WithMask ];
DNS = nameservers; # DNS = nameservers;
DNS = [ proxyGateway ];
DHCP = "ipv6"; # enable DHCPv6 only, so we can get a GUA. DHCP = "ipv6"; # enable DHCPv6 only, so we can get a GUA.
IPv6AcceptRA = true; # for Stateless IPv6 Autoconfiguraton (SLAAC) IPv6AcceptRA = true; # for Stateless IPv6 Autoconfiguraton (SLAAC)
LinkLocalAddressing = "ipv6"; LinkLocalAddressing = "ipv6";
+8 -5
View File
@@ -3,11 +3,13 @@
hostName, hostName,
networking, networking,
... ...
}: let }:
let
inherit (networking) proxyGateway proxyGateway6 nameservers; inherit (networking) proxyGateway proxyGateway6 nameservers;
inherit (networking.hostsAddr.${hostName}) iface ipv4; inherit (networking.hostsAddr.${hostName}) iface ipv4;
ipv4WithMask = "${ipv4}/24"; ipv4WithMask = "${ipv4}/24";
in { in
{
# supported file systems, so we can mount any removable disks with these filesystems # supported file systems, so we can mount any removable disks with these filesystems
boot.supportedFilesystems = [ boot.supportedFilesystems = [
"ext4" "ext4"
@@ -29,10 +31,11 @@ in {
systemd.network.enable = true; systemd.network.enable = true;
systemd.network.networks."10-${iface}" = { systemd.network.networks."10-${iface}" = {
matchConfig.Name = [iface]; matchConfig.Name = [ iface ];
networkConfig = { networkConfig = {
Address = [ipv4WithMask]; Address = [ ipv4WithMask ];
DNS = nameservers; # DNS = nameservers;
DNS = [ proxyGateway ];
DHCP = "ipv6"; # enable DHCPv6 only, so we can get a GUA. DHCP = "ipv6"; # enable DHCPv6 only, so we can get a GUA.
IPv6AcceptRA = true; # for Stateless IPv6 Autoconfiguraton (SLAAC) IPv6AcceptRA = true; # for Stateless IPv6 Autoconfiguraton (SLAAC)
LinkLocalAddressing = "ipv6"; LinkLocalAddressing = "ipv6";
+2 -1
View File
@@ -110,7 +110,8 @@ in
matchConfig.Name = [ "ovsbr1" ]; matchConfig.Name = [ "ovsbr1" ];
networkConfig = { networkConfig = {
Address = [ ipv4WithMask ]; Address = [ ipv4WithMask ];
DNS = nameservers; # DNS = nameservers;
DNS = [ proxyGateway ];
DHCP = "ipv6"; # enable DHCPv6 only, so we can get a GUA. DHCP = "ipv6"; # enable DHCPv6 only, so we can get a GUA.
IPv6AcceptRA = true; # for Stateless IPv6 Autoconfiguraton (SLAAC) IPv6AcceptRA = true; # for Stateless IPv6 Autoconfiguraton (SLAAC)
LinkLocalAddressing = "ipv6"; LinkLocalAddressing = "ipv6";