From dec206f1ec17b27ebb3dcffb7f9d2728067ece78 Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Fri, 4 Apr 2025 00:56:55 -0700 Subject: [PATCH] feat: add hyprsunset service --- .../desktop-environment/hyprland/default.nix | 7 +++++++ .../hyprland/utilities.nix | 19 +++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/hm/modules/linux/desktop-environment/hyprland/default.nix b/hm/modules/linux/desktop-environment/hyprland/default.nix index 9173803..059ccbe 100644 --- a/hm/modules/linux/desktop-environment/hyprland/default.nix +++ b/hm/modules/linux/desktop-environment/hyprland/default.nix @@ -58,6 +58,13 @@ in Monitor to use for screen locker. Use `hyprctl monitors` to determine. ''; }; + bluelight.enable = lib.mkOption { + type = lib.types.bool; + default = true; + description = '' + Whether to enable `hyprsunset` as a daemon. + ''; + }; }; config = lib.mkIf cfg.enable { diff --git a/hm/modules/linux/desktop-environment/hyprland/utilities.nix b/hm/modules/linux/desktop-environment/hyprland/utilities.nix index 5357528..e1c2b12 100644 --- a/hm/modules/linux/desktop-environment/hyprland/utilities.nix +++ b/hm/modules/linux/desktop-environment/hyprland/utilities.nix @@ -9,6 +9,25 @@ let in { config = lib.mkIf cfg.enable { + systemd.user.services = lib.mkIf cfg.bluelight.enable { + hyprsunset = { + Unit = { + Description = "Start the hyprsunset daemon"; + PartOf = "hyprland-session.target"; + After = "hyprland-session.target"; + }; + Service = { + Type = "simple"; + ExecStart = "${pkgs.hyprsunset}/bin/hyprsunset"; + Restart = "on-failure"; + RestartSec = 3; + }; + Install = { + WantedBy = [ "hyprland-session.target" ]; + }; + }; + }; + services.hyprpaper.enable = true; programs.wlogout.enable = true;