Session: the outer bus and runtime dir only for the user-service step

steamFrameUserServices exported XDG_RUNTIME_DIR and DBUS_SESSION_BUS_ADDRESS
into the rest of the activation script; a subshell keeps them to its
systemctl calls.
This commit is contained in:
Pierre Kisters committed 2026-10-01 04:09:13 +02:00
1 parent 2442527514
commit ae8686e284
1 file changed
+5
+5
View File
@@ -89,7 +89,10 @@ in {
};
};
# In a subshell: the outer session's environment must not leak into
# activation steps that run later.
config.home.activation.steamFrameUserServices = lib.hm.dag.entryAfter [ "reloadSystemd" ] (''
(
export XDG_RUNTIME_DIR=${lib.escapeShellArg cfg.runtimeDir} DBUS_SESSION_BUS_ADDRESS=${lib.escapeShellArg cfg.bus}
run /usr/bin/systemctl --user daemon-reload
'' + lib.optionalString (cfg.services.start != [ ]) ''
@@ -102,5 +105,7 @@ in {
done
'' + lib.optionalString (cfg.services.restart != [ ]) ''
run /usr/bin/systemctl --user restart ${units cfg.services.restart}
'' + ''
)
'');
}