+ # create tmp link
+ t="${TMPDIR:-/tmp}/home-$LOGNAME"
+ h="$HOME/tmp"
+ if [[ ! -e "$t" ]] {
+ mkdir -m 700 "$t" > /dev/null 2>&1
+ # TODO: check if dir exists after mkdir
+ }
+ # allow opaque entries to override link creation
+ if [[ ! -e "$h" ]] {
+ ln -sf "$t" "$h" > /dev/null 2>&1
+ }
+ unset t h
+}
+
+### gpg ssh forwarding
+# these env vars are used as arguments to RemoteForward in ~/.ssh/config
+if [[ -v commands[gpgconf] && ! ( -v _GNUPG_SOCK_SRC && -v _GNUPG_SOCK_DEST ) ]] {
+ # if already connected over SSH, reuse forwarded socket for future
+ # connections; else use extra socket
+ sock=${SSH_CLIENT:+agent-socket}
+ export _GNUPG_SOCK_SRC=$(gpgconf --list-dirs ${sock:-agent-extra-socket})
+ # XXX: chance of race condition
+ export _GNUPG_SOCK_DEST=/tmp/.gpg-agent-forward
+ unset sock
+}
+
+### load site-specific
+if [[ -f ~/.zshenv.local ]] { source ~/.zshenv.local }
+
+# vim: set et sts=4 sw=4 ts=8 tw=79 :