Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
1.4 KiB
1.4 KiB
systemd-lock-handler
The systemd-lock-handler module provides a service that bridges
D-Bus events from logind to user-level systemd targets:
lock.targetstarted byloginctl lock-session,unlock.targetstarted byloginctl unlock-sessionandsleep.targetstarted bysystemctl suspend.
You can create a user service that starts with any of these targets.
For example, to create a service for swaylock:
{
services.systemd-lock-handler.enable = true;
systemd.user.services.swaylock = {
description = "Screen locker for Wayland";
documentation = [ "man:swaylock(1)" ];
# If swaylock exits cleanly, unlock the session:
onSuccess = [ "unlock.target" ];
# When lock.target is stopped, stops this too:
partOf = [ "lock.target" ];
# Delay lock.target until this service is ready:
before = [ "lock.target" ];
wantedBy = [ "lock.target" ];
serviceConfig = {
# systemd will consider this service started when swaylock forks...
Type = "forking";
# ... and swaylock will fork only after it has locked the screen.
ExecStart = "${lib.getExe pkgs.swaylock} -f";
# If swaylock crashes, always restart it immediately:
Restart = "on-failure";
RestartSec = 0;
};
};
}
See upstream documentation for more information.