diff --git a/modules/applications/sway/default.nix b/modules/applications/sway/default.nix index d07721e..77826c2 100644 --- a/modules/applications/sway/default.nix +++ b/modules/applications/sway/default.nix @@ -1 +1,3 @@ -{ config, pkgs, ... }: { imports = [ ./sway.nix ./mako.nix ./waybar.nix ]; } +{ config, pkgs, ... }: { + imports = [ ./sway.nix ./gammastep.nix ./mako.nix ./waybar.nix ]; +} diff --git a/modules/applications/sway/gammastep.nix b/modules/applications/sway/gammastep.nix new file mode 100644 index 0000000..3c5117b --- /dev/null +++ b/modules/applications/sway/gammastep.nix @@ -0,0 +1,41 @@ +{ options, config, lib, pkgs, ... }: +let + cfg = config.this.application.gammastep; + sway = config.this.application.sway; +in with lib; { + options = { + this.application.gammastep = { + enable = mkOption { + default = sway.enable; + type = with types; bool; + }; + }; + }; + + 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"; + }; + }; + + }; +}