1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{
config,
lib,
pkgs,
...
}:
{
options.zpha.services.wlsunset.enable = lib.mkEnableOption "batsignal";
config = lib.mkIf config.zpha.services.wlsunset.enable {
users.users.zaphyra.maid = {
systemd.services.batsignal = {
description = "Day/night gamma adjustments for Wayland compositors.";
after = [ "niri-session.target" ];
partOf = [ "niri-session.target" ];
wantedBy = [ "niri-session.target" ];
unitConfig.ConditionEnvironment = "WAYLAND_DISPLAY";
serviceConfig = {
Restart = "on-failure";
ExecStart =
let
args = lib.cli.toCommandLineShellGNU { } {
t = 3000;
T = 4500;
l = "8.26";
L = "49.01";
};
in
"${lib.getExe pkgs.wlsunset} ${args}";
};
};
};
};
}