aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/dot_config/environment.d/10-nix-profile-path.conf
blob: 2e396d76b5fa971e3618bbf115f6e49c26ef4734 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Prepend the Nix home-profile (and ~/.local/bin) to the systemd *user*
# manager's PATH at manager startup, before any unit in sway-session.target
# launches.
#
# Why this exists: most user-leaf tools (waybar, swayidle, swayr, mako,
# cliphist, inhibridge, wob, …) were migrated from pacman (/usr/bin) to the
# Nix home profile (~/.nix-profile/bin) and their .service units reference
# them by *bare* name, relying on $PATH resolution (see nix/host.nix). The
# systemd user manager does NOT source ~/.zprofile, so without this its PATH
# is only /usr/local/bin:/usr/bin:/bin and every bare-name ExecStart fails
# with status=203/EXEC.
#
# The sway config also runs `systemctl --user import-environment PATH`, but
# that is a fire-and-forget `exec` that races with
# `systemctl --user start sway-session.target`; if the start wins, the units
# launch with the default PATH. environment.d is read deterministically at
# manager start (before any unit), so it closes that race independently of
# the live session.
#
# Note: environment.d is only re-read on a fresh user manager (login/boot) or
# after `systemctl --user daemon-reexec`; it is not picked up mid-session.
PATH=${HOME}/.nix-profile/bin:${HOME}/.local/bin:${PATH}