15 canRunGitGr = stdenv.hostPlatform.emulatorAvailable buildPackages;
16 gitGr = "${stdenv.hostPlatform.emulator buildPackages} $out/bin/git-gr";
20 rustPlatform.buildRustPackage {
21 inherit pname version;
23 src = fetchFromGitHub {
26 rev = "refs/tags/v${version}";
27 hash = "sha256-t308Ep27iRvRHSdvVMOrRGVoajBtnTutHAkKbZkO7Wg=";
30 buildFeatures = [ "clap_mangen" ];
32 cargoHash = "sha256-oukVU3YZMI2Z6HqIrEe2npmCj9PtwQUT6VOPkklM0Ig=";
34 OPENSSL_NO_VENDOR = true;
38 ++ lib.optional stdenv.hostPlatform.isLinux pkg-config;
41 lib.optional stdenv.hostPlatform.isLinux openssl
42 ++ lib.optionals stdenv.hostPlatform.isDarwin [
44 darwin.apple_sdk.frameworks.CoreServices
45 darwin.apple_sdk.frameworks.SystemConfiguration
48 postInstall = lib.optionalString canRunGitGr ''
50 ${gitGr} manpages "$manpages"
51 for manpage in "$manpages"/*; do
52 installManPage "$manpage"
55 installShellCompletion --cmd git-gr \
56 --bash <(${gitGr} completions bash) \
57 --fish <(${gitGr} completions fish) \
58 --zsh <(${gitGr} completions zsh)
62 homepage = "https://github.com/9999years/git-gr";
63 changelog = "https://github.com/9999years/git-gr/releases/tag/v${version}";
64 description = "Gerrit CLI client";
65 license = [ licenses.mit ];
66 maintainers = [ maintainers._9999years ];
67 mainProgram = "git-gr";
70 passthru.updateScript = nix-update-script { };