From 15ad9f4cecad701d39f40c344b1270b36f589c07 Mon Sep 17 00:00:00 2001 From: Aly Raffauf Date: Fri, 2 Aug 2024 14:59:22 -0400 Subject: [PATCH] home: run gammastep as service for redShift" --- homeManagerModules/desktop/hyprland/settings.nix | 2 -- homeManagerModules/desktop/sway/settings.nix | 2 -- homeManagerModules/options.nix | 2 ++ homeManagerModules/services/default.nix | 1 + .../services/gammastep/default.nix | 16 ++++++++++++++++ 5 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 homeManagerModules/services/gammastep/default.nix diff --git a/homeManagerModules/desktop/hyprland/settings.nix b/homeManagerModules/desktop/hyprland/settings.nix index 0457d2c7..7076e268 100644 --- a/homeManagerModules/desktop/hyprland/settings.nix +++ b/homeManagerModules/desktop/hyprland/settings.nix @@ -130,8 +130,6 @@ in { (lib.getExe pkgs.waybar) (lib.getExe pkgs.wayland-pipewire-idle-inhibit) ] - ++ lib.lists.optional (cfg.desktop.redShift) - "${lib.getExe pkgs.gammastep} -l 33.74:-84.38" ++ lib.lists.optional (cfg.desktop.randomWallpaper) helpers.wallpaperD ++ lib.lists.optional (!cfg.desktop.randomWallpaper) diff --git a/homeManagerModules/desktop/sway/settings.nix b/homeManagerModules/desktop/sway/settings.nix index 7b20c661..67a1e10f 100644 --- a/homeManagerModules/desktop/sway/settings.nix +++ b/homeManagerModules/desktop/sway/settings.nix @@ -162,8 +162,6 @@ in { {command = lib.getExe pkgs.mako;} {command = lib.getExe pkgs.wayland-pipewire-idle-inhibit;} ] - ++ lib.optional cfg.desktop.redShift - {command = "${lib.getExe pkgs.gammastep} -l 33.74:-84.38";} ++ lib.optional cfg.desktop.randomWallpaper {command = "${helpers.wallpaperD}";} ++ lib.optional (!cfg.desktop.randomWallpaper) {command = "${lib.getExe pkgs.swaybg} -i ${cfg.theme.wallpaper}";}; diff --git a/homeManagerModules/options.nix b/homeManagerModules/options.nix index e3f6f188..a55a4d2d 100644 --- a/homeManagerModules/options.nix +++ b/homeManagerModules/options.nix @@ -205,6 +205,8 @@ in { type = lib.types.str; }; }; + + gammastep.enable = lib.mkEnableOption "Gammastep redshift daemon."; easyeffects = { enable = lib.mkEnableOption "EasyEffects user service."; diff --git a/homeManagerModules/services/default.nix b/homeManagerModules/services/default.nix index 2fd584ce..cd6882b7 100644 --- a/homeManagerModules/services/default.nix +++ b/homeManagerModules/services/default.nix @@ -1,6 +1,7 @@ { imports = [ ./easyeffects + ./gammastep ./mpd ./swayidle ]; diff --git a/homeManagerModules/services/gammastep/default.nix b/homeManagerModules/services/gammastep/default.nix new file mode 100644 index 00000000..e5aa63ea --- /dev/null +++ b/homeManagerModules/services/gammastep/default.nix @@ -0,0 +1,16 @@ +{ + config, + lib, + pkgs, + ... +}: let + cfg = config.ar.home; +in { + config = lib.mkIf (cfg.services.gammastep.enable || cfg.desktop.redShift) { + services.gammastep = { + enable = true; + latitude = lib.mkDefault "33.74"; + longitude = lib.mkDefault "-84.38"; + }; + }; +}