diff --git a/homes/x86_64-linux/rafiq/desktop/default.nix b/homes/x86_64-linux/rafiq/desktop/default.nix index 3c5d58d..8778d76 100644 --- a/homes/x86_64-linux/rafiq/desktop/default.nix +++ b/homes/x86_64-linux/rafiq/desktop/default.nix @@ -9,4 +9,5 @@ let in mkMerge [ (import ./browser.nix { inherit lib inputs system; }) + (import ./lockscreen.nix) ] diff --git a/homes/x86_64-linux/rafiq/desktop/lockscreen.nix b/homes/x86_64-linux/rafiq/desktop/lockscreen.nix new file mode 100644 index 0000000..486483e --- /dev/null +++ b/homes/x86_64-linux/rafiq/desktop/lockscreen.nix @@ -0,0 +1,35 @@ +{ + home.sessionVariables.LOCKSCREEN = "hyprlock"; + programs.hyprlock.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; + }; + }; +} diff --git a/modules/home/desktop/lockscreen/hyprlock/default.nix b/modules/home/desktop/lockscreen/hyprlock/default.nix deleted file mode 100644 index 0d7de98..0000000 --- a/modules/home/desktop/lockscreen/hyprlock/default.nix +++ /dev/null @@ -1,49 +0,0 @@ -{ 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; - }; - }; - }; - }; -} diff --git a/modules/nixos/desktop/lockscreen/default.nix b/modules/nixos/desktop/lockscreen/default.nix index bcc94b1..1074bbd 100644 --- a/modules/nixos/desktop/lockscreen/default.nix +++ b/modules/nixos/desktop/lockscreen/default.nix @@ -1,6 +1,11 @@ { config, lib, ... }: let - inherit (lib) mkEnableOption mkIf mkMerge; + inherit (lib) + mkEnableOption + mkIf + mkMerge + singleton + ; cfg = config.desktop.lockscreen; in { @@ -11,6 +16,7 @@ in config = mkMerge [ (mkIf cfg.hyprlock.enable { security.pam.services.hyprlock = { }; + home-manager.sharedModules = singleton { programs.hyprlock.enable = true; }; }) ]; }