lol

elvish: rewrite

+31 -17
+31 -17
pkgs/shells/elvish/default.nix
··· 1 - { lib, buildGoModule, fetchFromGitHub, runCommand }: 1 + { lib 2 + , buildGoModule 3 + , fetchFromGitHub 4 + , runCommand 5 + }: 2 6 3 - buildGoModule rec { 7 + let 4 8 pname = "elvish"; 5 9 version = "0.19.2"; 6 - 7 - subPackages = [ "cmd/elvish" ]; 8 - 9 - ldflags = [ "-s" "-w" "-X src.elv.sh/pkg/buildinfo.Version==${version}" ]; 10 + shellPath = "/bin/elvish"; 11 + in 12 + buildGoModule { 13 + inherit pname version; 10 14 11 15 src = fetchFromGitHub { 12 16 owner = "elves"; 13 - repo = pname; 17 + repo = "elvish"; 14 18 rev = "v${version}"; 15 - sha256 = "sha256-eCPJXCgmMvrJ2yVqYgXHXJWb6Ec0sutc91LNs4yRBYk="; 19 + hash = "sha256-eCPJXCgmMvrJ2yVqYgXHXJWb6Ec0sutc91LNs4yRBYk="; 16 20 }; 17 21 18 - vendorSha256 = "sha256-VMI20IP1jVkUK3rJm35szaFDfZGEEingUEL/xfVJ1cc="; 22 + vendorHash = "sha256-VMI20IP1jVkUK3rJm35szaFDfZGEEingUEL/xfVJ1cc="; 23 + 24 + subPackages = [ "cmd/elvish" ]; 25 + 26 + ldflags = [ 27 + "-s" 28 + "-w" 29 + "-X src.elv.sh/pkg/buildinfo.Version==${version}" 30 + ]; 19 31 20 32 strictDeps = true; 21 - doCheck = false; 22 33 34 + doCheck = false; 23 35 doInstallCheck = true; 24 36 installCheckPhase = '' 25 37 runHook preInstallCheck 26 38 27 - $out${passthru.shellPath} -c " 39 + $out${shellPath} -c " 28 40 fn expect {|key expected| 29 41 var actual = \$buildinfo[\$key] 30 42 if (not-eq \$actual \$expected) { ··· 38 50 runHook postInstallCheck 39 51 ''; 40 52 41 - meta = with lib; { 53 + passthru = { 54 + inherit shellPath; 55 + }; 56 + 57 + meta = { 58 + homepage = "https://elv.sh/"; 42 59 description = "A friendly and expressive command shell"; 43 60 longDescription = '' 44 61 Elvish is a friendly interactive shell and an expressive programming 45 62 language. It runs on Linux, BSDs, macOS and Windows. Despite its pre-1.0 46 63 status, it is already suitable for most daily interactive use. 47 64 ''; 48 - homepage = "https://elv.sh/"; 49 - license = licenses.bsd2; 50 - maintainers = with maintainers; [ vrthra AndersonTorres ]; 65 + license = lib.licenses.bsd2; 66 + maintainers = with lib.maintainers; [ vrthra AndersonTorres ]; 51 67 }; 52 - 53 - passthru.shellPath = "/bin/elvish"; 54 68 }