Nushell now supports using the XDG_CONFIG_HOME
environment variable to specify the location for config files. The variable must be set before Nushell is launched.
I'm not a macOS user, so I hope my process and terminology are correct here. I believe there are several ways to set these variables:
From this Stack Overflow answer, use
launchctl setenv XDG_CONFIG_HOME <path>
.FromIf that doesn't, work, thisa user on the Nushell Discord threadserver reported in the Nushell server, you canthat they needed to create a LaunchAgent in yourtheir user-level
~/Library/LaunchAgents
like:<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label</key> <string>me.oscarvarto.environment</string> <key>ProgramArguments</key> <array> <string>/bin/sh</string> <string>-c</string> <string> launchctl setenv XDG_CONFIG_HOME /Users/oscarvarto/.config && launchctl setenv XDG_CACHE_HOME /Users/oscarvarto/.cache && launchctl setenv XDG_DATA_HOME /Users/oscarvarto/.local/share && launchctl setenv XDG_STATE_HOME /Users/oscarvarto/.local/state && launchctl setenv XDG_RUNTIME_DIR /Users/oscarvarto/.local/run && launchctl setenv XDG_BIN_HOME /Users/oscarvarto/.local/bin </string> </array> <key>RunAtLoad</key> <true/> <key>ServiceIPC</key> <false/> </dict> </plist>