1 { lib, writeShellApplication, fish, writeTextFile }:
14 aliasesStr = builtins.concatStringsSep "\n"
15 (lib.mapAttrsToList (k: v: "alias ${k} ${lib.escapeShellArg v}") shellAliases);
17 shellAliasesFishConfig = writeTextFile {
18 name = "wrapfish.aliases.fish";
19 destination = "/share/fish/vendor_conf.d/aliases.fish";
21 status is-interactive; and begin
28 localFishConfig = writeTextFile {
29 name = "wrapfish.local.fish";
30 destination = "/share/fish/vendor_conf.d/config.local.fish";
34 vendorDir = kind: plugin: "${plugin}/share/fish/vendor_${kind}.d";
35 complPath = completionDirs ++ map (vendorDir "completions") pluginPkgs;
36 funcPath = functionDirs ++ map (vendorDir "functions") pluginPkgs;
38 ++ (map (vendorDir "conf") pluginPkgs)
39 ++ (map (vendorDir "conf") [ localFishConfig shellAliasesFishConfig ]);
41 in writeShellApplication {
42 inherit runtimeInputs;
45 ${fish}/bin/fish --init-command "
46 set --prepend fish_complete_path ${lib.escapeShellArgs complPath}
47 set --prepend fish_function_path ${lib.escapeShellArgs funcPath}
48 set --local fish_conf_source_path ${lib.escapeShellArgs confPath}
49 for c in \$fish_conf_source_path/*; source \$c; end