diff --git a/modules/hm/services/swaync/default.nix b/modules/hm/services/swaync/default.nix index f96130f..6d512f0 100644 --- a/modules/hm/services/swaync/default.nix +++ b/modules/hm/services/swaync/default.nix @@ -1,33 +1,41 @@ { lib, + lib', osConfig, ... }: let - inherit (builtins) readFile; + styleCfg = osConfig.local.style; in { config = lib.mkIf osConfig.local.modules.hyprland.enable { - services.swaync = { - enable = true; - style = readFile ./style.css; - settings = { - positionX = "right"; - positionY = "top"; - layer = "overlay"; - control-center-layer = "top"; - layer-shell = true; - cssPriority = "application"; - control-center-margin-top = 0; - control-center-margin-bottom = 0; - control-center-margin-right = 0; - control-center-margin-left = 0; - notification-2fa-action = true; - notification-inline-replies = false; - notification-icon-size = 64; - notification-body-image-height = 100; - notification-body-image-width = 200; - }; - }; - # systemd.user.services.swaync.Service.Environment = "WAYLAND_DISPLAY=wayland-1"; + services.swaync = lib.mkMerge [ + { + enable = true; + settings = { + positionX = "right"; + positionY = "top"; + layer = "overlay"; + control-center-layer = "top"; + layer-shell = true; + cssPriority = "application"; + control-center-margin-top = 0; + control-center-margin-bottom = 0; + control-center-margin-right = 0; + control-center-margin-left = 0; + notification-2fa-action = true; + notification-inline-replies = false; + notification-icon-size = 64; + notification-body-image-height = 100; + notification-body-image-width = 200; + }; + } + + (lib.mkIf styleCfg.enable { + style = + lib'.generateGtkColors lib styleCfg.scheme.palette + + builtins.readFile ./style.css; + }) + ]; + systemd.user.services.swaync.Unit.ConditionEnvironment = lib.mkForce ""; }; } diff --git a/modules/nix/style/modules/swaync.nix b/modules/nix/style/modules/swaync.nix deleted file mode 100644 index b4e517c..0000000 --- a/modules/nix/style/modules/swaync.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ - config, - lib, - lib', - ... -}: let - cfg = config.local.style; -in { - config.home-manager.sharedModules = lib.mkIf cfg.enable [ - { - services.swaync.style = lib'.generateGtkColors lib cfg.scheme.palette; - } - ]; -}