nixpkgs/pkgs/by-name/ni/nix-janitor/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

44 lines
1.1 KiB
Nix
Raw Normal View History

2024-05-23 00:21:04 +02:00
{
lib,
rustPlatform,
fetchFromGitHub,
2024-05-26 15:19:52 +02:00
installShellFiles,
2024-05-23 00:21:04 +02:00
nix-update-script,
}:
rustPlatform.buildRustPackage rec {
pname = "nix-janitor";
2024-05-26 15:19:52 +02:00
version = "0.3.1";
2024-05-23 00:21:04 +02:00
src = fetchFromGitHub {
owner = "nobbz";
repo = "nix-janitor";
rev = "refs/tags/${version}";
2024-05-26 15:19:52 +02:00
hash = "sha256-xoVByI17rt2SCY3ULg12S8QsoXGhQWZlOpPpK2mfcPY=";
2024-05-23 00:21:04 +02:00
};
2024-05-26 15:19:52 +02:00
cargoHash = "sha256-QG2hHM4KBSU6+droew2WnOFxWRTpk9griIPMD8MLSbw=";
nativeBuildInputs = [ installShellFiles ];
postInstall = ''
for shell in bash fish zsh; do
completionFile=janitor.$shell
$out/bin/janitor --completions $shell > $completionFile
installShellCompletion $completionFile
done
'';
2024-05-23 00:21:04 +02:00
passthru.updateScript = nix-update-script { };
meta = {
homepage = "https://github.com/nobbz/nix-janitor";
changelog = "https://github.com/NobbZ/nix-janitor/blob/${version}/CHANGELOG.md";
description = "Tool to clean up old profile generations";
mainProgram = "janitor";
platforms = lib.platforms.linux;
license = lib.licenses.mit;
maintainers = [ lib.maintainers.nobbz ];
};
}