Steps to reproduce
mise use -g nix:most
mise activate fish | source
Observed behavior
XDG_DATA_DIRS only includes the nix-most /share dir:
> echo $XDG_DATA_DIRS
~/.local/share/mise/installs/nix-most/5.2.0/share
Expected behavior
XDG_DATA_DIRS to include both the prior dirs, and the nix-most /share dir, something along these lines:
> echo $XDG_DATA_DIRS
~/.local/share/flatpak/exports/share ~/exports/share /usr/local/share /usr/share ~/.nix-profile/share /nix/var/nix/profiles/default/share ~/.local/share/mise/installs/nix-most/5.2.0/share
Why
This is critical for most applications to continue working.
What's broken
mise hook-env -s fish contains the following lines:
set -gx PATH ...
set -gx XDG_DATA_DIRS ~/.local/share/mise/installs/nix-most/5.2.0/share
set -gx HOST_PATH '/nix/store...
And the culprit appears to be this code:
|
table.insert(env_vars, { key = "XDG_DATA_DIRS", value = share_path }) |
-- XDG_DATA_DIRS
local share_path = real_path .. "/share"
local has_share = cmd.exec("test -d '" .. share_path .. "' && echo yes || echo no"):match("yes")
if has_share then
table.insert(env_vars, { key = "XDG_DATA_DIRS", value = share_path })
end
return env_vars
Which is eventually returned from PLUGIN:BackendExecEnv, resulting in mise resetting XDG_DATA_DIRS.
Fix
mise-nix should collect the pre-existing XDG_DATA_DIRS value, and append the package /share path.
Steps to reproduce
Observed behavior
XDG_DATA_DIRSonly includes thenix-most/sharedir:Expected behavior
XDG_DATA_DIRSto include both the prior dirs, and thenix-most/sharedir, something along these lines:Why
This is critical for most applications to continue working.
What's broken
mise hook-env -s fishcontains the following lines:And the culprit appears to be this code:
mise-nix/lib/nix_env.lua
Line 233 in e310c4c
Which is eventually returned from
PLUGIN:BackendExecEnv, resulting inmiseresettingXDG_DATA_DIRS.Fix
mise-nixshould collect the pre-existingXDG_DATA_DIRSvalue, and append the package/sharepath.