mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-08 14:03:29 +00:00
45 lines
1.1 KiB
Nix
45 lines
1.1 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
buildGoModule,
|
|
fetchFromGitHub,
|
|
installShellFiles,
|
|
buildPackages,
|
|
}:
|
|
|
|
buildGoModule rec {
|
|
pname = "spacectl";
|
|
version = "1.7.1";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "spacelift-io";
|
|
repo = "spacectl";
|
|
rev = "v${version}";
|
|
hash = "sha256-puo44Si56MnpMst6yU8ZTMJTZ1yWVb1CiNXh1k/umbM=";
|
|
};
|
|
|
|
vendorHash = "sha256-SYfXG6YM0Q2rCnoTM2tYvE17uBCD8yQiW/5DTCxMPWo=";
|
|
|
|
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";
|
|
};
|
|
}
|