From 76fd89a2170982a48152c130b242139010be8a6d Mon Sep 17 00:00:00 2001 From: Aly Raffauf Date: Fri, 2 Aug 2024 16:31:15 -0400 Subject: [PATCH] home: better systemd defaults for swayidle and swayosd --- homeManagerModules/desktop/wayland/default.nix | 8 +++++++- homeManagerModules/services/swayidle/default.nix | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/homeManagerModules/desktop/wayland/default.nix b/homeManagerModules/desktop/wayland/default.nix index 53315730..8e6dffed 100644 --- a/homeManagerModules/desktop/wayland/default.nix +++ b/homeManagerModules/desktop/wayland/default.nix @@ -39,7 +39,13 @@ swayosd.enable = lib.mkDefault true; }; - systemd.user.services.swayosd.Install.WantedBy = ["hyprland-session.target" "sway-session.target"]; + systemd.user.services.swayosd = { + Install.WantedBy = lib.mkForce ["hyprland-session.target" "sway-session.target"]; + Service = { + Restart = lib.mkForce "on-failure"; + RestartSec = 5; + }; + }; xdg.portal = { enable = true; diff --git a/homeManagerModules/services/swayidle/default.nix b/homeManagerModules/services/swayidle/default.nix index efb8bc28..cedc1e03 100644 --- a/homeManagerModules/services/swayidle/default.nix +++ b/homeManagerModules/services/swayidle/default.nix @@ -62,6 +62,12 @@ in { }; }; - systemd.user.services.swayidle.Service.Restart = lib.mkForce "on-failure"; + systemd.user.services.swayidle = { + Install.WantedBy = lib.mkForce ["hyprland-session.target" "sway-session.target"]; + Service = { + Restart = lib.mkForce "on-failure"; + RestartSec = 5; + }; + }; }; }