diff --git a/modules/hyprlock/hm.nix b/modules/hyprlock/hm.nix index 083ce28e..b9d127fb 100644 --- a/modules/hyprlock/hm.nix +++ b/modules/hyprlock/hm.nix @@ -1,26 +1,40 @@ -{ config, lib, ... }: -let - cfg = config.stylix.targets.hyprlock; -in { - options.stylix.targets.hyprlock = with config.lib.stylix; { - enable = mkEnableTarget "Hyprlock" true; - useWallpaper = mkEnableWallpaper "Hyprlock" true; + mkTarget, + config, + lib, + ... +}: +mkTarget { + name = "hyprlock"; + humanName = "Hyprlock"; + + extraOptions = { + useWallpaper = config.lib.stylix.mkEnableWallpaper "Hyprlock" true; }; - config = lib.mkIf (config.stylix.enable && cfg.enable) { - programs.hyprlock.settings = with config.lib.stylix.colors; { - background = { - color = "rgb(${base00})"; - path = lib.mkIf cfg.useWallpaper "${config.stylix.image}"; - }; - input-field = { - outer_color = "rgb(${base03})"; - inner_color = "rgb(${base00})"; - font_color = "rgb(${base05})"; - fail_color = "rgb(${base08})"; - check_color = "rgb(${base0A})"; - }; - }; - }; + configElements = [ + ( + { cfg, image }: + { + programs.hyprlock.settings.path = lib.mkIf cfg.useWallpaper "${image}"; + } + ) + ( + { colors }: + { + programs.hyprlock.settings = with colors; { + background = { + color = "rgb(${base00})"; + }; + input-field = { + outer_color = "rgb(${base03})"; + inner_color = "rgb(${base00})"; + font_color = "rgb(${base05})"; + fail_color = "rgb(${base08})"; + check_color = "rgb(${base0A})"; + }; + }; + } + ) + ]; }