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-02-02 18:25:31 +00:00
|
|
|
version = "10.3.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-02-02 18:25:31 +00:00
|
|
|
hash = "sha256-BKrErM1d90o+yJ/R0vVgXDBwPgQSP3Qj26x4JmB7SXw=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
cargoHash = "sha256-jm97lfWHTtd3tE+Yql9CIss78B+bW9nUQAhs5anDb6c=";
|
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
|
|
|
|
2022-12-28 21:21:41 +00:00
|
|
|
NIX_CFLAGS_COMPILE = lib.optionals stdenv.isDarwin [
|
|
|
|
"-framework"
|
|
|
|
"AppKit"
|
|
|
|
];
|
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 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|