Skip to main content
added 34 characters in body
Source Link
NotTheDr01ds
  • 23.6k
  • 6
  • 70
  • 112

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:

  1. From this Stack Overflow answer, use launchctl setenv XDG_CONFIG_HOME <path>.

  2. 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>
    

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:

  1. From this Stack Overflow answer, use launchctl setenv XDG_CONFIG_HOME <path>.

  2. From this Discord thread in the Nushell server, you can create a LaunchAgent in your 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>
    

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:

  1. From this Stack Overflow answer, use launchctl setenv XDG_CONFIG_HOME <path>.

  2. If that doesn't, work, a user on the Nushell Discord server reported that they needed to create a LaunchAgent in their 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>
    
Source Link
NotTheDr01ds
  • 23.6k
  • 6
  • 70
  • 112

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:

  1. From this Stack Overflow answer, use launchctl setenv XDG_CONFIG_HOME <path>.

  2. From this Discord thread in the Nushell server, you can create a LaunchAgent in your 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>