Skip to content

Commit

Permalink
Nix: format
Browse files Browse the repository at this point in the history
  • Loading branch information
fufexan committed Feb 20, 2024
1 parent fdabe5a commit c4f0682
Showing 1 changed file with 26 additions and 10 deletions.
36 changes: 26 additions & 10 deletions nix/hm-module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ self: {
pkgs,
lib,
...
}:

let
}: let
inherit (builtins) toString;
inherit (lib.types) int listOf package str bool submodule;
inherit (lib.modules) mkIf;
Expand All @@ -24,10 +22,12 @@ in {

backgrounds = mkOption {
description = "Monitor configurations";
default = [{
monitor = "";
path = "";
}];
default = [
{
monitor = "";
path = "";
}
];
type = listOf (submodule {
options = {
monitor = mkOption {
Expand Down Expand Up @@ -57,7 +57,8 @@ in {
type = str;
default = "";
};
size = {

size = {
width = mkOption {
description = "Width of the input field";
type = int;
Expand Down Expand Up @@ -87,21 +88,25 @@ in {
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;
};

placeholder_text = mkOption {
description = "The placeholder text of the input field";
type = str;
default = "<i>Input Password...</i>";
};

position = {
x = mkOption {
description = "X position of the label";
Expand All @@ -114,17 +119,20 @@ in {
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";
};
};

label = {
monitor = mkOption {
description = "The monitor to display the label on";
Expand All @@ -137,52 +145,59 @@ in {
type = str;
default = "Hi there, $USER";
};

color = mkOption {
description = "Color of the label";
type = str;
default = "rgba(200, 200, 200, 1.0)";
};

font_size = mkOption {
description = "Font size of the label";
type = int;
default = 25;
};

font_family = mkOption {
description = "Font family of the label";
type = str;
default = "Noto Sans";
};

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";
};

};
};

config = mkIf cfg.enable {
xdg.configFile."hypr/hyprlock.conf".text = ''
general {
disable_loading_bar = ${toString cfg.general.disable_loading_bar}
}
label {
monitor = ${cfg.label.monitor}
text = ${cfg.label.text}
Expand All @@ -194,6 +209,7 @@ in {
halign = ${cfg.label.halign}
valign = ${cfg.label.valign}
}
input-field {
monitor = ${cfg.input_field.monitor}
size = ${toString cfg.input_field.size.width} ${toString cfg.input_field.size.height}
Expand Down

0 comments on commit c4f0682

Please sign in to comment.