aboutsummaryrefslogtreecommitdiffstats
path: root/roles/local_homedirs/files/etc/profile.d/local-homedirs.sh
blob: c2b0361a2aeb96e21cb704943279ce363394665a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# This file contains various environment variables and hacks to accomodate
# applications that don't play well with NFS-mounted home directories.

if (( UID >= 1000 )); then
  export PYTHONUSERBASE="/usr/local/home/${USER}/.local"
  export npm_config_cache="/usr/local/home/${USER}/.npm"
  export CARGO_HOME="/usr/local/home/${USER}/.cargo"
  export GOPATH="/usr/local/home/${USER}/go"

  # firefox
  mkdir -p "/usr/local/home/${USER}/.mozilla"
  ln -sfn "/usr/local/home/${USER}/.mozilla" "${HOME}/.mozilla"

  # flatpak
  ln -sfn "/opt/flatpak/${USER}" "${HOME}/.var"

  # kwallet
  # The kwallet PAM modules hard-codes ~/.local/share/kwalletd, but kwallet
  # itself honors XDG_DATA_HOME. Gross.
  if [ -f "${HOME}/.local/share/kwalletd/kdewallet.salt" ]; then
    mkdir -p "/usr/local/home/${USER}/.local/share/kwalletd"
    ln -sfn "${HOME}/.local/share/kwalletd/kdewallet.salt" "/usr/local/home/${USER}/.local/share/kwalletd/kdewallet.salt"
  fi
fi