2022-04-28 10:13:42 +01:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, rustPlatform
|
2022-10-19 21:16:19 +01:00
|
|
|
, AppKit
|
2022-04-28 10:13:42 +01:00
|
|
|
, Cocoa
|
|
|
|
, Foundation
|
|
|
|
, installShellFiles
|
|
|
|
}:
|
2019-11-19 19:18:42 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "topgrade";
|
2022-12-06 20:58:14 +00:00
|
|
|
version = "10.2.2";
|
2019-11-19 19:18:42 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2022-10-19 21:16:19 +01:00
|
|
|
owner = "topgrade-rs";
|
|
|
|
repo = "topgrade";
|
2019-11-19 19:18:42 +00:00
|
|
|
rev = "v${version}";
|
2022-12-06 20:58:14 +00:00
|
|
|
sha256 = "sha256-TDuTrtVqEy0g13zdWHz2+cQhMEMSbvameBkJUcyTfGw=";
|
2019-11-19 19:18:42 +00:00
|
|
|
};
|
|
|
|
|
2022-12-06 20:58:14 +00:00
|
|
|
cargoSha256 = "sha256-4uq4lksfgTI+x7E/p27gs0Zh0NQq3kIBB9KVD2tvmtQ=";
|
2020-01-16 18:07:29 +00:00
|
|
|
|
2020-10-30 23:32:09 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
2022-10-19 21:16:19 +01:00
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [ AppKit Cocoa Foundation ];
|
|
|
|
|
|
|
|
NIX_CFLAGS_COMPILE = lib.optionals stdenv.isDarwin [ "-framework" "AppKit" ];
|
|
|
|
|
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 21:16:19 +01:00
|
|
|
homepage = "https://github.com/topgrade-rs/topgrade";
|
2021-02-12 01:16:01 +00:00
|
|
|
license = licenses.gpl3Only;
|
2022-07-02 09:42:35 +01:00
|
|
|
maintainers = with maintainers; [ SuperSandro2000 xyenon ];
|
2019-11-19 19:18:42 +00:00
|
|
|
};
|
|
|
|
}
|