network-interfaces: Add an option for specifying search to resolv.conf

This commit is contained in:
William A. Kennington III 2014-04-24 17:46:12 -05:00
parent 1ac4383889
commit 84a94ff006

View File

@ -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 {
default = "";
example = "home";
@ -424,6 +433,7 @@ in
${optionalString (cfg.nameservers != [] && cfg.domain != "") ''
domain ${cfg.domain}
''}
${optionalString (cfg.search != []) ("search " + concatStringsSep " " cfg.search)}
${flip concatMapStrings cfg.nameservers (ns: ''
nameserver ${ns}
'')}