2024-02-19 00:50:56 +01:00
|
|
|
self: {
|
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}: let
|
|
|
|
inherit (builtins) toString;
|
2024-03-25 22:16:05 +01:00
|
|
|
inherit (lib.types) bool float int listOf lines nullOr package str submodule;
|
2024-02-19 00:50:56 +01:00
|
|
|
inherit (lib.modules) mkIf;
|
|
|
|
inherit (lib.options) mkOption mkEnableOption;
|
|
|
|
|
2024-03-02 21:12:59 +01:00
|
|
|
boolToString = x:
|
|
|
|
if x
|
|
|
|
then "true"
|
|
|
|
else "false";
|
2024-02-20 16:36:47 +01:00
|
|
|
cfg = config.programs.hyprlock;
|
2024-03-09 01:11:27 +01:00
|
|
|
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
};
|
2024-02-19 00:50:56 +01:00
|
|
|
in {
|
2024-02-20 13:59:06 +01:00
|
|
|
options.programs.hyprlock = {
|
2024-03-02 21:12:59 +01:00
|
|
|
enable =
|
|
|
|
mkEnableOption ""
|
|
|
|
// {
|
|
|
|
description = ''
|
|
|
|
Whether to enable Hyprlock, Hyprland's GPU-accelerated lock screen utility.
|
|
|
|
|
|
|
|
Note that PAM must be configured to enable hyprlock to perform
|
|
|
|
authentication. The package installed through home-manager
|
|
|
|
will *not* be able to unlock the session without this
|
|
|
|
configuration.
|
|
|
|
|
|
|
|
On NixOS, it can be enabled using:
|
|
|
|
|
|
|
|
```nix
|
|
|
|
security.pam.services.hyprlock = {};
|
|
|
|
```
|
|
|
|
'';
|
|
|
|
};
|
2024-02-19 00:50:56 +01:00
|
|
|
|
|
|
|
package = mkOption {
|
|
|
|
description = "The hyprlock package";
|
|
|
|
type = package;
|
|
|
|
default = self.packages.${pkgs.stdenv.hostPlatform.system}.hyprlock;
|
|
|
|
};
|
|
|
|
|
2024-03-25 22:16:05 +01:00
|
|
|
extraConfig = mkOption {
|
|
|
|
description = "Extra configuration lines, written verbatim";
|
|
|
|
type = nullOr lines;
|
|
|
|
default = null;
|
|
|
|
};
|
|
|
|
|
|
|
|
sources = mkOption {
|
|
|
|
description = "List of files to `source`";
|
|
|
|
type = listOf str;
|
|
|
|
default = [];
|
|
|
|
};
|
|
|
|
|
2024-02-21 12:30:24 +01:00
|
|
|
general = {
|
|
|
|
disable_loading_bar = mkOption {
|
|
|
|
description = "Whether to disable loading bar";
|
|
|
|
type = bool;
|
|
|
|
default = false;
|
|
|
|
};
|
2024-02-21 19:28:50 +01:00
|
|
|
grace = mkOption {
|
|
|
|
description = "Seconds to wait for user input before locking";
|
|
|
|
type = int;
|
|
|
|
default = 0;
|
|
|
|
};
|
2024-02-21 12:30:24 +01:00
|
|
|
hide_cursor = mkOption {
|
|
|
|
description = "Hides the cursor instead of making it visible";
|
|
|
|
type = bool;
|
|
|
|
default = true;
|
2024-02-21 19:12:09 +01:00
|
|
|
};
|
2024-02-22 03:33:46 +01:00
|
|
|
no_fade_in = mkOption {
|
|
|
|
description = "Do not fade in";
|
|
|
|
type = bool;
|
|
|
|
default = false;
|
|
|
|
};
|
2024-03-14 14:23:41 +01:00
|
|
|
no_fade_out = mkOption {
|
|
|
|
description = "Do not fade out";
|
|
|
|
type = bool;
|
|
|
|
default = false;
|
|
|
|
};
|
2024-03-26 21:34:20 +01:00
|
|
|
ignore_empty_input = mkOption {
|
|
|
|
description = "Skips validation when an empty password is provided";
|
|
|
|
type = bool;
|
|
|
|
default = false;
|
|
|
|
};
|
2024-02-21 12:30:24 +01:00
|
|
|
};
|
|
|
|
|
2024-02-19 00:50:56 +01:00
|
|
|
backgrounds = mkOption {
|
2024-02-21 12:30:24 +01:00
|
|
|
description = "Background configurations";
|
2024-02-19 00:50:56 +01:00
|
|
|
type = listOf (submodule {
|
2024-03-13 02:10:42 +01:00
|
|
|
options = {
|
|
|
|
monitor = mkOption {
|
|
|
|
description = "The monitor to apply the given wallpaper to";
|
|
|
|
type = str;
|
|
|
|
default = "";
|
|
|
|
};
|
2024-03-09 01:11:27 +01:00
|
|
|
|
2024-03-13 02:10:42 +01:00
|
|
|
path = mkOption {
|
|
|
|
description = "The path to the wallpaper";
|
|
|
|
type = str;
|
|
|
|
default = "echo '/home/me/someImage.png'"; # only png supported for now
|
|
|
|
};
|
2024-03-09 01:11:27 +01:00
|
|
|
|
2024-03-13 02:10:42 +01:00
|
|
|
color = mkOption {
|
|
|
|
description = "Background color";
|
|
|
|
type = str;
|
|
|
|
default = "rgba(25, 20, 20, 1.0)";
|
|
|
|
};
|
2024-03-09 01:11:27 +01:00
|
|
|
|
2024-03-13 02:10:42 +01:00
|
|
|
blur_size = mkOption {
|
|
|
|
description = "Blur size";
|
|
|
|
type = int;
|
|
|
|
default = 8;
|
|
|
|
};
|
2024-03-09 01:11:27 +01:00
|
|
|
|
2024-03-13 02:10:42 +01:00
|
|
|
blur_passes = mkOption {
|
|
|
|
description = "Blur passes";
|
|
|
|
type = int;
|
|
|
|
default = 0;
|
|
|
|
};
|
2024-03-09 01:11:27 +01:00
|
|
|
|
2024-03-13 02:10:42 +01:00
|
|
|
noise = mkOption {
|
|
|
|
description = "Noise applied to blur";
|
|
|
|
type = float;
|
|
|
|
default = 0.0117;
|
|
|
|
};
|
2024-03-09 01:11:27 +01:00
|
|
|
|
2024-03-13 02:10:42 +01:00
|
|
|
contrast = mkOption {
|
|
|
|
description = "Contrast applied to blur";
|
|
|
|
type = float;
|
|
|
|
default = 0.8917;
|
|
|
|
};
|
2024-03-09 01:11:27 +01:00
|
|
|
|
2024-03-13 02:10:42 +01:00
|
|
|
brightness = mkOption {
|
|
|
|
description = "Brightness applied to blur";
|
|
|
|
type = float;
|
|
|
|
default = 0.8172;
|
|
|
|
};
|
2024-03-09 01:11:27 +01:00
|
|
|
|
2024-03-13 02:10:42 +01:00
|
|
|
vibrancy = mkOption {
|
|
|
|
description = "Vibrancy applied to blur";
|
|
|
|
type = float;
|
|
|
|
default = 0.1686;
|
|
|
|
};
|
2024-03-09 01:11:27 +01:00
|
|
|
|
2024-03-13 02:10:42 +01:00
|
|
|
vibrancy_darkness = mkOption {
|
|
|
|
description = "Vibrancy darkness applied to blur";
|
|
|
|
type = float;
|
|
|
|
default = 0.05;
|
2024-03-10 12:57:02 +01:00
|
|
|
};
|
2024-03-13 02:10:42 +01:00
|
|
|
};
|
2024-02-19 00:50:56 +01:00
|
|
|
});
|
2024-02-21 12:30:24 +01:00
|
|
|
default = [
|
2024-03-02 21:12:59 +01:00
|
|
|
{}
|
2024-02-21 12:30:24 +01:00
|
|
|
];
|
2024-02-19 00:50:56 +01:00
|
|
|
};
|
|
|
|
|
2024-04-10 18:24:17 +02:00
|
|
|
shapes = mkOption {
|
|
|
|
description = "Shape configurations";
|
|
|
|
type = listOf (submodule {
|
|
|
|
options = {
|
|
|
|
monitor = mkOption {
|
|
|
|
description = "The monitor to draw a shape";
|
|
|
|
type = str;
|
|
|
|
default = "";
|
|
|
|
};
|
|
|
|
|
|
|
|
size = {
|
|
|
|
x = mkOption {
|
|
|
|
description = "Width of the shape";
|
|
|
|
type = int;
|
|
|
|
default = 360;
|
|
|
|
};
|
|
|
|
y = mkOption {
|
|
|
|
description = "Height of the shape";
|
|
|
|
type = int;
|
|
|
|
default = 60;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
color = mkOption {
|
|
|
|
description = "Color of the shape";
|
|
|
|
type = str;
|
|
|
|
default = "rgba(22, 17, 17, 1.0)";
|
|
|
|
};
|
|
|
|
|
|
|
|
rounding = mkOption {
|
|
|
|
description = "Rounding of the shape";
|
|
|
|
type = int;
|
|
|
|
default = -1;
|
|
|
|
};
|
|
|
|
|
|
|
|
border_size = mkOption {
|
|
|
|
description = "Size of shape border";
|
|
|
|
type = int;
|
|
|
|
default = 4;
|
|
|
|
};
|
|
|
|
|
|
|
|
border_color = mkOption {
|
|
|
|
description = "Color of shape border";
|
|
|
|
type = str;
|
|
|
|
default = "rgba(0, 207, 230, 1.0)";
|
|
|
|
};
|
|
|
|
|
|
|
|
rotate = mkOption {
|
|
|
|
description = "Shape rotation angle";
|
|
|
|
type = float;
|
|
|
|
default = 0.0;
|
|
|
|
};
|
|
|
|
|
|
|
|
xray = mkOption {
|
|
|
|
description = "Whether to make a transparent \"hole\" in the background";
|
|
|
|
type = bool;
|
|
|
|
default = false;
|
|
|
|
};
|
|
|
|
|
|
|
|
position = {
|
|
|
|
x = mkOption {
|
|
|
|
description = "X position of the shape";
|
|
|
|
type = int;
|
|
|
|
default = 0;
|
|
|
|
};
|
|
|
|
y = mkOption {
|
|
|
|
description = "Y position of the shape";
|
|
|
|
type = int;
|
|
|
|
default = 80;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
halign = mkOption {
|
|
|
|
description = "Horizontal alignment of the shape";
|
|
|
|
type = str;
|
|
|
|
default = "center";
|
|
|
|
};
|
|
|
|
|
|
|
|
valign = mkOption {
|
|
|
|
description = "Vertical alignment of the shape";
|
|
|
|
type = str;
|
|
|
|
default = "center";
|
|
|
|
};
|
|
|
|
}
|
|
|
|
// shadow;
|
|
|
|
});
|
|
|
|
default = [];
|
|
|
|
};
|
|
|
|
|
2024-03-16 15:44:44 +01:00
|
|
|
images = mkOption {
|
|
|
|
description = "Image configurations";
|
|
|
|
type = listOf (submodule {
|
|
|
|
options = {
|
|
|
|
monitor = mkOption {
|
|
|
|
description = "The monitor to draw an image";
|
|
|
|
type = str;
|
|
|
|
default = "";
|
|
|
|
};
|
|
|
|
|
|
|
|
path = mkOption {
|
|
|
|
description = "The path to source image";
|
|
|
|
type = str;
|
|
|
|
default = "/home/me/cutie.png"; # only png supported for now
|
|
|
|
};
|
|
|
|
|
|
|
|
size = mkOption {
|
|
|
|
description = "Size of the image. Lesser side is chosen if not 1:1 aspect ratio";
|
|
|
|
type = int;
|
|
|
|
default = 150;
|
|
|
|
};
|
|
|
|
|
|
|
|
rounding = mkOption {
|
|
|
|
description = "The rounding of the image";
|
|
|
|
type = int;
|
|
|
|
default = -1;
|
|
|
|
};
|
|
|
|
|
|
|
|
border_size = mkOption {
|
|
|
|
description = "Size of image border";
|
|
|
|
type = int;
|
|
|
|
default = 4;
|
|
|
|
};
|
|
|
|
|
|
|
|
border_color = mkOption {
|
|
|
|
description = "Color of image border";
|
|
|
|
type = str;
|
|
|
|
default = "rgb(221, 221, 221)";
|
|
|
|
};
|
|
|
|
|
2024-03-29 20:01:11 +01:00
|
|
|
rotate = mkOption {
|
|
|
|
description = "Image rotation angle";
|
|
|
|
type = float;
|
2024-03-29 20:21:18 +01:00
|
|
|
default = 0.0;
|
2024-03-29 20:01:11 +01:00
|
|
|
};
|
|
|
|
|
2024-04-07 19:09:25 +02:00
|
|
|
reload_time = mkOption {
|
|
|
|
description = "Interval in seconds between reloading the image";
|
|
|
|
type = int;
|
|
|
|
default = -1;
|
|
|
|
};
|
|
|
|
|
|
|
|
reload_cmd = mkOption {
|
|
|
|
description = "Command to obtain new path";
|
|
|
|
type = str;
|
|
|
|
default = "";
|
|
|
|
};
|
|
|
|
|
2024-03-16 15:44:44 +01:00
|
|
|
position = {
|
|
|
|
x = mkOption {
|
|
|
|
description = "X position of the image";
|
|
|
|
type = int;
|
|
|
|
default = 0;
|
|
|
|
};
|
|
|
|
y = mkOption {
|
|
|
|
description = "Y position of the image";
|
|
|
|
type = int;
|
|
|
|
default = 200;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
halign = mkOption {
|
|
|
|
description = "Horizontal alignment of the image";
|
|
|
|
type = str;
|
|
|
|
default = "center";
|
|
|
|
};
|
|
|
|
|
|
|
|
valign = mkOption {
|
|
|
|
description = "Vertical alignment of the image";
|
|
|
|
type = str;
|
|
|
|
default = "center";
|
|
|
|
};
|
2024-03-31 06:52:00 +02:00
|
|
|
}
|
|
|
|
// shadow;
|
2024-03-16 15:44:44 +01:00
|
|
|
});
|
2024-03-22 08:36:38 +01:00
|
|
|
default = [];
|
2024-03-16 15:44:44 +01:00
|
|
|
};
|
|
|
|
|
2024-02-21 12:30:24 +01:00
|
|
|
input-fields = mkOption {
|
|
|
|
description = "Input field configurations";
|
|
|
|
type = listOf (submodule {
|
2024-03-09 01:11:27 +01:00
|
|
|
options =
|
|
|
|
{
|
|
|
|
monitor = mkOption {
|
|
|
|
description = "The monitor to place the input field on";
|
|
|
|
type = str;
|
|
|
|
default = "";
|
|
|
|
};
|
|
|
|
|
|
|
|
size = {
|
|
|
|
width = mkOption {
|
|
|
|
description = "Width of the input field";
|
|
|
|
type = int;
|
|
|
|
default = 200;
|
|
|
|
};
|
|
|
|
height = mkOption {
|
|
|
|
description = "Height of the input field";
|
|
|
|
type = int;
|
|
|
|
default = 50;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
outline_thickness = mkOption {
|
|
|
|
description = "The outline thickness of the input field";
|
2024-02-21 12:30:24 +01:00
|
|
|
type = int;
|
2024-03-09 01:11:27 +01:00
|
|
|
default = 3;
|
|
|
|
};
|
|
|
|
|
|
|
|
dots_size = mkOption {
|
|
|
|
description = "The size of the dots in the input field (scale of input-field height, 0.2 - 0.8)";
|
|
|
|
type = float;
|
|
|
|
default = 0.33;
|
2024-02-21 12:30:24 +01:00
|
|
|
};
|
2024-03-09 01:11:27 +01:00
|
|
|
|
|
|
|
dots_spacing = mkOption {
|
|
|
|
description = "The spacing between the dots in the input field (scale of dot's absolute size, 0.0 - 1.0)";
|
|
|
|
type = float;
|
|
|
|
default = 0.15;
|
|
|
|
};
|
|
|
|
|
|
|
|
dots_center = mkOption {
|
|
|
|
description = "Center position of the dots in the input field";
|
|
|
|
type = bool;
|
|
|
|
default = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
dots_rounding = mkOption {
|
|
|
|
description = "The rounding of dots (-2 follows input-field rounding)";
|
2024-02-21 12:30:24 +01:00
|
|
|
type = int;
|
2024-03-09 01:11:27 +01:00
|
|
|
default = -1;
|
|
|
|
};
|
|
|
|
|
|
|
|
outer_color = mkOption {
|
|
|
|
description = "The outer color of the input field";
|
|
|
|
type = str;
|
|
|
|
default = "rgb(151515)";
|
|
|
|
};
|
|
|
|
|
|
|
|
inner_color = mkOption {
|
|
|
|
description = "The inner color of the input field";
|
|
|
|
type = str;
|
|
|
|
default = "rgb(200, 200, 200)";
|
|
|
|
};
|
|
|
|
|
|
|
|
font_color = mkOption {
|
|
|
|
description = "The font color of the input field";
|
|
|
|
type = str;
|
|
|
|
default = "rgb(10, 10, 10)";
|
|
|
|
};
|
|
|
|
|
|
|
|
fade_on_empty = mkOption {
|
|
|
|
description = "Fade input field when empty";
|
|
|
|
type = bool;
|
|
|
|
default = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
fade_timeout = mkOption {
|
|
|
|
description = "Milliseconds before the input field should be faded (0 to fade immediately)";
|
2024-02-21 12:30:24 +01:00
|
|
|
type = int;
|
2024-04-11 20:57:46 +02:00
|
|
|
default = 2000;
|
2024-03-09 01:11:27 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
placeholder_text = mkOption {
|
|
|
|
description = "The placeholder text of the input field";
|
|
|
|
type = str;
|
|
|
|
default = "<i>Input Password...</i>";
|
|
|
|
};
|
|
|
|
|
|
|
|
hide_input = mkOption {
|
|
|
|
description = "Hide input typed into the input field";
|
|
|
|
type = bool;
|
|
|
|
default = false;
|
2024-02-21 12:30:24 +01:00
|
|
|
};
|
2024-03-09 01:11:27 +01:00
|
|
|
|
|
|
|
rounding = mkOption {
|
|
|
|
description = "The rounding of the input field";
|
2024-02-21 12:30:24 +01:00
|
|
|
type = int;
|
2024-03-09 01:11:27 +01:00
|
|
|
default = -1;
|
|
|
|
};
|
|
|
|
|
2024-03-11 16:17:14 +01:00
|
|
|
check_color = mkOption {
|
|
|
|
description = "The outer color of the input field while checking password";
|
|
|
|
type = str;
|
|
|
|
default = "rgb(204, 136, 34)";
|
|
|
|
};
|
|
|
|
|
2024-03-09 17:44:58 +01:00
|
|
|
fail_color = mkOption {
|
|
|
|
description = "If authentication failed, changes outer color and fail message color";
|
|
|
|
type = str;
|
|
|
|
default = "rgb(204, 34, 34)";
|
|
|
|
};
|
|
|
|
|
|
|
|
fail_text = mkOption {
|
|
|
|
description = "The text shown if authentication failed. $FAIL (reason) and $ATTEMPTS variables are available";
|
|
|
|
type = str;
|
|
|
|
default = "<i>$FAIL</i>";
|
|
|
|
};
|
|
|
|
|
|
|
|
fail_transition = mkOption {
|
|
|
|
description = "The transition time (ms) between normal outer color and fail color";
|
|
|
|
type = int;
|
|
|
|
default = 300;
|
|
|
|
};
|
|
|
|
|
2024-03-09 01:11:27 +01:00
|
|
|
position = {
|
|
|
|
x = mkOption {
|
|
|
|
description = "X position of the label";
|
|
|
|
type = int;
|
|
|
|
default = 0;
|
|
|
|
};
|
|
|
|
y = mkOption {
|
|
|
|
description = "Y position of the label";
|
|
|
|
type = int;
|
|
|
|
default = -20;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
halign = mkOption {
|
|
|
|
description = "Horizontal alignment of the label";
|
|
|
|
type = str;
|
|
|
|
default = "center";
|
|
|
|
};
|
|
|
|
|
|
|
|
valign = mkOption {
|
|
|
|
description = "Vertical alignment of the label";
|
|
|
|
type = str;
|
|
|
|
default = "center";
|
|
|
|
};
|
2024-03-13 02:10:42 +01:00
|
|
|
|
|
|
|
capslock_color = mkOption {
|
|
|
|
description = "Color of the input field when Caps Lock is active";
|
|
|
|
type = str;
|
|
|
|
default = "-1";
|
|
|
|
};
|
|
|
|
|
|
|
|
numlock_color = mkOption {
|
|
|
|
description = "Color of the input field when NumLock is active";
|
|
|
|
type = str;
|
|
|
|
default = "-1";
|
|
|
|
};
|
|
|
|
|
|
|
|
bothlock_color = mkOption {
|
|
|
|
description = "Color of the input field when both Caps Lock and NumLock are active";
|
|
|
|
type = str;
|
|
|
|
default = "-1";
|
|
|
|
};
|
|
|
|
|
|
|
|
invert_numlock = mkOption {
|
|
|
|
description = "Whether to change the color when NumLock is not active";
|
|
|
|
type = bool;
|
|
|
|
default = false;
|
|
|
|
};
|
2024-03-19 03:46:52 +01:00
|
|
|
|
|
|
|
swap_font_color = mkOption {
|
|
|
|
description = "Whether to swap font color with inner color on some events";
|
|
|
|
type = bool;
|
|
|
|
default = false;
|
|
|
|
};
|
2024-03-09 01:11:27 +01:00
|
|
|
}
|
|
|
|
// shadow;
|
2024-02-21 12:30:24 +01:00
|
|
|
});
|
|
|
|
default = [
|
2024-03-02 21:12:59 +01:00
|
|
|
{}
|
2024-02-21 12:30:24 +01:00
|
|
|
];
|
|
|
|
};
|
2024-02-20 06:21:38 +01:00
|
|
|
|
2024-02-21 12:30:24 +01:00
|
|
|
labels = mkOption {
|
|
|
|
description = "Label configurations";
|
|
|
|
type = listOf (submodule {
|
2024-03-09 01:11:27 +01:00
|
|
|
options =
|
|
|
|
{
|
|
|
|
monitor = mkOption {
|
|
|
|
description = "The monitor to display the label on";
|
|
|
|
type = str;
|
|
|
|
default = "";
|
|
|
|
};
|
|
|
|
|
|
|
|
text = mkOption {
|
|
|
|
description = "Text to display in label";
|
|
|
|
type = str;
|
|
|
|
default = "Hi there, $USER";
|
|
|
|
};
|
|
|
|
|
|
|
|
color = mkOption {
|
|
|
|
description = "Color of the label";
|
|
|
|
type = str;
|
|
|
|
default = "rgba(200, 200, 200, 1.0)";
|
2024-02-21 12:30:24 +01:00
|
|
|
};
|
|
|
|
|
2024-03-09 01:11:27 +01:00
|
|
|
font_size = mkOption {
|
|
|
|
description = "Font size of the label";
|
2024-02-21 12:30:24 +01:00
|
|
|
type = int;
|
2024-03-09 01:11:27 +01:00
|
|
|
default = 25;
|
|
|
|
};
|
|
|
|
|
|
|
|
font_family = mkOption {
|
|
|
|
description = "Font family of the label";
|
|
|
|
type = str;
|
|
|
|
default = "Noto Sans";
|
|
|
|
};
|
|
|
|
|
2024-03-29 20:01:11 +01:00
|
|
|
rotate = mkOption {
|
|
|
|
description = "Label rotation angle";
|
|
|
|
type = float;
|
2024-03-29 20:21:18 +01:00
|
|
|
default = 0.0;
|
2024-03-29 20:01:11 +01:00
|
|
|
};
|
|
|
|
|
2024-03-09 01:11:27 +01:00
|
|
|
position = {
|
|
|
|
x = mkOption {
|
|
|
|
description = "X position of the label";
|
|
|
|
type = int;
|
|
|
|
default = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
y = mkOption {
|
|
|
|
description = "Y position of the label";
|
|
|
|
type = int;
|
|
|
|
default = 80;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
halign = mkOption {
|
|
|
|
description = "Horizontal alignment of the label";
|
|
|
|
type = str;
|
|
|
|
default = "center";
|
|
|
|
};
|
|
|
|
|
|
|
|
valign = mkOption {
|
|
|
|
description = "Vertical alignment of the label";
|
|
|
|
type = str;
|
|
|
|
default = "center";
|
|
|
|
};
|
|
|
|
}
|
|
|
|
// shadow;
|
2024-02-21 12:30:24 +01:00
|
|
|
});
|
2024-03-22 08:36:38 +01:00
|
|
|
default = [];
|
2024-02-19 00:50:56 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
2024-03-02 21:12:59 +01:00
|
|
|
home.packages = [cfg.package];
|
2024-02-20 16:54:32 +01:00
|
|
|
|
2024-02-19 00:50:56 +01:00
|
|
|
xdg.configFile."hypr/hyprlock.conf".text = ''
|
2024-03-25 22:16:05 +01:00
|
|
|
${builtins.concatStringsSep "\n" (map (source: ''
|
|
|
|
source = ${source}
|
|
|
|
'') cfg.sources)}
|
|
|
|
|
2024-02-19 00:50:56 +01:00
|
|
|
general {
|
2024-02-20 18:40:04 +01:00
|
|
|
disable_loading_bar = ${boolToString cfg.general.disable_loading_bar}
|
2024-02-21 19:28:50 +01:00
|
|
|
grace = ${toString cfg.general.grace}
|
2024-02-20 18:40:04 +01:00
|
|
|
hide_cursor = ${boolToString cfg.general.hide_cursor}
|
2024-02-22 03:33:46 +01:00
|
|
|
no_fade_in = ${boolToString cfg.general.no_fade_in}
|
2024-03-14 14:23:41 +01:00
|
|
|
no_fade_out = ${boolToString cfg.general.no_fade_out}
|
2024-03-26 21:34:20 +01:00
|
|
|
ignore_empty_input = ${boolToString cfg.general.ignore_empty_input}
|
2024-02-19 00:50:56 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
${builtins.concatStringsSep "\n" (map (background: ''
|
|
|
|
background {
|
|
|
|
monitor = ${background.monitor}
|
|
|
|
path = ${background.path}
|
2024-02-20 17:03:06 +01:00
|
|
|
color = ${background.color}
|
2024-02-22 03:33:46 +01:00
|
|
|
blur_size = ${toString background.blur_size}
|
|
|
|
blur_passes = ${toString background.blur_passes}
|
|
|
|
noise = ${toString background.noise}
|
|
|
|
contrast = ${toString background.contrast}
|
|
|
|
brightness = ${toString background.brightness}
|
|
|
|
vibrancy = ${toString background.vibrancy}
|
|
|
|
vibrancy_darkness = ${toString background.vibrancy_darkness}
|
2024-02-19 00:50:56 +01:00
|
|
|
}
|
|
|
|
'')
|
|
|
|
cfg.backgrounds)}
|
2024-02-21 12:30:24 +01:00
|
|
|
|
2024-04-10 18:24:17 +02:00
|
|
|
${builtins.concatStringsSep "\n" (map (shape: ''
|
|
|
|
shape {
|
|
|
|
monitor = ${shape.monitor}
|
|
|
|
size = ${toString shape.size.x}, ${toString shape.size.y}
|
|
|
|
color = ${shape.color}
|
|
|
|
rounding = ${toString shape.rounding}
|
|
|
|
border_size = ${toString shape.border_size}
|
|
|
|
border_color = ${shape.border_color}
|
|
|
|
rotate = ${toString shape.rotate}
|
|
|
|
xray = ${boolToString shape.xray}
|
|
|
|
|
|
|
|
position = ${toString shape.position.x}, ${toString shape.position.y}
|
|
|
|
halign = ${shape.halign}
|
|
|
|
valign = ${shape.valign}
|
|
|
|
}
|
|
|
|
'')
|
|
|
|
cfg.shapes)}
|
|
|
|
|
2024-03-16 15:44:44 +01:00
|
|
|
${builtins.concatStringsSep "\n" (map (image: ''
|
|
|
|
image {
|
|
|
|
monitor = ${image.monitor}
|
|
|
|
path = ${image.path}
|
|
|
|
size = ${toString image.size}
|
|
|
|
rounding = ${toString image.rounding}
|
|
|
|
border_size = ${toString image.border_size}
|
|
|
|
border_color = ${image.border_color}
|
2024-03-29 20:01:11 +01:00
|
|
|
rotate = ${toString image.rotate}
|
2024-04-07 19:09:25 +02:00
|
|
|
reload_time = ${toString image.reload_time}
|
|
|
|
reload_cmd = ${image.reload_cmd}
|
2024-03-16 15:44:44 +01:00
|
|
|
|
|
|
|
position = ${toString image.position.x}, ${toString image.position.y}
|
|
|
|
halign = ${image.halign}
|
|
|
|
valign = ${image.valign}
|
|
|
|
}
|
|
|
|
'')
|
|
|
|
cfg.images)}
|
|
|
|
|
2024-02-21 12:30:24 +01:00
|
|
|
${builtins.concatStringsSep "\n" (map (input-field: ''
|
|
|
|
input-field {
|
|
|
|
monitor = ${input-field.monitor}
|
|
|
|
size = ${toString input-field.size.width}, ${toString input-field.size.height}
|
|
|
|
outline_thickness = ${toString input-field.outline_thickness}
|
|
|
|
dots_size = ${toString input-field.dots_size}
|
|
|
|
dots_spacing = ${toString input-field.dots_spacing}
|
2024-02-21 19:12:09 +01:00
|
|
|
dots_center = ${boolToString input-field.dots_center}
|
2024-03-05 17:50:21 +01:00
|
|
|
dots_rounding = ${toString input-field.dots_rounding}
|
2024-02-21 12:30:24 +01:00
|
|
|
outer_color = ${input-field.outer_color}
|
|
|
|
inner_color = ${input-field.inner_color}
|
|
|
|
font_color = ${input-field.font_color}
|
|
|
|
fade_on_empty = ${boolToString input-field.fade_on_empty}
|
2024-03-06 22:12:49 +01:00
|
|
|
fade_timeout = ${toString input-field.fade_timeout}
|
2024-02-21 12:30:24 +01:00
|
|
|
placeholder_text = ${input-field.placeholder_text}
|
|
|
|
hide_input = ${boolToString input-field.hide_input}
|
2024-03-05 17:50:21 +01:00
|
|
|
rounding = ${toString input-field.rounding}
|
2024-03-09 01:11:27 +01:00
|
|
|
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}
|
2024-03-11 16:17:14 +01:00
|
|
|
check_color = ${input-field.check_color}
|
2024-03-09 17:44:58 +01:00
|
|
|
fail_color = ${input-field.fail_color}
|
|
|
|
fail_text = ${input-field.fail_text}
|
|
|
|
fail_transition = ${toString input-field.fail_transition}
|
2024-03-13 02:10:42 +01:00
|
|
|
capslock_color = ${input-field.capslock_color}
|
|
|
|
numlock_color = ${input-field.numlock_color}
|
|
|
|
bothlock_color = ${input-field.bothlock_color}
|
|
|
|
invert_numlock = ${boolToString input-field.invert_numlock}
|
2024-03-19 03:46:52 +01:00
|
|
|
swap_font_color = ${boolToString input-field.swap_font_color}
|
2024-02-21 12:30:24 +01:00
|
|
|
|
|
|
|
position = ${toString input-field.position.x}, ${toString input-field.position.y}
|
|
|
|
halign = ${input-field.halign}
|
|
|
|
valign = ${input-field.valign}
|
|
|
|
}
|
|
|
|
'')
|
|
|
|
cfg.input-fields)}
|
|
|
|
|
|
|
|
${builtins.concatStringsSep "\n" (map (label: ''
|
|
|
|
label {
|
|
|
|
monitor = ${label.monitor}
|
|
|
|
text = ${label.text}
|
|
|
|
color = ${label.color}
|
|
|
|
font_size = ${toString label.font_size}
|
|
|
|
font_family = ${label.font_family}
|
2024-03-29 20:01:11 +01:00
|
|
|
rotate = ${toString label.rotate}
|
2024-03-09 01:11:27 +01:00
|
|
|
shadow_passes = ${toString label.shadow_passes}
|
|
|
|
shadow_size = ${toString label.shadow_size}
|
|
|
|
shadow_color = ${label.shadow_color}
|
|
|
|
shadow_boost = ${toString label.shadow_boost}
|
2024-02-21 12:30:24 +01:00
|
|
|
|
|
|
|
position = ${toString label.position.x}, ${toString label.position.y}
|
|
|
|
halign = ${label.halign}
|
|
|
|
valign = ${label.valign}
|
|
|
|
}
|
|
|
|
'')
|
|
|
|
cfg.labels)}
|
2024-03-25 22:16:05 +01:00
|
|
|
|
|
|
|
${lib.optionalString (cfg.extraConfig != null) cfg.extraConfig}
|
2024-02-19 00:50:56 +01:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|