feat(home/mgc): source POSIX profile.d env in fish via babelfish

System Manager and the upstream Nix installer only ship POSIX
/etc/profile.d fragments to set PATH/XDG_DATA_DIRS (SM fish support is an
unfinished upstream TODO), so a bare fish shell misses /run/wrappers/bin,
/run/system-manager/sw/bin, the nix default profile, and
/run/system-manager/sw/share. Translate the two relevant fragments with
babelfish and source them; guard on the SM bin dir so it is a no-op when
the env was already inherited (e.g. the bash-wrapped graphical session).

Assisted-by: pi (claude-opus-4-8)
This commit is contained in:
Gabriel Fontes
2026-08-06 17:21:40 -03:00
parent f6c0af14f4
commit 76bbb1905b
+20
View File
@@ -25,4 +25,24 @@
];
wallpaper = pkgs.wallpapers.deer-lunar-fantasy;
# System Manager and the upstream Nix installer only ship POSIX
# /etc/profile.d fragments to set up PATH / XDG_DATA_DIRS; fish never sources
# /etc/profile, and SM's own fish support is an unfinished upstream TODO. So a
# bare fish shell misses /run/wrappers/bin, /run/system-manager/sw/bin, the
# nix default profile, and /run/system-manager/sw/share. Translate the two
# relevant fragments with babelfish and source them. The guard makes it a
# cheap no-op once the env is present (e.g. a terminal inside the
# bash-login-wrapped graphical session).
programs.fish.interactiveShellInit =
/*
fish
*/
''
if not contains /run/system-manager/sw/bin $PATH
for profile_script in /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh /etc/profile.d/system-manager-path.sh
test -r $profile_script; and ${pkgs.babelfish}/bin/babelfish <$profile_script | source
end
end
'';
}