static-nix-shell.mkYsh: manually inject PATH and XDG_DATA_DIRS to remove an extra layer of wrapping

This commit is contained in:
2025-07-20 20:55:08 +00:00
parent 5eb620d521
commit 3b8b227c09

View File

@@ -210,6 +210,27 @@ in rec {
in mkShell ({
inherit pkgsEnv pkgExprs;
interpreter = lib.getExe' oils-for-unix "ysh";
postConfigure = ''
shellPreamble='
{
proc addToSearchPath(envName, appendValue) {
var value = get(ENV, envName)
if (value === null) {
setglobal ENV[envName] = "$appendValue"
} else {
setglobal ENV[envName] = "$value:$appendValue"
}
}
addToSearchPath "PATH" "'"$append_PATH"'"
addToSearchPath "XDG_DATA_DIRS" "'"$append_XDG_DATA_DIRS"'"
unset addToSearchPath
}
'
unset append_PATH
unset append_XDG_DATA_DIRS
'';
} // (removeAttrs attrs [ "oils-for-unix" "pkgs" ])
);