installShellFiles: init (#65211)

This is a new package that provides a shell hook to make it easy to
declare manpages and shell completions in a manner that doesn't require
remembering where to actually install them. Basic usage looks like

  { stdenv, installShellFiles, ... }:
  stdenv.mkDerivation {
    # ...
    nativeBuildInputs = [ installShellFiles ];
    postInstall = ''
      installManPage doc/foobar.1
      installShellCompletion --bash share/completions/foobar.bash
      installShellCompletion --fish share/completions/foobar.fish
      installShellCompletion --zsh share/completions/_foobar
    '';
    # ...
  }

See source comments for more details on the functions.
This commit is contained in:
Lily Ballard
2019-09-04 23:19:17 +02:00
committed by Robert Helgesson
parent 37e333af9a
commit 43dade238f
4 changed files with 214 additions and 0 deletions
@@ -0,0 +1,4 @@
{ makeSetupHook }:
# See the header comment in ../setup-hooks/install-shell-files.sh for example usage.
makeSetupHook { name = "install-shell-files"; } ../setup-hooks/install-shell-files.sh