diff --git a/pkgs/applications/misc/hello/default.nix b/pkgs/applications/misc/hello/default.nix index 8d36b344a22d..0ea6570b3208 100644 --- a/pkgs/applications/misc/hello/default.nix +++ b/pkgs/applications/misc/hello/default.nix @@ -1,5 +1,5 @@ -{ lib -, runCommand +{ callPackage +, lib , stdenv , fetchurl , nixos @@ -28,12 +28,7 @@ stdenv.mkDerivation (self: { (nixos { environment.noXlibs = true; }).pkgs.hello; }; - passthru.tests.run = runCommand "hello-test-run" { - nativeBuildInputs = [ self ]; - } '' - diff -U3 --color=auto <(hello) <(echo 'Hello, world!') - touch $out - ''; + passthru.tests.run = callPackage ./test.nix { hello = self; }; meta = with lib; { description = "A program that produces a familiar, friendly greeting"; diff --git a/pkgs/applications/misc/hello/test.nix b/pkgs/applications/misc/hello/test.nix new file mode 100644 index 000000000000..7acded2a16f2 --- /dev/null +++ b/pkgs/applications/misc/hello/test.nix @@ -0,0 +1,8 @@ +{ runCommand, hello }: + +runCommand "hello-test-run" { + nativeBuildInputs = [ hello ]; +} '' + diff -U3 --color=auto <(hello) <(echo 'Hello, world!') + touch $out +''