Environment variables
Everything in the environment that changes what niwa does. Nothing else in it is read.
What niwa reads
A path variable is honored only when it is absolute. Anything else is ignored, and the default stands.
| Variable | What it does |
|---|---|
HOME | The home directory. It must be set and absolute, or niwa stops before it does anything. |
XDG_CONFIG_HOME | Moves the config repo to <value>/niwa. Honored when absolute, ignored otherwise. |
XDG_STATE_HOME | Moves the state directory to <value>/niwa. Honored when absolute, ignored otherwise. |
XDG_DATA_HOME | Moves shared data, including the shipped types and resolved modules. Honored when absolute. |
HOMEBREW_PREFIX | Where Homebrew lives, in place of the architecture default. Honored when absolute. |
NIWA_MANAGED_PREFS | Where managed preferences are read from. It exists so the tests can run against a fake one. |
NIWA_PROGRESS_EVERY | How often a long run prints a progress line, in seconds. The default is 30. |
NO_COLOR | Set and not empty: no color. The marks stay, so the screen still reads. |
FORCE_COLOR | Set, not empty, and not "0": color even when the output is a pipe. |
TERM | "dumb" turns color off, like NO_COLOR. |
TERM_PROGRAM | Names the terminal. On the ones known to render OSC 8, niwa prints clickable links. |
EDITOR | The editor pull opens for the edit answer. It may carry arguments, for example "code --wait". |
ZDOTDIR | Where .zshrc lives. uninstall reads it to find the PATH line the installer wrote. |
PATH | Where niwa finds the tools it drives, and what every command it runs inherits. |
What the installer reads
install.sh reads two more. They are for mirrors and for testing; neither is needed to install niwa.
| Variable | What it does |
|---|---|
NIWA_RELEASE_BASE | Where install.sh fetches a release from. For mirrors, and for testing. |
NIWA_VERSION | The version install.sh fetches. The default is the current release. |
Next
- File locations — say where every file lives and which are committed
- Reference — index the twenty verbs by how often you reach for them, and route to the rest
