diff options
| author | 2026-06-05 11:05:59 +0100 | |
|---|---|---|
| committer | 2026-06-05 11:05:59 +0100 | |
| commit | 8bd9b4b1dde1274b5f23171610eed7c3396dad96 (patch) | |
| tree | cbb20d7155c27f04271703734e6805561e246795 /dot_config/environment.d | |
| parent | 70b77932ae3c37f1729230b2f3c5f160cc82bc2e (diff) | |
| download | dotfiles-8bd9b4b1dde1274b5f23171610eed7c3396dad96.tar.gz dotfiles-8bd9b4b1dde1274b5f23171610eed7c3396dad96.tar.bz2 dotfiles-8bd9b4b1dde1274b5f23171610eed7c3396dad96.zip | |
fix(systemd): add environment.d PATH so user units find nix binaries
The user-leaf tools (waybar, swayidle, swayr, mako, cliphist, inhibridge,
wob, …) were migrated to the Nix home profile and their .service units
reference them by bare name. The systemd user manager does not source
~/.zprofile, so its PATH lacked ~/.nix-profile/bin and every bare-name
ExecStart failed with status=203/EXEC.
The sway config's `systemctl --user import-environment PATH` raced with
`systemctl --user start sway-session.target`; when the start won, units
launched with the default PATH. environment.d is read at manager startup
before any unit, closing the race deterministically.
Pick up via fresh login/boot or `systemctl --user daemon-reexec`.
Diffstat (limited to 'dot_config/environment.d')
| -rw-r--r-- | dot_config/environment.d/10-nix-profile-path.conf | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/dot_config/environment.d/10-nix-profile-path.conf b/dot_config/environment.d/10-nix-profile-path.conf new file mode 100644 index 0000000..2e396d7 --- /dev/null +++ b/dot_config/environment.d/10-nix-profile-path.conf @@ -0,0 +1,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} |
