2022-04-27 09:35:20 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, rustPlatform
|
2022-10-21 18:38:19 +00:00
|
|
|
, AppKit
|
2022-04-27 09:35:20 +00:00
|
|
|
, Cocoa
|
|
|
|
, Foundation
|
|
|
|
, installShellFiles
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "topgrade";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "13.0.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2022-10-21 18:38:19 +00:00
|
|
|
owner = "topgrade-rs";
|
|
|
|
repo = "topgrade";
|
2020-04-24 23:36:52 +00:00
|
|
|
rev = "v${version}";
|
2023-11-16 04:20:00 +00:00
|
|
|
hash = "sha256-BuYwLD8HlmFjCpR8043GhrYK3XWffeqEaeEDqWhxZVI=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
cargoHash = "sha256-+kSvA9AC0peXeFLVjenATRfnIS9qaOr/f1ozPbifiPI=";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-12-28 21:21:41 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
installShellFiles
|
|
|
|
];
|
2020-11-03 02:18:15 +00:00
|
|
|
|
2022-12-28 21:21:41 +00:00
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [
|
|
|
|
AppKit
|
|
|
|
Cocoa
|
|
|
|
Foundation
|
|
|
|
];
|
2022-10-21 18:38:19 +00:00
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
env.NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.isDarwin [
|
2022-12-28 21:21:41 +00:00
|
|
|
"-framework"
|
|
|
|
"AppKit"
|
2023-03-04 12:14:45 +00:00
|
|
|
]);
|
2022-10-21 18:38:19 +00:00
|
|
|
|
2020-11-03 02:18:15 +00:00
|
|
|
postInstall = ''
|
2022-12-02 08:20:57 +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-11-03 02:18:15 +00:00
|
|
|
installManPage topgrade.8
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Upgrade all the things";
|
2022-10-21 18:38:19 +00:00
|
|
|
homepage = "https://github.com/topgrade-rs/topgrade";
|
2022-12-28 21:21:41 +00:00
|
|
|
changelog = "https://github.com/topgrade-rs/topgrade/releases/tag/v${version}";
|
2021-02-13 14:23:35 +00:00
|
|
|
license = licenses.gpl3Only;
|
2022-07-14 12:49:19 +00:00
|
|
|
maintainers = with maintainers; [ SuperSandro2000 xyenon ];
|
2024-01-02 11:29:13 +00:00
|
|
|
mainProgram = "topgrade";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|