1{
2 lib,
3 rustPlatform,
4 fetchFromGitHub,
5 installShellFiles,
6}:
7
8rustPlatform.buildRustPackage rec {
9 pname = "git-ignore";
10 version = "1.4.0";
11
12 src = fetchFromGitHub {
13 owner = "sondr3";
14 repo = "git-ignore";
15 rev = "v${version}";
16 hash = "sha256-KIdhsbD9v2kCM2C/kSJCleyniEz4Bw7UxBsF762fnJs=";
17 };
18
19 cargoHash = "sha256-Zdy6bUgpaDBiAavSlAAH7LyYbNm7UU1qz0wAnVXQzpY=";
20
21 nativeBuildInputs = [
22 installShellFiles
23 ];
24
25 postInstall = ''
26 assets=$releaseDir/../assets
27 installManPage $assets/git-ignore.1
28 installShellCompletion $assets/git-ignore.{bash,fish} --zsh $assets/_git-ignore
29 '';
30
31 meta = with lib; {
32 description = "Quickly and easily fetch .gitignore templates from gitignore.io";
33 homepage = "https://github.com/sondr3/git-ignore";
34 changelog = "https://github.com/sondr3/git-ignore/blob/${src.rev}/CHANGELOG.md";
35 license = licenses.gpl3Plus;
36 maintainers = with maintainers; [ figsoda ];
37 mainProgram = "git-ignore";
38 };
39}