aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--dot_config/environment.d/10-nix-profile-path.conf22
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}