45 lines
1.1 KiB
Nix
45 lines
1.1 KiB
Nix
|
|
{
|
||
|
|
lib,
|
||
|
|
stdenv,
|
||
|
|
buildGoModule,
|
||
|
|
fetchFromGitHub,
|
||
|
|
installShellFiles,
|
||
|
|
buildPackages,
|
||
|
|
}:
|
||
|
|
|
||
|
|
buildGoModule rec {
|
||
|
|
pname = "spacectl";
|
||
|
|
version = "1.16.0";
|
||
|
|
|
||
|
|
src = fetchFromGitHub {
|
||
|
|
owner = "spacelift-io";
|
||
|
|
repo = "spacectl";
|
||
|
|
rev = "v${version}";
|
||
|
|
hash = "sha256-ZtM3A09cQ7BqIYcEJTggunxRidXiu/xlsp9F8qIwSv0=";
|
||
|
|
};
|
||
|
|
|
||
|
|
vendorHash = "sha256-g5Y6NuG8z2Pnh3Ng690FcwOrEU2EOhftZbM8oUFj4B4=";
|
||
|
|
|
||
|
|
nativeBuildInputs = [ installShellFiles ];
|
||
|
|
|
||
|
|
postInstall =
|
||
|
|
let
|
||
|
|
emulator = stdenv.hostPlatform.emulator buildPackages;
|
||
|
|
in
|
||
|
|
''
|
||
|
|
installShellCompletion --cmd spacectl \
|
||
|
|
--bash <(${emulator} $out/bin/spacectl completion bash) \
|
||
|
|
--fish <(${emulator} $out/bin/spacectl completion fish) \
|
||
|
|
--zsh <(${emulator} $out/bin/spacectl completion zsh) \
|
||
|
|
'';
|
||
|
|
|
||
|
|
meta = {
|
||
|
|
homepage = "https://github.com/spacelift-io/spacectl";
|
||
|
|
description = "Spacelift client and CLI";
|
||
|
|
changelog = "https://github.com/spacelift-io/spacectl/releases/tag/v${version}";
|
||
|
|
license = lib.licenses.mit;
|
||
|
|
maintainers = with lib.maintainers; [ kashw2 ];
|
||
|
|
mainProgram = "spacectl";
|
||
|
|
};
|
||
|
|
}
|