static-nix-shell.mkZsh: implement shellPreamble to reduce wrapping

This commit is contained in:
2025-07-20 23:44:03 +00:00
parent 6f590899bb
commit 9f8df5db63

View File

@@ -271,9 +271,16 @@ in rec {
pkgsEnv = [ zsh ] ++ (builtins.attrValues pkgsAsAttrs);
pkgExprs = insertTopo "zsh" (builtins.attrNames pkgsAsAttrs);
in mkShell ({
# TODO: generate `shellPreamble` here to reduce wrapping
inherit pkgsEnv pkgExprs;
interpreter = lib.getExe zsh;
postConfigure = ''
shellPreamble='
export PATH=''${PATH:+$PATH:}'"$append_PATH"'
export XDG_DATA_DIRS=''${XDG_DATA_DIRS:+$XDG_DATA_DIRS:}'"$append_XDG_DATA_DIRS"'
'
unset append_PATH
unset append_XDG_DATA_DIRS
'';
} // (removeAttrs attrs [ "pkgs" "zsh" ])
);