2023-04-29 16:46:19 +00:00
|
|
|
{ lib
|
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
|
|
|
, installShellFiles
|
|
|
|
, stdenv
|
|
|
|
, darwin
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-04-29 16:46:19 +00:00
|
|
|
rustPlatform.buildRustPackage rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "git-ignore";
|
2023-04-29 16:46:19 +00:00
|
|
|
version = "1.2.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "sondr3";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2023-04-29 16:46:19 +00:00
|
|
|
hash = "sha256-kIRuoY0dM2t+aY4iYdik9gUpG+81sDiJLD11Bmx68FI=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-04-29 16:46:19 +00:00
|
|
|
cargoHash = "sha256-6sb+OW5VtA6vY6fDtsaZePZD53ehH7QawxJJlUNsrnM=";
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
installShellFiles
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-04-29 16:46:19 +00:00
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [
|
2020-04-24 23:36:52 +00:00
|
|
|
darwin.apple_sdk.frameworks.Security
|
|
|
|
];
|
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
postInstall = ''
|
2023-04-29 16:46:19 +00:00
|
|
|
assets=$releaseDir/../assets
|
|
|
|
installManPage $assets/git-ignore.1
|
|
|
|
installShellCompletion $assets/git-ignore.{bash,fish} --zsh $assets/_git-ignore
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Quickly and easily fetch .gitignore templates from gitignore.io";
|
|
|
|
homepage = "https://github.com/sondr3/git-ignore";
|
2023-04-29 16:46:19 +00:00
|
|
|
changelog = "https://github.com/sondr3/git-ignore/blob/${src.rev}/CHANGELOG.md";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.gpl3Plus;
|
2023-04-29 16:46:19 +00:00
|
|
|
maintainers = with maintainers; [ figsoda ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|