summary refs log tree commit diff
path: root/doc/packages/fish.section.md
diff options
context:
space:
mode:
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>2023-11-08 12:02:19 +0000
committerGitHub <noreply@github.com>2023-11-08 12:02:19 +0000
commitd49b3ff9e3ddbd7b06918e69bd759c9c3ce18db5 (patch)
tree9f514d7983e210462fdb571a9c15b97349668f84 /doc/packages/fish.section.md
parent89ac5d8ca30f4f55747925d7b155e5aeeae9f52e (diff)
parent263a89fa08bf3c69ddb402924d3e423e71461ef2 (diff)
downloadnixpkgs-d49b3ff9e3ddbd7b06918e69bd759c9c3ce18db5.tar
nixpkgs-d49b3ff9e3ddbd7b06918e69bd759c9c3ce18db5.tar.gz
nixpkgs-d49b3ff9e3ddbd7b06918e69bd759c9c3ce18db5.tar.bz2
nixpkgs-d49b3ff9e3ddbd7b06918e69bd759c9c3ce18db5.tar.lz
nixpkgs-d49b3ff9e3ddbd7b06918e69bd759c9c3ce18db5.tar.xz
nixpkgs-d49b3ff9e3ddbd7b06918e69bd759c9c3ce18db5.tar.zst
nixpkgs-d49b3ff9e3ddbd7b06918e69bd759c9c3ce18db5.zip
Merge staging-next into staging
Diffstat (limited to 'doc/packages/fish.section.md')
-rw-r--r--doc/packages/fish.section.md50
1 files changed, 50 insertions, 0 deletions
diff --git a/doc/packages/fish.section.md b/doc/packages/fish.section.md
new file mode 100644
index 00000000000..85b57acd109
--- /dev/null
+++ b/doc/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 initialized 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/" ];
+}
+```