diff --git a/pkgs/by-name/si/siketyan-ghr/package.nix b/pkgs/by-name/si/siketyan-ghr/package.nix new file mode 100644 index 0000000000000..2b0a24c0bbdf4 --- /dev/null +++ b/pkgs/by-name/si/siketyan-ghr/package.nix @@ -0,0 +1,62 @@ +{ + lib, + rustPlatform, + buildPackages, + fetchFromGitHub, + installShellFiles, + pkg-config, + libgit2, + openssl, + stdenv, + zlib, + zstd, +}: + +rustPlatform.buildRustPackage rec { + pname = "ghr"; + version = "0.4.4"; + + src = fetchFromGitHub { + owner = "siketyan"; + repo = "ghr"; + rev = "v${version}"; + hash = "sha256-L9+rcdt+MGZSCOJyCE4t/TT6Fjtxvfr9LBJYyRrx208="; + }; + + cargoHash = "sha256-HBVMDR+3UB+zWmvZXBph36bajTOAnvVGTGYooJtk9Zg="; + + nativeBuildInputs = [ + installShellFiles + pkg-config + ]; + + buildInputs = [ + libgit2 + openssl + zlib + zstd + ]; + + postInstall = + let + ghr = "${stdenv.hostPlatform.emulator buildPackages} $out/bin/ghr"; + in + lib.optionalString (stdenv.hostPlatform.emulatorAvailable buildPackages) '' + installShellCompletion --cmd ghr \ + --bash <(${ghr} shell --completion bash) \ + --fish <(${ghr} shell --completion fish) + ''; + + env = { + OPENSSL_NO_VENDOR = true; + ZSTD_SYS_USE_PKG_CONFIG = true; + }; + + meta = with lib; { + description = "Yet another repository management with auto-attaching profiles"; + homepage = "https://github.com/siketyan/ghr"; + license = licenses.mit; + maintainers = with maintainers; [ sei40kr ]; + mainProgram = "ghr"; + }; +}