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

with lib;
let
  cfg = config.modules.desktop.gammastep;
in {
  options.modules.desktop.gammastep = {
    enable = mkEnableOption "Enable gammastep, a blue-light filter for Wayland desktop environments";
  };

  config = mkIf cfg.enable {
    hm.wayland.windowManager.hyprland.settings.exec-once = [ "${pkgs.gammastep}/bin/gammastep-indicator" ];
    hm.services.gammastep = {
      enable = true;
      # portland, oregon
      latitude = 45.3112;
      longitude = -122.4055;
      provider = "manual";
    };
  };
}