Merge pull request #2380 from wkennington/cache.search
network-interfaces: Add an option for specifying search to resolv.conf
This commit is contained in:
commit
8007f32712
@ -183,6 +183,15 @@ in
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
networking.search = mkOption {
|
||||||
|
default = [];
|
||||||
|
example = [ "example.com" "local.domain" ];
|
||||||
|
type = types.listOf types.str;
|
||||||
|
description = ''
|
||||||
|
The list of search paths used when resolving domain names.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
networking.domain = mkOption {
|
networking.domain = mkOption {
|
||||||
default = "";
|
default = "";
|
||||||
example = "home";
|
example = "home";
|
||||||
@ -424,6 +433,7 @@ in
|
|||||||
${optionalString (cfg.nameservers != [] && cfg.domain != "") ''
|
${optionalString (cfg.nameservers != [] && cfg.domain != "") ''
|
||||||
domain ${cfg.domain}
|
domain ${cfg.domain}
|
||||||
''}
|
''}
|
||||||
|
${optionalString (cfg.search != []) ("search " + concatStringsSep " " cfg.search)}
|
||||||
${flip concatMapStrings cfg.nameservers (ns: ''
|
${flip concatMapStrings cfg.nameservers (ns: ''
|
||||||
nameserver ${ns}
|
nameserver ${ns}
|
||||||
'')}
|
'')}
|
||||||
|
Loading…
Reference in New Issue
Block a user