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