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

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

58 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";
version = "14.0.1";
src = fetchFromGitHub {
2022-10-19 20:16:19 +00:00
owner = "topgrade-rs";
repo = "topgrade";
rev = "v${version}";
hash = "sha256-opTMV+OH8PR9SxBWj1o8xSngK0QdindDcXyd6TRjdvI=";
};
cargoHash = "sha256-pgYrUZAxoyllQp1HuVhbLR3za+Gx0l8Z2/Zq/KCOKZg=";
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 ];
2023-11-27 01:17:53 +00:00
mainProgram = "topgrade";
};
}