darwin/core: simplify fish shell $PATH workaround
This commit is contained in:
parent
4dd289ff39
commit
96ef57ff63
1 changed files with 4 additions and 5 deletions
|
@ -39,14 +39,13 @@
|
||||||
programs.zsh.enable = true; # default shell on catalina
|
programs.zsh.enable = true; # default shell on catalina
|
||||||
programs.fish.enable = true;
|
programs.fish.enable = true;
|
||||||
|
|
||||||
# fucking horrible
|
# WORKAROUND: Fix $PATH orders when using Fish shell
|
||||||
# https://github.com/LnL7/nix-darwin/issues/122#issuecomment-1659465635
|
# https://github.com/LnL7/nix-darwin/issues/122#issuecomment-1659465635
|
||||||
programs.fish.loginShellInit = let
|
programs.fish.loginShellInit = let
|
||||||
dquote = str: "\"" + str + "\"";
|
# ["$HOME/.local" "/usr/local"] -> "'$HOME/.local/bin' '/usr/local/bin'"
|
||||||
|
makePath = path: lib.concatMapStringsSep " " (path: lib.escapeShellArg "${path}/bin") path;
|
||||||
makeBinPathList = map (path: path + "/bin");
|
|
||||||
in ''
|
in ''
|
||||||
fish_add_path --move --prepend --path ${lib.concatMapStringsSep " " dquote (makeBinPathList config.environment.profiles)}
|
fish_add_path --move --prepend --path ${makePath config.environment.profiles}
|
||||||
set fish_user_paths $fish_user_paths
|
set fish_user_paths $fish_user_paths
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue