diff --git a/nixos/modules/config/networking.nix b/nixos/modules/config/networking.nix index ae30a710bf6f..d503f5a8b20e 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) {