e34a1589fe
With ‘systemd.user.units’ and ‘systemd.user.services’, you can specify units used by per-user systemd instances. For example, systemd.user.services.foo = { description = "foo"; wantedBy = [ "default.target" ]; serviceConfig.ExecStart = "${pkgs.foo}/bin/foo"; }; declares a unit ‘foo.service’ that gets started automatically when the user systemd instance starts, and is stopped when the user systemd instance stops. Note that there is at most one systemd instance per user: it's created when a user logs in and there is no systemd instance for that user yet, and it's removed when the user fully logs out (i.e. has no sessions anymore). So if you're simultaneously logged in via X11 and a virtual console, you get only one copy of foo. |
||
---|---|---|
.. | ||
loader | ||
kernel.nix | ||
kexec.nix | ||
luksroot.nix | ||
modprobe.nix | ||
pbkdf2-sha512.c | ||
readonly-mountpoint.c | ||
shutdown.nix | ||
stage-1-init.sh | ||
stage-1.nix | ||
stage-2-init.sh | ||
stage-2.nix | ||
systemd-unit-options.nix | ||
systemd.nix |