Expand description
Nushell configuration infrastructure.
This crate owns all XDG-aware path resolution for Nushell configuration
files and directories. It is the single source of truth for where config
lives. It does not evaluate or parse config files — that is the job of
nu-cli / the nu binary.
§Architecture
CLI flags + process env + platform dirs
│
▼
resolve_paths() ← one-shot at startup
│
▼
NushellConfigDirs ← stored on EngineState.config_dirs
│
┌────────┼────────┬──────────────┐
▼ ▼ ▼ ▼
$nu.* loaders history pluginsAfter startup, do not re-read XDG_* env vars or call free path helpers.
Always read from NushellConfigDirs.
§Resolution priority
For every path:
- CLI override (
CliOverrides— e.g.--config-home,--config) - XDG environment variable (e.g.
$XDG_CONFIG_HOME) - Platform default via the
EnvAccessseam
§Testing
Use TestEnv to inject env vars and platform directories without touching
the host process. Prefer unit tests in this crate over spawning nu for pure
path-resolution logic.
Structs§
- CliOverrides
- CLI flags that affect where configuration files are found.
- Nushell
Config Dirs - All resolved configuration directories and file paths for Nushell.
- System
Env - Reads from the real process environment and
dirscrate fallbacks. - TestEnv
- In-memory environment + optional platform directory overrides for tests.
Enums§
- Config
Error - Errors that can occur during config-path resolution.
- Config
File Kind - Metadata about the two kinds of Nushell configuration files.
- Config
Path - A resolved config-related file path that records whether it came from a
CLI override or from the default location under
config_home. - Config
Warning - Non-fatal warnings produced during config-path resolution.
Traits§
- EnvAccess
- Abstraction over process environment and platform directory discovery so path-resolution logic can be unit-tested without touching the host.
Functions§
- resolve_
paths - One-shot entry point for resolving all Nushell configuration paths.