From 9c9667e5eff190cf5884df875e5e8166eca1bfcd Mon Sep 17 00:00:00 2001 From: alejandro-angulo Date: Sat, 3 Aug 2024 08:34:19 -0700 Subject: [PATCH] Converted gammastep module to home module --- homes/x86_64-linux/alejandro/default.nix | 3 ++- modules/home/services/gammastep/default.nix | 21 ++++++++++++++++ .../desktop/addons/gammastep/default.nix | 25 ------------------- modules/nixos/desktop/sway/default.nix | 1 - modules/nixos/suites/desktop/default.nix | 10 +++++--- 5 files changed, 30 insertions(+), 30 deletions(-) create mode 100644 modules/home/services/gammastep/default.nix delete mode 100644 modules/nixos/desktop/addons/gammastep/default.nix diff --git a/homes/x86_64-linux/alejandro/default.nix b/homes/x86_64-linux/alejandro/default.nix index 61e2797..e944151 100644 --- a/homes/x86_64-linux/alejandro/default.nix +++ b/homes/x86_64-linux/alejandro/default.nix @@ -7,7 +7,7 @@ namespace, ... }: { - ${namespace} = { + aa = { apps = { bat.enable = true; btop.enable = true; @@ -30,6 +30,7 @@ }; services = { + gammastep.enable = true; playerctld.enable = true; swayidle.enable = true; swaync.enable = true; diff --git a/modules/home/services/gammastep/default.nix b/modules/home/services/gammastep/default.nix new file mode 100644 index 0000000..b7237f1 --- /dev/null +++ b/modules/home/services/gammastep/default.nix @@ -0,0 +1,21 @@ +{ + config, + lib, + namespace, + ... +}: let + inherit (lib) mkIf mkEnableOption; + + cfg = config.${namespace}.services.gammastep; +in { + options.${namespace}.services.gammastep = { + enable = mkEnableOption "gammastep"; + }; + + config = mkIf cfg.enable { + services.gammastep = { + enable = true; + provider = "geoclue2"; + }; + }; +} diff --git a/modules/nixos/desktop/addons/gammastep/default.nix b/modules/nixos/desktop/addons/gammastep/default.nix deleted file mode 100644 index 297113c..0000000 --- a/modules/nixos/desktop/addons/gammastep/default.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ - options, - config, - lib, - pkgs, - ... -}: -with lib; let - cfg = config.aa.desktop.addons.gammastep; -in { - options.aa.desktop.addons.gammastep = with types; { - enable = mkEnableOption "gammastep"; - }; - - config = mkIf cfg.enable { - services.geoclue2.enable = true; - - aa.home.extraOptions = { - services.gammastep = { - enable = true; - provider = "geoclue2"; - }; - }; - }; -} diff --git a/modules/nixos/desktop/sway/default.nix b/modules/nixos/desktop/sway/default.nix index 53c5c04..d1f9132 100644 --- a/modules/nixos/desktop/sway/default.nix +++ b/modules/nixos/desktop/sway/default.nix @@ -37,7 +37,6 @@ in { config = mkIf cfg.enable { aa.desktop.addons = { alacritty.enable = true; - gammastep.enable = true; # TODO # light diff --git a/modules/nixos/suites/desktop/default.nix b/modules/nixos/suites/desktop/default.nix index 4dd7559..9b57f63 100644 --- a/modules/nixos/suites/desktop/default.nix +++ b/modules/nixos/suites/desktop/default.nix @@ -1,23 +1,27 @@ { config, lib, + namespace, ... }: let inherit (lib) mkEnableOption mkIf; - cfg = config.aa.suites.desktop; + cfg = config.${namespace}.suites.desktop; in { - options.aa.suites.desktop = { + options.${namespace}.suites.desktop = { enable = mkEnableOption "common desktop configuration"; }; config = mkIf cfg.enable { - aa = { + ${namespace} = { desktop = { sway.enable = true; }; }; + # Required to use gammastep home module without providing lat/long + services.geoclue2.enable = true; + # The following fixes an issue with using swaylcock as a home module # Workaround for https://github.com/NixOS/nixpkgs/issues/158025 # This comment specifically: https://github.com/NixOS/nixpkgs/issues/158025#issuecomment-1344766809