Files
nixpkgs/pkgs/by-name/to/topgrade/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

55 lines
1.3 KiB
Nix

{
stdenv,
lib,
fetchFromGitHub,
rustPlatform,
installShellFiles,
}:
rustPlatform.buildRustPackage rec {
pname = "topgrade";
version = "16.0.4";
src = fetchFromGitHub {
owner = "topgrade-rs";
repo = "topgrade";
rev = "v${version}";
hash = "sha256-b/xzmC49ETGtcf9ekrSkq75cKxSL4ZrvKPkparwz6zU=";
};
cargoHash = "sha256-d6jX+3ZcCswhKy5SsSpvXZL9el70+OyIa7lYQ3B/o8M=";
nativeBuildInputs = [
installShellFiles
];
env.NIX_CFLAGS_COMPILE = toString (
lib.optionals stdenv.hostPlatform.isDarwin [
"-framework"
"AppKit"
]
);
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd topgrade \
--bash <($out/bin/topgrade --gen-completion bash) \
--fish <($out/bin/topgrade --gen-completion fish) \
--zsh <($out/bin/topgrade --gen-completion zsh)
$out/bin/topgrade --gen-manpage > topgrade.8
installManPage topgrade.8
'';
meta = {
description = "Upgrade all the things";
homepage = "https://github.com/topgrade-rs/topgrade";
changelog = "https://github.com/topgrade-rs/topgrade/releases/tag/v${version}";
license = lib.licenses.gpl3Only;
maintainers = with lib.maintainers; [
SuperSandro2000
xyenon
];
mainProgram = "topgrade";
};
}