From 844ef0c37a6f10a1c912707c35dd843c44ea92ba Mon Sep 17 00:00:00 2001 From: sommerfeld Date: Fri, 22 May 2026 10:41:23 +0100 Subject: fix(sway): propagate PATH / GPG env into systemd --user + dbus MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Waybar (and other user services) was inheriting the bare pre-login PATH from systemd --user, missing ~/.nix-profile/bin and ~/.local/bin. Modules that call nix-provisioned binaries (pass, python3, ncat from common.nix) silently picked up system copies instead — symptom was waybar showing different output from the same script when invoked manually (thunderbird tb-unread.sh, wifi-status.sh). Also propagate GNUPGHOME and GPG_TTY so pinentry / pass-otp inside user services behave the same as in the interactive shell. --- dot_config/sway/config | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/dot_config/sway/config b/dot_config/sway/config index 688f0d2..4ad670d 100644 --- a/dot_config/sway/config +++ b/dot_config/sway/config @@ -250,8 +250,17 @@ bindsym $mod+t exec ~/.config/sway/tb-toggle.sh # Managed by waybar.service (pulled in via sway-session.target). # ── Autostart ───────────────────────────────────────────────────────────────── -exec systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE XDG_SESSION_DESKTOP PASSWORD_STORE_DIR -exec dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE XDG_SESSION_DESKTOP PASSWORD_STORE_DIR +# Propagate the login-shell env (zprofile already ran by the time sway +# executes its config) into the systemd --user manager AND the DBus +# activation environment. Without this, user services like waybar.service +# inherit the bare pre-login PATH (no ~/.nix-profile/bin, no ~/.local/bin), +# and modules invoking nix-provisioned binaries (pass / python3 / ncat +# from common.nix) silently pick up the system copies instead — manifests +# as waybar modules printing different output from the same script run +# interactively. PATH is the critical one; GNUPGHOME / GPG_TTY keep +# pass-otp + pinentry consistent with the interactive shell. +exec systemctl --user import-environment PATH DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE XDG_SESSION_DESKTOP PASSWORD_STORE_DIR GNUPGHOME GPG_TTY +exec dbus-update-activation-environment --systemd PATH DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE XDG_SESSION_DESKTOP PASSWORD_STORE_DIR GNUPGHOME GPG_TTY exec "sleep 2 && ~/.config/sway/display-toggle.sh apply" exec systemctl --user start sway-session.target exec ~/.config/sway/tb-autostart.sh -- cgit v1.3.1