swayidle: use config.wayland.systemd.target

Also add `Unit.After`.
This commit is contained in:
Thiago Kenji Okada 2024-12-31 09:57:06 +00:00 committed by Robert Helgesson
parent 0734cfab07
commit 89fe48b1c1
Failed to generate hash of commit
2 changed files with 6 additions and 3 deletions

View file

@ -88,7 +88,8 @@ in {
systemdTarget = mkOption {
type = types.str;
default = "graphical-session.target";
default = config.wayland.systemd.target;
defaultText = literalExpression "config.wayland.systemd.target";
example = "sway-session.target";
description = ''
Systemd target to bind to.
@ -107,7 +108,8 @@ in {
Description = "Idle manager for Wayland";
Documentation = "man:swayidle(1)";
ConditionEnvironment = "WAYLAND_DISPLAY";
PartOf = [ "graphical-session.target" ];
PartOf = [ cfg.systemdTarget ];
After = [ cfg.systemdTarget ];
};
Service = {

View file

@ -1,4 +1,4 @@
{ config, pkgs, lib, ... }:
{ config, ... }:
{
services.swayidle = {
@ -50,6 +50,7 @@
Type=simple
[Unit]
After=graphical-session.target
ConditionEnvironment=WAYLAND_DISPLAY
Description=Idle manager for Wayland
Documentation=man:swayidle(1)