refactor(nixos/desktop): move hyprlock config to nixos module
This commit is contained in:
parent
fba8f1bfdd
commit
a654a6b9b6
5 changed files with 60 additions and 51 deletions
|
@ -1,47 +0,0 @@
|
||||||
{
|
|
||||||
osConfig,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
{
|
|
||||||
config = lib.mkMerge [
|
|
||||||
(lib.mkIf (osConfig.desktop.lockscreen == "hyprlock") {
|
|
||||||
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;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
})
|
|
||||||
];
|
|
||||||
}
|
|
49
modules/home/desktop/lockscreen/hyprlock/default.nix
Normal file
49
modules/home/desktop/lockscreen/hyprlock/default.nix
Normal 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;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -17,7 +17,6 @@
|
||||||
refresh-rate = lib.pantheon.mkStrOption;
|
refresh-rate = lib.pantheon.mkStrOption;
|
||||||
};
|
};
|
||||||
windowManager = lib.pantheon.mkStrOption;
|
windowManager = lib.pantheon.mkStrOption;
|
||||||
lockscreen = lib.pantheon.mkStrOption;
|
|
||||||
terminal = lib.pantheon.mkStrOption;
|
terminal = lib.pantheon.mkStrOption;
|
||||||
notification-daemon = lib.pantheon.mkStrOption;
|
notification-daemon = lib.pantheon.mkStrOption;
|
||||||
launcher = lib.pantheon.mkStrOption;
|
launcher = lib.pantheon.mkStrOption;
|
||||||
|
|
|
@ -1,7 +1,15 @@
|
||||||
{ config, lib, ... }:
|
{ config, lib, ... }:
|
||||||
|
let
|
||||||
|
inherit (lib) mkEnableOption mkIf mkMerge;
|
||||||
|
cfg = config.desktop.lockscreen;
|
||||||
|
in
|
||||||
{
|
{
|
||||||
config = lib.mkMerge [
|
options.desktop.lockscreen = {
|
||||||
(lib.mkIf (config.desktop.lockscreen == "hyprlock") {
|
hyprlock.enable = mkEnableOption "";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkMerge [
|
||||||
|
(mkIf cfg.hyprlock.enable {
|
||||||
security.pam.services.hyprlock = { };
|
security.pam.services.hyprlock = { };
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
|
|
@ -7,9 +7,9 @@
|
||||||
"test"
|
"test"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
lockscreen.hyprlock.enable = true;
|
||||||
windowManager = "hyprland";
|
windowManager = "hyprland";
|
||||||
terminal = "ghostty";
|
terminal = "ghostty";
|
||||||
lockscreen = "hyprlock";
|
|
||||||
notification-daemon = "mako";
|
notification-daemon = "mako";
|
||||||
launcher = "fuzzel";
|
launcher = "fuzzel";
|
||||||
status-bar = "waybar";
|
status-bar = "waybar";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue