Skip to content

Commit

Permalink
add .pam_environment
Browse files Browse the repository at this point in the history
  • Loading branch information
contrun committed Aug 10, 2024
1 parent 99a2a1c commit 68ed898
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions dot_pam_environment.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{{ if lookPath "nvim" -}}
EDITOR DEFAULT="nvim"
{{ end }}

{{ if lookPath "less" }}
PAGER DEFAULT="less"
LESS DEFAULT="-x4RFsX"
{{ end }}

{{ if lookPath "cabal" }}
CABALPATH DEFAULT="@{HOME}/.cabal"
{{ end }}

{{ if or (joinPath .chezmoi.homeDir ".cargo" | lstat) (lookPath "cargo") }}
CARGOPATH DEFAULT="@{HOME}/.cargo"
{{ end }}

{{ if or (joinPath .chezmoi.homeDir ".go" | lstat) (lookPath "go") }}
GOPATH DEFAULT="@{HOME}/.go"
{{ end }}

{{ if lstat "/etc/nix/path" }}
NIX_PATH DEFAULT="/etc/nix/path"
{{ end }}

{{ if or (joinPath .chezmoi.homeDir ".node" | lstat) (lookPath "node") }}
NODE_PATH DEFAULT="@{HOME}/.node"
{{ end }}

PATH DEFAULT="{{- if joinPath .chezmoi.homeDir ".bin" | lstat -}}@{HOME}/.bin:{{- end -}}{{- if joinPath .chezmoi.homeDir ".local/bin" | lstat -}}@{HOME}/.local/bin:{{- end -}}{{- if joinPath .chezmoi.homeDir ".cabal/bin" | lstat -}}@{HOME}/.cabal/bin:{{- end -}}{{- if joinPath .chezmoi.homeDir ".cargo/bin" | lstat -}}@{HOME}/.cargo/bin:{{- end -}}{{- if joinPath .chezmoi.homeDir ".go/bin" | lstat -}}@{HOME}/.go/bin:{{- end -}}{{- if joinPath .chezmoi.homeDir ".nix-profile/bin" | lstat -}}@{HOME}/.nix-profile/bin:{{- end -}}{{- if joinPath .chezmoi.homeDir ".local/state/nix/profiles/home-manager/bin" | lstat -}}@{HOME}/.local/state/nix/profiles/home-manager/bin:{{- end -}}{{- if joinPath "/etc/profiles/per-user" .chezmoi.username "bin" | lstat -}}/etc/profiles/per-user/@{PAM_USER}/bin:{{- end -}}{{- if lstat "/nix/var/nix/profiles/default/bin" -}}/nix/var/nix/profiles/default/bin:{{- end -}}{{- if lstat "/run/wrappers/bin" -}}/run/wrappers/bin:{{- end -}}{{- if lstat "/run/current-system/sw/bin" -}}/run/current-system/sw/bin:{{- end -}}/usr/local/bin:${PATH}"

0 comments on commit 68ed898

Please sign in to comment.