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/gammastep.nix

41 lines
875 B
Nix
Raw Permalink Normal View History

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