23b612e36f
GitOrigin-RevId: ae5c332cbb5827f6b1f02572496b141021de335f
57 lines
1.3 KiB
Nix
57 lines
1.3 KiB
Nix
{ stdenv
|
|
, lib
|
|
, fetchFromGitHub
|
|
, rustPlatform
|
|
, AppKit
|
|
, Cocoa
|
|
, Foundation
|
|
, installShellFiles
|
|
}:
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
pname = "topgrade";
|
|
version = "14.0.0";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "topgrade-rs";
|
|
repo = "topgrade";
|
|
rev = "v${version}";
|
|
hash = "sha256-sZUJMbFQiGw1Qqdtv+yExSnmaKd02+qIEgE3SHKYP6s=";
|
|
};
|
|
|
|
cargoHash = "sha256-XRVxPjvQT0XfhMMa+M4yLtTIpUl6Mtq9eM9wG2pkug8=";
|
|
|
|
nativeBuildInputs = [
|
|
installShellFiles
|
|
];
|
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [
|
|
AppKit
|
|
Cocoa
|
|
Foundation
|
|
];
|
|
|
|
env.NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.isDarwin [
|
|
"-framework"
|
|
"AppKit"
|
|
]);
|
|
|
|
postInstall = ''
|
|
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
|
|
installManPage topgrade.8
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "Upgrade all the things";
|
|
homepage = "https://github.com/topgrade-rs/topgrade";
|
|
changelog = "https://github.com/topgrade-rs/topgrade/releases/tag/v${version}";
|
|
license = licenses.gpl3Only;
|
|
maintainers = with maintainers; [ SuperSandro2000 xyenon ];
|
|
mainProgram = "topgrade";
|
|
};
|
|
}
|