Skip to content

XDG_CONFIG_HOME no longer allows a UID without a home directory to have config files #18902

Description

@Taywee

Bug report form

  • I have done a basic search of the issue tracker to find any existing issues that are similar.
  • I have checked that my version is at least the latest stable release available via my installation method.

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

  1. Install nushell v0.114.1 and v0.115.0 (and the latest state of main, to verify that it is still an issue)
  2. 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).
  3. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    status:needs-triageAn issue that hasn't had any proper look

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions