This repository has been archived on 2023-08-08. You can view files and clone it, but cannot push or open issues or pull requests.
nil/modules/applications/sway/gammastep.nix

40 lines
872 B
Nix
Raw Normal View History

2022-03-08 04:35:44 +00:00
{ options, config, lib, pkgs, ... }:
let
cfg = config.this.application.gammastep;
sway = config.this.application.sway;
in with lib; {
options = {
2022-03-24 04:00:26 +00:00
this.application.gammastep.enable = mkOption {
default = sway.enable;
type = with types; bool;
2022-03-08 04:35:44 +00:00
};
};
config = mkIf cfg.enable {
home-manager.users.james = {
services.gammastep = {
enable = true;
provider = "geoclue2";
tray = true;
};
};
services.geoclue2.enable = true;
systemd.user.services.gammastep = {
enable = true;
description = "Nightly color shifting";
wantedBy = [ "sway-session.target" ];
partOf = [ "graphical-session.target" ];
serviceConfig = {
ExecStart = ''
${pkgs.gammastep}/bin/gammastep
'';
RestartSec = 5;
Restart = "always";
};
};
};
}