blob: 4aef68dc745db5e858220d7c2385637752646d17 (
plain)
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
|
# Darkman - Automatic dark/light mode switching based on time of day
{
config,
lib,
pkgs,
...
}:
{
options.desktop.darkman = {
enable = lib.mkEnableOption "Enables darkman automatic dark/light mode switching." // {
default = true;
};
};
config = lib.mkIf (config.desktop.enable && config.desktop.darkman.enable) {
services.darkman = {
enable = true;
settings = {
portal = true;
lat = 0;
lng = 0;
};
};
xdg.portal = {
enable = true;
extraPortals = [ pkgs.xdg-desktop-portal-hyprland ];
config.common = {
default = [ "hyprland" ];
"org.freedesktop.impl.portal.Settings" = "darkman";
};
};
# Always dark by default
home.activation.forceDarkman = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
${pkgs.darkman}/bin/darkman set dark || true
'';
};
}
|