nsc: add shell completion

This commit is contained in:
Connor Brewster 2023-02-23 12:16:40 -06:00
parent 7ce8e7c4cf
commit 4816e023d1

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)