diff --git a/pkgs/applications/misc/hello/default.nix b/pkgs/applications/misc/hello/default.nix index 60482a84c9b..8d36b344a22 100644 --- a/pkgs/applications/misc/hello/default.nix +++ b/pkgs/applications/misc/hello/default.nix @@ -1,4 +1,5 @@ { lib +, runCommand , stdenv , fetchurl , nixos @@ -6,12 +7,12 @@ , hello }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (self: { pname = "hello"; version = "2.12"; src = fetchurl { - url = "mirror://gnu/hello/${pname}-${version}.tar.gz"; + url = "mirror://gnu/hello/${self.pname}-${self.version}.tar.gz"; sha256 = "1ayhp9v4m4rdhjmnl2bq3cibrbqqkgjbl3s7yk2nhlh8vj3ay16g"; }; @@ -27,6 +28,13 @@ stdenv.mkDerivation rec { (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 + ''; + meta = with lib; { description = "A program that produces a familiar, friendly greeting"; longDescription = '' @@ -34,9 +42,9 @@ stdenv.mkDerivation rec { It is fully customizable. ''; homepage = "https://www.gnu.org/software/hello/manual/"; - changelog = "https://git.savannah.gnu.org/cgit/hello.git/plain/NEWS?h=v${version}"; + changelog = "https://git.savannah.gnu.org/cgit/hello.git/plain/NEWS?h=v${self.version}"; license = licenses.gpl3Plus; maintainers = [ maintainers.eelco ]; platforms = platforms.all; }; -} +})