From 887b66bee192b8005f97ad724232b12a21859d02 Mon Sep 17 00:00:00 2001 From: Rory& Date: Mon, 4 Nov 2024 03:06:47 +0100 Subject: Fix resolvconf BS --- host/Rory-desktop/configuration.nix | 8 +------- host/Rory-nginx/configuration.nix | 2 +- modules/base.nix | 29 +++++++++++++++++++++-------- 3 files changed, 23 insertions(+), 16 deletions(-) diff --git a/host/Rory-desktop/configuration.nix b/host/Rory-desktop/configuration.nix index 983d771..f0fb7a7 100644 --- a/host/Rory-desktop/configuration.nix +++ b/host/Rory-desktop/configuration.nix @@ -15,7 +15,6 @@ args@{ ../../modules/packages/vim.nix # ../../modules/environments/home.nix ../../modules/software-templates/profilers.nix - ../../modules/packages/overlays/openvpn.nix # Temporary: Fix a build failure ./postgres.nix ./nginx.nix @@ -257,13 +256,8 @@ args@{ hardware = { pulseaudio.enable = false; }; + programs.dconf.enable = true; - environment.etc."resolv.conf".text = '' - nameserver 8.8.8.8 - nameserver 8.4.4.8 - nameserver 1.1.1.1 - nameserver 1.0.0.1 - ''; #networking.wireguard.interfaces = { # wg-KP-Ran = { diff --git a/host/Rory-nginx/configuration.nix b/host/Rory-nginx/configuration.nix index 7b9132b..bac5644 100755 --- a/host/Rory-nginx/configuration.nix +++ b/host/Rory-nginx/configuration.nix @@ -54,7 +54,7 @@ enableIPv6 = false; }; enableIPv6 = lib.mkForce false; - nameservers = lib.mkOverride [ "192.168.1.1" ]; + nameservers = lib.mkForce [ "192.168.1.1" ]; }; monitoring = { diff --git a/modules/base.nix b/modules/base.nix index 4cf2aff..2f565e4 100755 --- a/modules/base.nix +++ b/modules/base.nix @@ -1,4 +1,9 @@ -{ pkgs, lib, ... }: +{ + pkgs, + lib, + config, + ... +}: { imports = [ @@ -6,6 +11,8 @@ ./users/Rory.nix ./extra-substituters.nix ./monitoring/module.nix + + ./packages/overlays/openvpn.nix # Temporary: Fix a build failure ]; boot = { @@ -60,19 +67,25 @@ # allowedTCPPorts = [ ... ]; # allowedUDPPorts = [ ... ]; }; - nameservers = [ + nameservers = lib.mkDefault [ "1.1.1.1" "1.0.0.1" "8.8.8.8" "8.4.4.8" ]; }; - environment.etc."resolv.conf".text = '' - nameserver 8.8.8.8 - nameserver 8.4.4.8 - nameserver 1.1.1.1 - nameserver 1.0.0.1 - ''; + + environment.etc."resolv.conf" = lib.mkDefault { + text = lib.concatStringsSep "\n" ( + lib.optionals (config.networking ? nameservers) (map (nameserver: "nameserver ${nameserver}") (config.networking.nameservers)) + ++ lib.optionals (config.networking ? enableIPv6 && !config.networking.enableIPv6) [ "options no-aaaa" ] + ++ lib.optionals (config.networking ? enableIPv6 && config.networking.enableIPv6) [ + "options single-request" + "options single-request-reopen" + "options inet6" + ] + ); + }; i18n.defaultLocale = "en_US.UTF-8"; -- cgit 1.4.1