nixpkgs/pkgs/by-name/sp/spacectl/package.nix
Zane Dufour 7a1656b230
spacectl: add shell completions
recommendations

Co-authored-by: seth <getchoo@tuta.io>

Update pkgs/by-name/sp/spacectl/package.nix

Co-authored-by: seth <getchoo@tuta.io>

Update pkgs/by-name/sp/spacectl/package.nix

Co-authored-by: Bruno BELANYI <bruno@belanyi.fr>

nixfmt
2024-11-19 12:31:06 -05:00

45 lines
1.1 KiB
Nix

{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
buildPackages,
}:
buildGoModule rec {
pname = "spacectl";
version = "1.6.0";
src = fetchFromGitHub {
owner = "spacelift-io";
repo = "spacectl";
rev = "v${version}";
hash = "sha256-pO+jYuCyP6YrU9vE3//O0EyTDXYQ1WSpFI/8WbneDCA=";
};
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";
};
}