[systemd-devel] "systemd-path systemd-search-user-unit" does not match reality

Dan Nicholson dbn at endlessos.org
Fri Jul 26 16:02:23 UTC 2024


On Fri, Jul 26, 2024 at 9:59 AM Dan Nicholson <dbn at endlessos.org> wrote:
>
> On Fri, Jul 26, 2024 at 6:50 AM Vladimir Panteleev
> <git at vladimir.panteleev.md> wrote:
> >
> > This seems to work:
> >
> > cat > ~/.config/systemd/user.conf <<EOF
> > [Manager]
> > ManagerEnvironment="XDG_DATA_DIRS=%h/.nix-profile/share"
> > EOF
>
> ManagerEnvironment only affects the environment variables for the
> systemd user process. To propagate the environment variable to
> processes spawned by the manager, use DefaultEnvironment. See
> https://www.freedesktop.org/software/systemd/man/latest/systemd-user.conf.html.

Another option here is a user environment generator. See
https://www.freedesktop.org/software/systemd/man/latest/systemd.environment-generator.html.
It even has an example of dynamically updating XDG_DATA_DIRS.

--
Dan


More information about the systemd-devel mailing list