Skip to content

Commit

Permalink
update ubuntu environment for XDG_DATA_DIR
Browse files Browse the repository at this point in the history
  • Loading branch information
contrun committed Oct 17, 2024
1 parent d5be726 commit 4bb219d
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion dot_pam_environment.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,17 @@ NODE_PATH DEFAULT="@{HOME}/.node"

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}"

# https://wiki.nixos.org/wiki/Locales
{{ if and (lstat "/nix") (eq .chezmoi.os "linux") (not (lstat "/etc/nixos")) (lstat "/usr/lib/locale/locale-archive") }}
# https://wiki.nixos.org/wiki/Locales
LOCALE_ARCHIVE DEFAULT="/usr/lib/locale/locale-archive"
{{ end }}

{{ if and (lstat "/nix") (eq .chezmoi.os "linux") (not (lstat "/etc/nixos")) (joinPath .chezmoi.homeDir ".nix-profile/share" | lstat) }}
# https://github.com/nix-community/home-manager/issues/4922
XDG_DATA_DIRS DEFAULT=@{HOME}/.nix-profile/share
{{ end }}

{{ if and (lstat "/nix") (eq .chezmoi.os "linux") (not (lstat "/etc/nixos")) (joinPath .chezmoi.homeDir ".nix-profile/share/xdg-desktop-portal/portals" | lstat) }}
# https://github.com/nix-community/home-manager/issues/4922
NIX_XDG_DESKTOP_PORTAL_DIR DEFAULT=@{HOME}/.nix-profile/share/xdg-desktop-portal/portals
{{ end }}

0 comments on commit 4bb219d

Please sign in to comment.