nixpkgs/pkgs/tools/misc/topgrade/default.nix

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

57 lines
1.3 KiB
Nix
Raw Normal View History

2022-04-28 09:13:42 +00:00
{ stdenv
, lib
, fetchFromGitHub
, rustPlatform
2022-10-19 20:16:19 +00:00
, AppKit
2022-04-28 09:13:42 +00:00
, Cocoa
, Foundation
, installShellFiles
}:
rustPlatform.buildRustPackage rec {
pname = "topgrade";
2023-03-23 01:56:37 +00:00
version = "10.3.3";
src = fetchFromGitHub {
2022-10-19 20:16:19 +00:00
owner = "topgrade-rs";
repo = "topgrade";
rev = "v${version}";
2023-03-23 01:56:37 +00:00
hash = "sha256-LhTUzY2WrauWHYZU5jA6fn3DDheUgfxCPvjVTwUvF4w=";
};
2023-03-23 01:56:37 +00:00
cargoHash = "sha256-ONLZrZjhNcli7ul6fDgVEKm2MS3YYIfPnHS+dmpJHu0=";
2022-12-28 08:13:54 +00:00
nativeBuildInputs = [
installShellFiles
];
2020-10-30 23:32:09 +00:00
2022-12-28 08:13:54 +00:00
buildInputs = lib.optionals stdenv.isDarwin [
AppKit
Cocoa
Foundation
];
2022-10-19 20:16:19 +00:00
env.NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.isDarwin [
2022-12-28 08:13:54 +00:00
"-framework"
"AppKit"
]);
2022-10-19 20:16:19 +00:00
2020-10-30 23:32:09 +00:00
postInstall = ''
2022-12-01 01:16:30 +00:00
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
2020-10-30 23:32:09 +00:00
installManPage topgrade.8
'';
2020-02-25 19:36:09 +00:00
meta = with lib; {
description = "Upgrade all the things";
2022-10-19 20:16:19 +00:00
homepage = "https://github.com/topgrade-rs/topgrade";
2022-12-28 08:13:54 +00:00
changelog = "https://github.com/topgrade-rs/topgrade/releases/tag/v${version}";
license = licenses.gpl3Only;
2022-07-02 08:42:35 +00:00
maintainers = with maintainers; [ SuperSandro2000 xyenon ];
};
}