diff --git a/pkgs/shells/elvish/default.nix b/pkgs/shells/elvish/default.nix index e94354d68045..ba03ffb4f455 100644 --- a/pkgs/shells/elvish/default.nix +++ b/pkgs/shells/elvish/default.nix @@ -1,4 +1,4 @@ -{ lib, buildGoModule, fetchFromGitHub }: +{ lib, buildGoModule, fetchFromGitHub, runCommand }: buildGoModule rec { pname = "elvish"; @@ -6,7 +6,7 @@ buildGoModule rec { subPackages = [ "cmd/elvish" ]; - ldflags = [ "-s" "-w" "-X github.com/elves/elvish/pkg/buildinfo.Version==${version}" "-X github.com/elves/elvish/pkg/buildinfo.Reproducible=true" ]; + ldflags = [ "-s" "-w" "-X src.elv.sh/pkg/buildinfo.Version==${version}" "-X src.elv.sh/pkg/buildinfo.Reproducible=true" ]; src = fetchFromGitHub { owner = "elves"; @@ -19,6 +19,25 @@ buildGoModule rec { doCheck = false; + doInstallCheck = true; + installCheckPhase = '' + runHook preInstallCheck + + $out${passthru.shellPath} -c " + fn expect {|key expected| + var actual = \$buildinfo[\$key] + if (not-eq \$actual \$expected) { + fail '\$buildinfo['\$key']: expected '(to-string \$expected)', got '(to-string \$actual) + } + } + + expect version ${version} + expect reproducible \$true + " + + runHook postInstallCheck + ''; + meta = with lib; { description = "A friendly and expressive command shell"; longDescription = '' @@ -31,7 +50,5 @@ buildGoModule rec { maintainers = with maintainers; [ vrthra AndersonTorres ]; }; - passthru = { - shellPath = "/bin/elvish"; - }; + passthru.shellPath = "/bin/elvish"; }