Bug report form
Describe the bug
In environments like rpm-ostree (Fedora Silverblue and family) and containerized setups, it is typical to run as a UID and GID without an actual user, and therefore without a home directory. In rpm-ostree in particular, a UID without a homedir is used when installing packages, because they install into a container image, not onto the local environment.
In the past, this has been fixed by setting XDG_CONFIG_HOME, which nushell respects.
But as of v0.115.0, this no longer works. It looks like nu fails to find the home directory, and fails to set the config home entirely. This prevents me from installing the current versions of nushell in my Fedora atomic setup.
Note that if I do set the HOME env var explicitly, it works fine, but still writes to the XDG_CONFIG_HOME dir. It also works if the user account has a home, and HOME is explicitly unset, while XDG_CONFIG_HOME is set.
How to reproduce
- Install nushell v0.114.1 and v0.115.0 (and the latest state of
main, to verify that it is still an issue)
- As root, run
python3 -c 'import os; os.setgid(12345); os.setuid(12345); os.execl("/bin/bash", "/bin/bash", "-i");' to switch to an arbitrary uid and gid (one that doesn't exist as a user on the system).
- Run different versions of nushell with
XDG_CONFIG_HOME=$(mktemp -d), like env "XDG_CONFIG_HOME=$(mktemp -d)" /path/to/nu
Expected behavior
I expect XDG_CONFIG_HOME to work even when HOME isn't set and the user doesn't have a usable home. It makes sense to error when none of these needed things is available, but an explicit XDG_CONFIG_HOME should work regardless.
Configuration
| key |
value |
| version |
0.115.2 |
| major |
0 |
| minor |
115 |
| patch |
2 |
| branch |
main |
| commit_hash |
cf5390e |
| build_os |
linux-x86_64 |
| build_target |
x86_64-unknown-linux-gnu |
| rust_version |
rustc 1.95.0 (59807616e 2026-04-14) |
| rust_channel |
1.95.0-x86_64-unknown-linux-gnu |
| cargo_version |
cargo 1.95.0 (f2d3ce0bd 2026-03-21) |
| build_time |
2026-08-25 16:32:49 +00:00 |
| build_rust_channel |
debug |
| allocator |
standard |
| features |
default, lsp, mcp, network, plugin, rustls-tls, sqlite, trash-support |
| installed_plugins |
|
| experimental_options |
example=false, dc-glob=false, reorder-cell-paths=true, pipefail=true, enforce-runtime-annotations=true, native-clip=false, cell-path-types=false, background-completions=true |
Bug report form
Describe the bug
In environments like rpm-ostree (Fedora Silverblue and family) and containerized setups, it is typical to run as a UID and GID without an actual user, and therefore without a home directory. In rpm-ostree in particular, a UID without a homedir is used when installing packages, because they install into a container image, not onto the local environment.
In the past, this has been fixed by setting
XDG_CONFIG_HOME, which nushell respects.But as of v0.115.0, this no longer works. It looks like nu fails to find the home directory, and fails to set the config home entirely. This prevents me from installing the current versions of nushell in my Fedora atomic setup.
Note that if I do set the
HOMEenv var explicitly, it works fine, but still writes to theXDG_CONFIG_HOMEdir. It also works if the user account has a home, andHOMEis explicitly unset, whileXDG_CONFIG_HOMEis set.How to reproduce
main, to verify that it is still an issue)python3 -c 'import os; os.setgid(12345); os.setuid(12345); os.execl("/bin/bash", "/bin/bash", "-i");'to switch to an arbitrary uid and gid (one that doesn't exist as a user on the system).XDG_CONFIG_HOME=$(mktemp -d), likeenv "XDG_CONFIG_HOME=$(mktemp -d)" /path/to/nuExpected behavior
I expect
XDG_CONFIG_HOMEto work even whenHOMEisn't set and the user doesn't have a usable home. It makes sense to error when none of these needed things is available, but an explicitXDG_CONFIG_HOMEshould work regardless.Configuration