diff --git a/apply-dotfiles b/apply-dotfiles index f900656..bfc7db6 100755 --- a/apply-dotfiles +++ b/apply-dotfiles @@ -18,6 +18,7 @@ apply_dotfile readline apply_dotfile screen apply_dotfile git +apply_dotfile xdg apply_dotfile vim diff --git a/bash/.bashrc b/bash/.bashrc index 0f9dafb..ccf5f6b 100644 --- a/bash/.bashrc +++ b/bash/.bashrc @@ -109,6 +109,9 @@ if [ -r "$HOME/.env" ]; then . "$HOME/.env" fi +if [ -r "$HOME/.config/xdg/env" ]; then + . "$HOME/.config/xdg/env" +fi # Source aliases, if they exist if [ -f "$HOME/.aliases" ] && [ -r "$HOME/.aliases" ]; then diff --git a/installers/install-nix.sh b/installers/install-nix.sh index 48c21c8..d0ae44b 100755 --- a/installers/install-nix.sh +++ b/installers/install-nix.sh @@ -40,6 +40,7 @@ NIX_CONF_FILE=${NIX_CONF_DIR}/nix.conf mkdir -p ${NIX_CONF_DIR} cat < ${NIX_CONF_FILE} experimental-features = flakes nix-command +use-xdg-base-directories = true EOF # Conditionally add a link to system certificates for nix if [ -f /etc/ssl/certs/ca-certificates.crt ]; then diff --git a/readline/.inputrc b/readline/.config/readline/inputrc similarity index 100% rename from readline/.inputrc rename to readline/.config/readline/inputrc diff --git a/ruby/.irbrc b/ruby/.config/irb/irbrc similarity index 100% rename from ruby/.irbrc rename to ruby/.config/irb/irbrc diff --git a/screen/.screenrc b/screen/.config/screen/screenrc similarity index 100% rename from screen/.screenrc rename to screen/.config/screen/screenrc diff --git a/xdg/.config/xdg/env b/xdg/.config/xdg/env new file mode 100644 index 0000000..8b05430 --- /dev/null +++ b/xdg/.config/xdg/env @@ -0,0 +1,11 @@ +export XDG_DATA_HOME="${HOME}/.local/share" +export XDG_CONFIG_HOME="${HOME}/.config" +export XDG_STATE_HOME="${HOME}/.local/state" +export XDG_CACHE_HOME="${HOME}/.cache" + +# Set environment variables to force programs to respect XDG that do not by default +export SCREENRC="${XDG_CONFIG_HOME}/screen/screenrc" +export GNUPGHOME="$XDG_DATA_HOME"/gnupg +export MYSQL_HISTFILE="$XDG_DATA_HOME"/mysql_history +export INPUTRC="$XDG_CONFIG_HOME"/readline/inputrc +export IRBRC="$XDG_CONFIG_HOME/irb/irbrc"