Hyprsunset home manager configuration not working

{ config, lib, pkgs, ... }:

{

  wayland.windowManager.hyprland.settings.exec-once = [ "hyprsunset" ];

  # I have no idea why this isn't working
  services.hyprsunset = {
    enable = true;
    package = pkgs.hyprsunset;
    transitions = {
      sunrise = {
        calendar = "*-*-* 05:00:00";
        requests = [
          [ "temperature" "6500" ]
          [ "gamma 100" ]
        ];
      };
      sunset = {
        calendar = "*-*-* 19:00:00";
        requests = [
          [ "temperature" "3500" ]
          [ "gamma 50" ]
        ];
      };
    };
  };
}

I don’t even get hyprsunset as a command with that:

safri@yuki:~/ > hyprsunset
hyprsunset: command not found

Everything builds just fine, it just doesn’t seem to be making any effect.

Am I being dumb here?

Any help would be appreciated, the rest of my config is on codeberg

That Home-Manger module does not add the package to home.packages. It just generates systemd user units that reference the package directly. So your first line will also not work.

If you want that binary to be generally available in your system, you should add it to home.packages yourself.

I see, that makes sense, do you have any idea why the service would seem to be taking no effect though?

files are clearly being installed in the nix store:

safri@yuki:~/ > ls /nix/store/ | grep hyprsunset                                                 
39c5b4qmjzr1174a6nv4pxfpd2q1pacn-hyprsunset-sunset.service
4g5zzgbrmlq2j1xs1gy45z39xmf0l84d-hyprsunset-0.2.0.drv
56hjv7fv746nlfj77h4f780nvsh75cw5-hyprsunset-sunset.timer.drv
68dl09xhg3bsi3b9ba520l30x8qnqiv8-hyprsunset.service
7aw9cmcbbf97vrl4nldxlq694l7mlizn-hyprsunset-sunrise.timer
c1lzpm9811lzk0y3qq7m04bainq7jvn2-hyprsunset-sunrise.service
d72rx0n5lp4354z5swxfxxsn5drnd10b-hyprsunset-sunrise.timer
gv4l75wl7n3wj7pryy30mcljjpqsb5pa-hyprsunset-0.2.0
k9gxq5s146pc67j7fn93xpgv2z42igl5-hyprsunset-sunrise.timer.drv
lkysy1w626ypbzg1di64gqs4dzlqv89c-hyprsunset-sunset.service.drv
lp5lpjif7rzxz3n3c066ppr8hvd4p7lr-hyprsunset.service.drv
p1hi43pk5kjmw2p1skcixisya03mfp39-hyprsunset-sunrise.service.drv
qbbx1vzyg2l9y34wish8npf9c7j9n0b5-hyprsunset.service.drv
rgc6x95dfzpq0k5117lidxpm6c92f0gb-hyprsunset-sunrise.timer.drv
wnhp0jfk206fb1swvp9csnnjispclm84-hyprsunset.service
zwva319xy2xfd6jih4asq5q43xv16079-hyprsunset-sunset.timer

Sorry, I’m not using Hyprland and it’s accompanying tools, it all seems too brittle to me.

I’d probably check the status of those systemd user units and timers and go from there. You can also run hyprsunset directly from your Nix store (or manually putting it in your home.packages) and see if it works by manual invocation, so you can see if you have a problem with that tool in general or just with the generated systemd units.

yuki% systemctl  --user status hyprsunset
○ hyprsunset.service - hyprsunset - Hyprland's blue-light filter
     Loaded: loaded (/home/safri/.config/systemd/user/hyprsunset.service; enabled; preset: ignored)
     Active: inactive (dead)

When I try and manually start it:

yuki% systemctl enable --now --user hyprsunset
yuki% systemctl status --user hyprsunset
● hyprsunset.service - hyprsunset - Hyprland's blue-light filter
     Loaded: loaded (/home/safri/.config/systemd/user/hyprsunset.service; enabled; preset: ignored)
     Active: activating (auto-restart) (Result: exit-code) since Thu 2025-07-03 07:17:04 CDT; 254ms ago
 Invocation: 4e27a14f51044bf6b784f1a50b9a52fd
    Process: 40036 ExecStart=/nix/store/gv4l75wl7n3wj7pryy30mcljjpqsb5pa-hyprsunset-0.2.0/bin/hyprsunset (code=exited, status=1/FAILURE)
   Main PID: 40036 (code=exited, status=1/FAILURE)
   Mem peak: 1.8M
        CPU: 7ms

Exec path is correct

yuki% /nix/store/gv4l75wl7n3wj7pryy30mcljjpqsb5pa-hyprsunset-0.2.0/bin/hyprsunset
┏ hyprsunset v0.2.0 ━━╸
┃
┣ Setting the temperature to 6000K (default)
┃
┣ Calculated the CTM to be [mat3x3: 1, 0, 0, 0, 0.96528697, 0, 0, 0, 0.92878336]
┃
┣ Running on Hyprland
┣ Found hyprland-ctm-control-v1 supported with version 2, binding to v2
┣ Found new output with ID 58, binding
┣ Found 1 outputs, applying CTMs
✖ A CTM manager is already running on the current compositor.

contents of hyprsunset.service:

[Install]
WantedBy=graphical-session.target

[Service]
ExecStart=/nix/store/gv4l75wl7n3wj7pryy30mcljjpqsb5pa-hyprsunset-0.2.0/bin/hyprsunset --identity
Restart=always
RestartSec=10

[Unit]
After=graphical-session.target
ConditionEnvironment=WAYLAND_DISPLAY
Description=hyprsunset - Hyprland's blue-light filter
PartOf=graphical-session.target

The tool works fine with manual invocation, its just the service that seems to not be working so great