Nix/HM module: add shadow options (#141)

This commit is contained in:
Jappie3 2024-03-09 01:11:27 +01:00 committed by GitHub
parent 5eaa7c0834
commit cb08f60254
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -14,6 +14,29 @@ self: {
then "true" then "true"
else "false"; else "false";
cfg = config.programs.hyprlock; cfg = config.programs.hyprlock;
shadow = {
shadow_passes = mkOption {
description = "Shadow passes";
type = int;
default = 0;
};
shadow_size = mkOption {
description = "Shadow size";
type = int;
default = 3;
};
shadow_color = mkOption {
description = "Shadow color";
type = str;
default = "rgba(0, 0, 0, 1.0)";
};
shadow_boost = mkOption {
description = "Boost shadow's opacity";
type = float;
default = 1.2;
};
};
in { in {
options.programs.hyprlock = { options.programs.hyprlock = {
enable = enable =
@ -67,7 +90,8 @@ in {
backgrounds = mkOption { backgrounds = mkOption {
description = "Background configurations"; description = "Background configurations";
type = listOf (submodule { type = listOf (submodule {
options = { options =
{
monitor = mkOption { monitor = mkOption {
description = "The monitor to apply the given wallpaper to"; description = "The monitor to apply the given wallpaper to";
type = str; type = str;
@ -127,7 +151,8 @@ in {
type = float; type = float;
default = 0.05; default = 0.05;
}; };
}; }
// shadow;
}); });
default = [ default = [
{} {}
@ -137,7 +162,8 @@ in {
input-fields = mkOption { input-fields = mkOption {
description = "Input field configurations"; description = "Input field configurations";
type = listOf (submodule { type = listOf (submodule {
options = { options =
{
monitor = mkOption { monitor = mkOption {
description = "The monitor to place the input field on"; description = "The monitor to place the input field on";
type = str; type = str;
@ -259,7 +285,8 @@ in {
type = str; type = str;
default = "center"; default = "center";
}; };
}; }
// shadow;
}); });
default = [ default = [
{} {}
@ -269,7 +296,8 @@ in {
labels = mkOption { labels = mkOption {
description = "Label configurations"; description = "Label configurations";
type = listOf (submodule { type = listOf (submodule {
options = { options =
{
monitor = mkOption { monitor = mkOption {
description = "The monitor to display the label on"; description = "The monitor to display the label on";
type = str; type = str;
@ -325,7 +353,8 @@ in {
type = str; type = str;
default = "center"; default = "center";
}; };
}; }
// shadow;
}); });
default = [ default = [
{} {}
@ -356,6 +385,10 @@ in {
brightness = ${toString background.brightness} brightness = ${toString background.brightness}
vibrancy = ${toString background.vibrancy} vibrancy = ${toString background.vibrancy}
vibrancy_darkness = ${toString background.vibrancy_darkness} vibrancy_darkness = ${toString background.vibrancy_darkness}
shadow_passes = ${toString background.shadow_passes}
shadow_size = ${toString background.shadow_size}
shadow_color = ${background.shadow_color}
shadow_boost = ${toString background.shadow_boost}
} }
'') '')
cfg.backgrounds)} cfg.backgrounds)}
@ -377,6 +410,10 @@ in {
placeholder_text = ${input-field.placeholder_text} placeholder_text = ${input-field.placeholder_text}
hide_input = ${boolToString input-field.hide_input} hide_input = ${boolToString input-field.hide_input}
rounding = ${toString input-field.rounding} rounding = ${toString input-field.rounding}
shadow_passes = ${toString input-field.shadow_passes}
shadow_size = ${toString input-field.shadow_size}
shadow_color = ${input-field.shadow_color}
shadow_boost = ${toString input-field.shadow_boost}
position = ${toString input-field.position.x}, ${toString input-field.position.y} position = ${toString input-field.position.x}, ${toString input-field.position.y}
halign = ${input-field.halign} halign = ${input-field.halign}
@ -392,6 +429,10 @@ in {
color = ${label.color} color = ${label.color}
font_size = ${toString label.font_size} font_size = ${toString label.font_size}
font_family = ${label.font_family} font_family = ${label.font_family}
shadow_passes = ${toString label.shadow_passes}
shadow_size = ${toString label.shadow_size}
shadow_color = ${label.shadow_color}
shadow_boost = ${toString label.shadow_boost}
position = ${toString label.position.x}, ${toString label.position.y} position = ${toString label.position.x}, ${toString label.position.y}
halign = ${label.halign} halign = ${label.halign}