diff --git a/pkgs/servers/dns/nsd/default.nix b/pkgs/servers/dns/nsd/default.nix index 7279aa6d4ef8..f5cf9544b9b4 100644 --- a/pkgs/servers/dns/nsd/default.nix +++ b/pkgs/servers/dns/nsd/default.nix @@ -1,4 +1,13 @@ { config, stdenv, fetchurl, libevent, openssl +, bind8Stats ? false +, checking ? false +, ipv6 ? true +, mmap ? false +, minimalResponses ? true +, nsec3 ? true +, ratelimit ? false +, recvmmsg ? false +, rootServer ? false }: stdenv.mkDerivation rec { @@ -12,17 +21,16 @@ stdenv.mkDerivation rec { buildInputs = [ libevent openssl ]; configureFlags = - let flag = state: flags: if state then map (x: "--enable-${x}") flags - else map (x: "--disable-${x}") flags; - in flag (config.nsd.bind8Stats or false) [ "bind8-stats" ] - ++ flag (config.nsd.checking or false) [ "checking" ] - ++ flag (config.nsd.ipv6 or true) [ "ipv6" ] - ++ flag (config.nsd.mmap or false) [ "mmap" ] - ++ flag (config.nsd.minimalResponses or true) [ "minimal-responses" ] - ++ flag (config.nsd.nsec3 or true) [ "nsec3" ] - ++ flag (config.nsd.ratelimit or false) [ "ratelimit" ] - ++ flag (config.nsd.recvmmsg or false) [ "recvmmsg" ] - ++ flag (config.nsd.rootServer or false) [ "root-server" ] + let edf = c: o: if c then ["--enable-${o}"] else ["--disable-${o}"]; + in edf bind8Stats "bind8-stats" + ++ edf checking "checking" + ++ edf ipv6 "ipv6" + ++ edf mmap "mmap" + ++ edf minimalResponses "minimal-responses" + ++ edf nsec3 "nsec3" + ++ edf ratelimit "ratelimit" + ++ edf recvmmsg "recvmmsg" + ++ edf rootServer "root-server" ++ [ "--with-ssl=${openssl}" "--with-libevent=${libevent}" ]; meta = { diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c6e896163129..31e9f9f64d3a 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7003,7 +7003,7 @@ let nix-binary-cache = callPackage ../servers/http/nix-binary-cache {}; - nsd = callPackage ../servers/dns/nsd { }; + nsd = callPackage ../servers/dns/nsd (config.nsd or {}); nsq = callPackage ../servers/nsq { };