diff --git a/pkgs/tools/networking/unbound/default.nix b/pkgs/tools/networking/unbound/default.nix index bd994c2640f9..26401f229c25 100644 --- a/pkgs/tools/networking/unbound/default.nix +++ b/pkgs/tools/networking/unbound/default.nix @@ -12,6 +12,8 @@ , pkg-config , makeWrapper , symlinkJoin +, bison +, nixosTests # # By default unbound will not be built with systemd support. Unbound is a very # commmon dependency. The transitive dependency closure of systemd also @@ -91,6 +93,10 @@ stdenv.mkDerivation rec { sed -E '/CONFCMDLINE/ s;${storeDir}/[a-z0-9]{32}-;${storeDir}/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-;g' -i config.h ''; + checkInputs = [ bison ]; + + doCheck = true; + installFlags = [ "configfile=\${out}/etc/unbound/unbound.conf" ]; postInstall = '' @@ -107,6 +113,7 @@ stdenv.mkDerivation rec { configureFlags="$configureFlags --with-nettle=${nettle.dev} --with-libunbound-only" configurePhase buildPhase + checkPhase installPhase '' # get rid of runtime dependencies on $dev outputs @@ -115,6 +122,8 @@ stdenv.mkDerivation rec { (pkg: lib.optionalString (pkg ? dev) " --replace '-L${pkg.dev}/lib' '-L${pkg.out}/lib' --replace '-R${pkg.dev}/lib' '-R${pkg.out}/lib'") (builtins.filter (p: p != null) buildInputs); + passthru.tests = nixosTests.unbound; + meta = with lib; { description = "Validating, recursive, and caching DNS resolver"; license = licenses.bsd3;