nixpkgs/pkgs/applications/version-management/git-ignore/default.nix

44 lines
1.0 KiB
Nix

{ lib
, rustPlatform
, fetchFromGitHub
, installShellFiles
, stdenv
, darwin
}:
rustPlatform.buildRustPackage rec {
pname = "git-ignore";
version = "1.2.2";
src = fetchFromGitHub {
owner = "sondr3";
repo = pname;
rev = "v${version}";
hash = "sha256-kIRuoY0dM2t+aY4iYdik9gUpG+81sDiJLD11Bmx68FI=";
};
cargoHash = "sha256-6sb+OW5VtA6vY6fDtsaZePZD53ehH7QawxJJlUNsrnM=";
nativeBuildInputs = [
installShellFiles
];
buildInputs = lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.Security
];
postInstall = ''
assets=$releaseDir/../assets
installManPage $assets/git-ignore.1
installShellCompletion $assets/git-ignore.{bash,fish} --zsh $assets/_git-ignore
'';
meta = with lib; {
description = "Quickly and easily fetch .gitignore templates from gitignore.io";
homepage = "https://github.com/sondr3/git-ignore";
changelog = "https://github.com/sondr3/git-ignore/blob/${src.rev}/CHANGELOG.md";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ figsoda ];
};
}