mirror of
https://github.com/SebastianWendel/nixpkgs.git
synced 2024-09-20 20:39:04 +02:00
nixos/resolved: Allow upstream fallback override
The previous code did not apply any changes to the upstream defaults on being presented with an empty list. This changes the code to use the above behaviour on a `null` value while an empty list is passed through as normal which yields a systemd configuration line with empty value which resets it to an empty value. Signed-off-by: benaryorg <binary@benary.org>
This commit is contained in:
parent
d384270823
commit
57846d0cae
|
@ -23,12 +23,13 @@ in
|
|||
};
|
||||
|
||||
services.resolved.fallbackDns = mkOption {
|
||||
default = [ ];
|
||||
default = null;
|
||||
example = [ "8.8.8.8" "2001:4860:4860::8844" ];
|
||||
type = types.listOf types.str;
|
||||
type = types.nullOr (types.listOf types.str);
|
||||
description = lib.mdDoc ''
|
||||
A list of IPv4 and IPv6 addresses to use as the fallback DNS servers.
|
||||
If this option is empty, a compiled-in list of DNS servers is used instead.
|
||||
If this option is null, a compiled-in list of DNS servers is used instead.
|
||||
Setting this option to an empty list will override the built-in list to an empty list, disabling fallback.
|
||||
'';
|
||||
};
|
||||
|
||||
|
@ -134,7 +135,7 @@ in
|
|||
[Resolve]
|
||||
${optionalString (config.networking.nameservers != [])
|
||||
"DNS=${concatStringsSep " " config.networking.nameservers}"}
|
||||
${optionalString (cfg.fallbackDns != [])
|
||||
${optionalString (cfg.fallbackDns != null)
|
||||
"FallbackDNS=${concatStringsSep " " cfg.fallbackDns}"}
|
||||
${optionalString (cfg.domains != [])
|
||||
"Domains=${concatStringsSep " " cfg.domains}"}
|
||||
|
|
Loading…
Reference in a new issue