diff --git a/users/files/bashrc.jinja b/users/files/bashrc.jinja index 0434bd7..7bb5607 100644 --- a/users/files/bashrc.jinja +++ b/users/files/bashrc.jinja @@ -62,13 +62,12 @@ fi PATH="${PATH}:${HOME}/.local/bin" alias random='< /dev/urandom tr -dc A-Za-z0-9 | head -c${1:-32};echo' -{%- if bashrc_user is defined and bashrc_user == 'keiran' %} -{#- TODO: this should be in pillar #} -alias keirmounts=/home/keiran/Documents/scripts/mounts.sh -alias grive=/home/keiran/Documents/scripts/grive.sh -{%- endif %} -{%- if bashrc_user is defined and bashrc_user == 'root' and 'restic' in pillar %} +{%- if bashrc_user is defined %} +{%- if bashrc_user == 'root' and 'restic' in pillar %} export RESTIC_REPOSITORY={{ salt.pillar.get('restic:repo') }} export RESTIC_PASSWORD={{ salt.pillar.get('restic:pass') }} -{% endif %} - +{%- endif %} +{%- for alias, cmd_str in salt.pillar.get("bash_aliases:{}".format(bashrc_user), {}).items() %} +alias {{ alias }}="{{ cmd_str }}" +{%- endfor %} +{%- endif %}