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
|
|
|
|
}:
|
2019-11-19 19:18:42 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "topgrade";
|
2024-01-26 14:40:13 +00:00
|
|
|
version = "14.0.1";
|
2019-11-19 19:18:42 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2022-10-19 20:16:19 +00:00
|
|
|
owner = "topgrade-rs";
|
|
|
|
repo = "topgrade";
|
2019-11-19 19:18:42 +00:00
|
|
|
rev = "v${version}";
|
2024-01-26 14:40:13 +00:00
|
|
|
hash = "sha256-opTMV+OH8PR9SxBWj1o8xSngK0QdindDcXyd6TRjdvI=";
|
2019-11-19 19:18:42 +00:00
|
|
|
};
|
|
|
|
|
2024-01-26 14:40:13 +00:00
|
|
|
cargoHash = "sha256-pgYrUZAxoyllQp1HuVhbLR3za+Gx0l8Z2/Zq/KCOKZg=";
|
2020-01-16 18:07:29 +00:00
|
|
|
|
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
|
|
|
|
2023-02-20 15:36:06 +00:00
|
|
|
env.NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.isDarwin [
|
2022-12-28 08:13:54 +00:00
|
|
|
"-framework"
|
|
|
|
"AppKit"
|
2023-02-20 15:36:06 +00:00
|
|
|
]);
|
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
|
|
|
|
2020-01-16 18:07:29 +00:00
|
|
|
meta = with lib; {
|
2019-11-19 19:18:42 +00:00
|
|
|
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}";
|
2021-02-12 01:16:01 +00:00
|
|
|
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";
|
2019-11-19 19:18:42 +00:00
|
|
|
};
|
|
|
|
}
|