diff --git a/pkgs/tools/system/nsc/default.nix b/pkgs/tools/system/nsc/default.nix index 69f16d65c576..ef56a9ea1d6b 100644 --- a/pkgs/tools/system/nsc/default.nix +++ b/pkgs/tools/system/nsc/default.nix @@ -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)