summary refs log tree commit diff stats
path: root/zsh/.config/zsh/.zshenv
blob: 620ece500791a19199521a7c3db101ccc511851a (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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
if [[ $SHLVL -eq 1 || -n $DISPLAY ]]
then
  if [[ -f $ZDOTDIR/zshenv.local ]]
  then
    . $ZDOTDIR/zshenv.local
  fi

  if [[ -f $ZDOTDIR/zshenv.private ]]
  then
    . $ZDOTDIR/zshenv.private
  fi

  if [[ -e $HOME/.nix-profile/etc/profile.d/nix.sh ]]
  then
    . $HOME/.nix-profile/etc/profile.d/nix.sh;
    export NIX_LINK
  fi

  case $OSTYPE in
    darwin*)
      os=darwin
      ;;
    linux-gnu)
      os=linux
      ;;
    freebsd*)
      os=freebsd
      ;;
    *)
      os=unknown
      ;;
  esac

  if [[ $os == "linux" ]]
  then
    read osrelease < /proc/sys/kernel/osrelease
    if [[ $osrelease =~ Microsoft$ ]]
    then
      export windows=1
      umask 002
    fi
  fi

  if [[ $os != "darwin" ]]
  then
    unset SSH_AGENT_PID
    if [[ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]]
    then
      export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)"
    fi
  fi

  case $MACHTYPE in
    *64)
      arch=amd64
      ;;
    *)
      arch=386
      ;;
  esac

  if [[ ${path[(I)$HOME/.local/bin ]} ]]
  then
    path+=($HOME/.local/bin)
  fi

  if [[ ${path[(I)$HOME/go/bin ]} ]]
  then
    path+=($HOME/go/bin)
  fi

  if [[ $HOSTNAME =~ satoshi ]]
  then
    EMAIL=alan@satoshipay.io
  else
    EMAIL=alan@alanpearce.eu
  fi

  export GTAGSCONF=~/.globalrc
  export GTAGSLABEL=ctags

  export GHQ_ROOT="$HOME/projects:$HOME/go/src"

  export LEDGER_FILE="$HOME/Sync/Default/ledger/my.ledger"
fi