From 4816e023d1a9894707c9b192e1874135c8842582 Mon Sep 17 00:00:00 2001 From: Connor Brewster Date: Thu, 23 Feb 2023 12:16:40 -0600 Subject: nsc: add shell completion --- pkgs/tools/system/nsc/default.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkgs/tools/system/nsc/default.nix b/pkgs/tools/system/nsc/default.nix index 69f16d65c576f..ef56a9ea1d6b4 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) -- cgit 1.4.1