nix-config/modules/home/gammastep/default.nix

45 lines
995 B
Nix
Raw Permalink Normal View History

2021-04-05 17:57:05 +02:00
{ config, lib, ... }:
let
cfg = config.my.home.gammastep;
mkTempOption = with lib; description: default: mkOption {
inherit description default;
type = types.int;
example = 1000;
};
mkTimeOption = with lib; description: default: mkOption {
inherit description default;
type = types.str;
example = "12:00-14:00";
};
in
{
options.my.home.gammastep = with lib; {
enable = mkEnableOption "gammastep configuration";
temperature = {
day = mkTempOption "Colour temperature to use during the day" 6500;
night = mkTempOption "Colour temperature to use during the night" 2000;
2021-04-05 17:57:05 +02:00
};
times = {
dawn = mkTimeOption "Dawn time" "6:00-7:30";
2021-10-08 15:03:45 +02:00
dusk = mkTimeOption "Dusk time" "18:30-20:00";
2021-04-05 17:57:05 +02:00
};
};
config.services.gammastep = lib.mkIf cfg.enable {
enable = true;
2021-05-04 22:44:29 +02:00
tray = true;
2021-04-05 17:57:05 +02:00
dawnTime = cfg.times.dawn;
duskTime = cfg.times.dusk;
temperature = {
inherit (cfg.temperature) day night;
};
};
}