2021-01-05 17:20:39 +01:00
|
|
|
{ lib, writeShellScriptBin, fish }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
makeOverridable ({
|
|
|
|
completionDirs ? [],
|
|
|
|
functionDirs ? [],
|
|
|
|
confDirs ? [],
|
|
|
|
pluginPkgs ? []
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
vendorDir = kind: plugin: "${plugin}/share/fish/vendor_${kind}.d";
|
|
|
|
complPath = completionDirs ++ map (vendorDir "completions") pluginPkgs;
|
|
|
|
funcPath = functionDirs ++ map (vendorDir "functions") pluginPkgs;
|
|
|
|
confPath = confDirs ++ map (vendorDir "conf") pluginPkgs;
|
|
|
|
|
|
|
|
in writeShellScriptBin "fish" ''
|
|
|
|
${fish}/bin/fish --init-command "
|
|
|
|
set --prepend fish_complete_path ${escapeShellArgs complPath}
|
|
|
|
set --prepend fish_function_path ${escapeShellArgs funcPath}
|
2021-02-15 22:35:20 +01:00
|
|
|
set --local fish_conf_source_path ${escapeShellArgs confPath}
|
|
|
|
for c in $fish_conf_source_path/*; source $c; end
|
2021-01-05 17:20:39 +01:00
|
|
|
" "$@"
|
|
|
|
'')
|