<div dir="ltr"><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jul 25, 2024 at 10:42 AM Vladimir Panteleev <<a href="mailto:git@vladimir.panteleev.md">git@vladimir.panteleev.md</a>> wrote:</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
It looks like "systemd-path systemd-search-user-unit" isn't accurate<br>
or does not correspond to the list of paths that systemd is looking<br>
in.<br></blockquote><div><br></div><div><div>The paths for user units and other user configuration depend on your XDG_{CONFIG,DATA}_{DIRS,HOME} environment variables.</div><div><br></div><div>Since systemd-search-user-unit is running as part of your interactive session (and under your interactive shell) whereas systemd --user itself <b>is not</b>, they will likely have different lists of environment variables, especially if you have Nix set up a custom XDG_* through /etc/profile or similar.</div><div><br></div><div>While systemd --user has a few ways to push environment variables into the services it starts, those all happen after initialization; there's no good equivalent for providing envvars for systemd itself. You would need to `sudo systemctl edit user@$UID` and add some [Service] Environment= definitions there.</div><div><br></div><div>(In the early days I used to edit the user@.service to invoke `ExecStart=/bin/sh -l -c "exec systemd --user"` so that it would go through the shell's ~/.profile processing, but I'm not sure if that works these days.)</div></div></div><br><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr">Mantas Mikulėnas</div></div></div>