diff options
author | Michele Guerini Rocco <rnhmjoj@users.noreply.github.com> | 2021-01-11 09:10:52 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-11 09:10:52 +0100 |
commit | a306b088f6f1f2f66bdb01de654e6e2f51b3b937 (patch) | |
tree | 50cf49b18aead97cda5b52342f924a3f94ab026c /doc | |
parent | 1109e2423d4b4ce34a860a13beb87ac88e76a40f (diff) | |
parent | 108fd69a8c40d4488c96fd275430b6638fed19df (diff) |
Merge pull request #108491 from pacien/fishPlugins-wrapFish
wrapFish: add fish shell wrapper package
Diffstat (limited to 'doc')
-rw-r--r-- | doc/builders/packages/fish.section.md | 50 | ||||
-rw-r--r-- | doc/builders/packages/index.xml | 1 |
2 files changed, 51 insertions, 0 deletions
diff --git a/doc/builders/packages/fish.section.md b/doc/builders/packages/fish.section.md new file mode 100644 index 000000000000..3086bd68348f --- /dev/null +++ b/doc/builders/packages/fish.section.md @@ -0,0 +1,50 @@ +# Fish {#sec-fish} + +Fish is a "smart and user-friendly command line shell" with support for plugins. + + +## Vendor Fish scripts {#sec-fish-vendor} + +Any package may ship its own Fish completions, configuration snippets, and +functions. Those should be installed to +`$out/share/fish/vendor_{completions,conf,functions}.d` respectively. + +When the `programs.fish.enable` and +`programs.fish.vendor.{completions,config,functions}.enable` options from the +NixOS Fish module are set to true, those paths are symlinked in the current +system environment and automatically loaded by Fish. + + +## Packaging Fish plugins {#sec-fish-plugins-pkg} + +While packages providing standalone executables belong to the top level, +packages which have the sole purpose of extending Fish belong to the +`fishPlugins` scope and should be registered in +`pkgs/shells/fish/plugins/default.nix`. + +The `buildFishPlugin` utility function can be used to automatically copy Fish +scripts from `$src/{completions,conf,conf.d,functions}` to the standard vendor +installation paths. It also sets up the test environment so that the optional +`checkPhase` is executed in a Fish shell with other already packaged plugins +and package-local Fish functions specified in `checkPlugins` and +`checkFunctionDirs` respectively. + +See `pkgs/shells/fish/plugins/pure.nix` for an example of Fish plugin package +using `buildFishPlugin` and running unit tests with the `fishtape` test runner. + + +## Fish wrapper {#sec-fish-wrapper} + +The `wrapFish` package is a wrapper around Fish which can be used to create +Fish shells initialised with some plugins as well as completions, configuration +snippets and functions sourced from the given paths. This provides a convenient +way to test Fish plugins and scripts without having to alter the environment. + +```nix +wrapFish { + pluginPkgs = with fishPlugins; [ pure foreign-env ]; + completionDirs = []; + functionDirs = []; + confDirs = [ "/path/to/some/fish/init/dir/" ]; +} +``` diff --git a/doc/builders/packages/index.xml b/doc/builders/packages/index.xml index 732560ec1992..ab335e24ff99 100644 --- a/doc/builders/packages/index.xml +++ b/doc/builders/packages/index.xml @@ -11,6 +11,7 @@ <xi:include href="elm.xml" /> <xi:include href="emacs.section.xml" /> <xi:include href="firefox.section.xml" /> + <xi:include href="fish.section.xml" /> <xi:include href="ibus.xml" /> <xi:include href="kakoune.section.xml" /> <xi:include href="linux.section.xml" /> |