summary refs log tree commit diff
path: root/nixos/modules/config
diff options
context:
space:
mode:
authorJörg Thalheim <joerg@thalheim.io>2017-05-31 22:34:06 +0100
committerJörg Thalheim <joerg@thalheim.io>2017-05-31 23:30:35 +0100
commit859267f627aefa12a9180e1c821fa4fbed7ed188 (patch)
treef7746dba0d5951e295502335ebbd8d035f6a41de /nixos/modules/config
parent5604dbe8785c607dbdbc35ade531194e82ca3f3e (diff)
downloadnixpkgs-859267f627aefa12a9180e1c821fa4fbed7ed188.tar
nixpkgs-859267f627aefa12a9180e1c821fa4fbed7ed188.tar.gz
nixpkgs-859267f627aefa12a9180e1c821fa4fbed7ed188.tar.bz2
nixpkgs-859267f627aefa12a9180e1c821fa4fbed7ed188.tar.lz
nixpkgs-859267f627aefa12a9180e1c821fa4fbed7ed188.tar.xz
nixpkgs-859267f627aefa12a9180e1c821fa4fbed7ed188.tar.zst
nixpkgs-859267f627aefa12a9180e1c821fa4fbed7ed188.zip
systemd-resolved: fix case when dnsmasq is used as local resolver
fixes #25706
Diffstat (limited to 'nixos/modules/config')
-rw-r--r--nixos/modules/config/networking.nix12
1 files changed, 5 insertions, 7 deletions
diff --git a/nixos/modules/config/networking.nix b/nixos/modules/config/networking.nix
index ae30a710bf6..d503f5a8b20 100644
--- a/nixos/modules/config/networking.nix
+++ b/nixos/modules/config/networking.nix
@@ -222,13 +222,11 @@ in
             '' + cfg.extraResolvconfConf + ''
             '';
 
-      } // (optionalAttrs config.services.resolved.enable (
-        if dnsmasqResolve then {
-          "dnsmasq-resolv.conf".source = "/run/systemd/resolve/resolv.conf";
-        } else {
-          "resolv.conf".source = "/run/systemd/resolve/resolv.conf";
-        }
-      ));
+      } // optionalAttrs config.services.resolved.enable {
+        "resolv.conf".source = "/run/systemd/resolve/resolv.conf";
+      } // optionalAttrs (config.services.resolved.enable && dnsmasqResolve) {
+        "dnsmasq-resolv.conf".source = "/run/systemd/resolve/resolv.conf";
+      };
 
       networking.proxy.envVars =
         optionalAttrs (cfg.proxy.default != null) {