refactor(nixos/desktop): move hyprlock config to nixos module

This commit is contained in:
Mohammad Rafiq 2025-06-13 21:46:18 +08:00
parent fba8f1bfdd
commit a654a6b9b6
No known key found for this signature in database
5 changed files with 60 additions and 51 deletions

View file

@ -0,0 +1,49 @@
{ osConfig, lib, ... }:
let
inherit (lib) singleton mkIf;
cfg = osConfig.desktop.lockscreen.hyprlock;
in
{
config = mkIf cfg.enable {
assertions = singleton {
assertion = osConfig.security.pam.services ? hyprlock;
message = "You must add hyprlock to osConfig.security.pam.services.";
};
home.sessionVariables.LOCKSCREEN = "hyprlock";
programs.hyprlock = {
enable = true;
settings = {
general.hide_cursor = true;
general.ignore_empty_input = true;
background = {
blur_passes = 5;
blur_size = 5;
};
label = {
text = ''hi, $USER.'';
font_size = 32;
halign = "center";
valign = "center";
position = "0, 0";
zindex = 1;
shadow_passes = 5;
shadow_size = 5;
};
input-field = {
fade_on_empty = true;
size = "200, 45";
halign = "center";
valign = "center";
position = "0, -5%";
placeholder_text = "";
zindex = 1;
shadow_passes = 5;
shadow_size = 5;
};
};
};
};
}