nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib, writeShellScriptBin, fish }:
2
3with lib;
4
5makeOverridable ({
6 completionDirs ? [],
7 functionDirs ? [],
8 confDirs ? [],
9 pluginPkgs ? []
10}:
11
12let
13 vendorDir = kind: plugin: "${plugin}/share/fish/vendor_${kind}.d";
14 complPath = completionDirs ++ map (vendorDir "completions") pluginPkgs;
15 funcPath = functionDirs ++ map (vendorDir "functions") pluginPkgs;
16 confPath = confDirs ++ map (vendorDir "conf") pluginPkgs;
17
18in writeShellScriptBin "fish" ''
19 ${fish}/bin/fish --init-command "
20 set --prepend fish_complete_path ${escapeShellArgs complPath}
21 set --prepend fish_function_path ${escapeShellArgs funcPath}
22 set --local fish_conf_source_path ${escapeShellArgs confPath}
23 for c in \$fish_conf_source_path/*; source \$c; end
24 " "$@"
25'')