From 84a94ff0064cacbfba55e5f2eb59461f68235e97 Mon Sep 17 00:00:00 2001 From: "William A. Kennington III" Date: Thu, 24 Apr 2014 17:46:12 -0500 Subject: [PATCH] network-interfaces: Add an option for specifying search to resolv.conf --- nixos/modules/tasks/network-interfaces.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/nixos/modules/tasks/network-interfaces.nix b/nixos/modules/tasks/network-interfaces.nix index 9cc8b154324f..991f9f261450 100644 --- a/nixos/modules/tasks/network-interfaces.nix +++ b/nixos/modules/tasks/network-interfaces.nix @@ -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} '')}