mirror of
https://github.com/ryanccn/flake.git
synced 2025-12-06 08:10:43 +01:00
feat(fish): proper PATH initialization
This commit is contained in:
parent
ea378cf3af
commit
1833524619
6 changed files with 76 additions and 181 deletions
22
modules/fish.nix
Normal file
22
modules/fish.nix
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{ lib, ... }:
|
||||
{
|
||||
# https://github.com/LnL7/nix-darwin/issues/122#issuecomment-2272570087
|
||||
programs.fish.loginShellInit =
|
||||
let
|
||||
dquote = str: "\"" + str + "\"";
|
||||
|
||||
profiles = [
|
||||
"/etc/profiles/per-user/$USER" # home-manager profile
|
||||
"$HOME/.nix-profile" # non-XDG home profile
|
||||
"$(set -q XDG_STATE_HOME; and echo \"$XDG_STATE_HOME\"; or echo \"$HOME/.local/state\")/nix/profile" # XDG home profile
|
||||
"/run/current-system/sw" # nix-darwin system profile
|
||||
"/nix/var/nix/profiles/default" # system profile
|
||||
];
|
||||
|
||||
makeBinSearchPath = lib.concatMapStringsSep " " (path: (dquote "${path}/bin"));
|
||||
in
|
||||
''
|
||||
fish_add_path --move --prepend --path ${makeBinSearchPath profiles}
|
||||
set fish_user_paths $fish_user_paths
|
||||
'';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue