hyprlock: use mkTraget

This commit is contained in:
awwpotato 2025-05-21 13:40:58 -07:00
parent 26efa4fca0
commit 81cb57a350
No known key found for this signature in database

View file

@ -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})";
};
};
}
)
];
}