Merge pull request #217885 from cbrewster/nsc-completion

nsc: add shell completion
This commit is contained in:
Mario Rodas 2023-02-24 18:52:15 -05:00 committed by GitHub
commit 665cbdb5e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,6 +2,7 @@
, stdenv
, buildGoModule
, fetchFromGitHub
, installShellFiles
}:
buildGoModule rec {
@ -24,6 +25,15 @@ buildGoModule rec {
vendorHash = "sha256-gDwppx0ORG+pXzTdGtUVbiFyTD/P7avt+/V89Gl0QYY=";
nativeBuildInputs = [ installShellFiles ];
postInstall = ''
installShellCompletion --cmd nsc \
--bash <($out/bin/nsc completion bash) \
--fish <($out/bin/nsc completion fish) \
--zsh <($out/bin/nsc completion zsh)
'';
preCheck = ''
# Tests attempt to write to the home directory.
export HOME=$(mktemp -d)