nixpkgs/pkgs/applications/version-management/gitoxide/default.nix
Silvan Mosberger 4f0dadbf38 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00

67 lines
1.7 KiB
Nix

{
lib,
rustPlatform,
fetchFromGitHub,
cmake,
pkg-config,
stdenv,
apple-sdk_11,
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 rec {
pname = "gitoxide";
version = "0.39.0";
src = fetchFromGitHub {
owner = "Byron";
repo = "gitoxide";
rev = "v${version}";
hash = "sha256-xv4xGkrArJ/LTVLs2SYhvxhfNG6sjVm5nZWsi4s34iM=";
};
cargoHash = "sha256-36ue3f67Btw0/AM5lTaByrJLKU5r1FJA3sFRJ1IbXXc=";
nativeBuildInputs = [
cmake
pkg-config
installShellFiles
];
buildInputs = [ curl ] ++ (if stdenv.hostPlatform.isDarwin then [ apple-sdk_11 ] else [ 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 = with lib; {
description = "Command-line application for interacting with git repositories";
homepage = "https://github.com/Byron/gitoxide";
changelog = "https://github.com/Byron/gitoxide/blob/v${version}/CHANGELOG.md";
license = with licenses; [
mit # or
asl20
];
maintainers = with maintainers; [ syberant ];
};
}