aboutsummaryrefslogtreecommitdiff
path: root/files/etc/profile.d/local-homedir.sh.common
blob: 683756a98f16ce5abba26daa3d8c80e602abea98 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/sh

# This file contains various environment variables and hacks to accomodate
# applications that don't play well with NFS-mounted home directories.

if [ "$(id -u)" -lt 1000 ]; then
  return 0
fi

LOCAL_HOME="/usr/local/home/${USER}"

export PYTHONUSERBASE="${LOCAL_HOME}/.local"
export npm_config_cache="${LOCAL_HOME}/.npm"
export CARGO_HOME="${LOCAL_HOME}/.cargo"
export GOPATH="${LOCAL_HOME}/go"

# firefox
mkdir -p "${LOCAL_HOME}/.mozilla"
ln -sfn "${LOCAL_HOME}/.mozilla" "${HOME}/.mozilla"

# thunderbird
mkdir -p "${LOCAL_HOME}/.thunderbird"
ln -sfn "${LOCAL_HOME}/.thunderbird" "${HOME}/.thunderbird"

# kwallet
# The kwallet PAM module hard-codes ~/.local/share/kwalletd, but kwallet itself
# honors XDG_DATA_HOME! So we symlink from the local disk back into NFS. Gross!
mkdir -p "${LOCAL_HOME}/.local/share/kwalletd"
ln -sfn "${HOME}/.local/share/kwalletd/kwallet.salt" "${LOCAL_HOME}/.local/share/kwalletd/kdewallet.salt"