diff --git a/pkgs/applications/misc/hello/default.nix b/pkgs/applications/misc/hello/default.nix index b446fe6223df..9f1e89c0df6b 100644 --- a/pkgs/applications/misc/hello/default.nix +++ b/pkgs/applications/misc/hello/default.nix @@ -1,7 +1,9 @@ { lib , stdenv , fetchurl +, nixos , testVersion +, testEqualDerivation , hello }: @@ -16,8 +18,15 @@ stdenv.mkDerivation rec { doCheck = true; - passthru.tests.version = - testVersion { package = hello; }; + passthru.tests = { + version = testVersion { package = hello; }; + + invariant-under-noXlibs = + testEqualDerivation + "hello must not be rebuilt when environment.noXlibs is set." + hello + (nixos { environment.noXlibs = true; }).pkgs.hello; + }; meta = with lib; { description = "A program that produces a familiar, friendly greeting";