From 0edf0fd22074c2ee178b194203643c19f9fb66d0 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Sun, 13 Jun 2021 01:10:46 +0200 Subject: [PATCH] hello: Test independence of environment.noXlibs --- pkgs/applications/misc/hello/default.nix | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) 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";