nixpkgs/pkgs/by-name/gi/gitoxide/package.nix
R. Ryantm 7ce8244000 gitoxide: 0.54.0 -> 0.55.0
(cherry picked from commit 2f4bef8a7c)
2026-06-22 21:34:15 +00:00

68 lines
1.9 KiB
Nix

{
lib,
rustPlatform,
fetchFromGitHub,
cmake,
pkg-config,
stdenv,
curl,
openssl,
buildPackages,
installShellFiles,
}:
let
canRunCmd = stdenv.hostPlatform.emulatorAvailable buildPackages;
gix = "${stdenv.hostPlatform.emulator buildPackages} $out/bin/gix";
ein = "${stdenv.hostPlatform.emulator buildPackages} $out/bin/ein";
in
rustPlatform.buildRustPackage (finalAttrs: {
pname = "gitoxide";
version = "0.55.0";
src = fetchFromGitHub {
owner = "GitoxideLabs";
repo = "gitoxide";
tag = "v${finalAttrs.version}";
hash = "sha256-UtdXlIvX82UUhc4RWZZTBV5kz4YqfOTd4D/pGhDUfSI=";
};
cargoHash = "sha256-Kv0NKA3OdHBn2M8DmcGyjcN2acGJYOdbczOb/nRsvDs=";
nativeBuildInputs = [
cmake
pkg-config
installShellFiles
];
buildInputs = [ curl ] ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ openssl ];
preFixup = lib.optionalString canRunCmd ''
installShellCompletion --cmd gix \
--bash <(${gix} completions --shell bash) \
--fish <(${gix} completions --shell fish) \
--zsh <(${gix} completions --shell zsh)
installShellCompletion --cmd ein \
--bash <(${ein} completions --shell bash) \
--fish <(${ein} completions --shell fish) \
--zsh <(${ein} completions --shell zsh)
'';
# Needed to get openssl-sys to use pkg-config.
env.OPENSSL_NO_VENDOR = 1;
meta = {
description = "Command-line application for interacting with git repositories";
homepage = "https://github.com/GitoxideLabs/gitoxide";
changelog = "https://github.com/GitoxideLabs/gitoxide/blob/${finalAttrs.src.tag}/CHANGELOG.md";
license = with lib.licenses; [
mit # or
asl20
];
maintainers = with lib.maintainers; [ hythera ];
# NB: `ein` is also provided by this package, but `nix run
# nixpkgs#gitoxide` doesn't work at all without this set.
mainProgram = "gix";
};
})