From 14c0e79580273b9ab7643a8df9b4c695a4d4a75c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tristan=20Dani=C3=ABl=20Maat?= Date: Thu, 7 Sep 2023 04:28:35 +0200 Subject: [PATCH] WIP: hyprland: Add swaylock --- home-config/config/desktop/hyprland.nix | 25 +++++++++++++++++++++++++ nixos-config/default.nix | 2 ++ 2 files changed, 27 insertions(+) diff --git a/home-config/config/desktop/hyprland.nix b/home-config/config/desktop/hyprland.nix index bb0e4209..4019cc87 100644 --- a/home-config/config/desktop/hyprland.nix +++ b/home-config/config/desktop/hyprland.nix @@ -6,6 +6,7 @@ ... }: let hyprctl = "${flake-inputs.hyprland.packages.${pkgs.system}.hyprland-nvidia}/bin/hyprctl"; + loginctl = "${pkgs.systemd}/bin/loginctl"; wpaperd-config = { default = { @@ -55,14 +56,38 @@ in { enable = true; systemdTarget = "graphical-session.target"; + events = [ + { + event = "lock"; + command = "${config.programs.swaylock.package}/bin/swaylock"; + } + ]; + timeouts = [ { timeout = 5 * 60; command = "${hyprctl} dispatch dpms off"; } + { + timeout = 6 * 60; + command = "${loginctl} lock-session"; + } ]; }; + programs.swaylock = { + enable = true; + package = pkgs.swaylock-effects; + settings = { + screenshots = true; + clock = true; + indicator = true; + indicator-radius = 100; + indicator-thickness = 7; + effect-blur = "7x5"; + }; + }; + systemd.user.services.wpaperd = { Unit = { Description = "Wallpaper daemon"; diff --git a/nixos-config/default.nix b/nixos-config/default.nix index cd114a83..9da8946c 100644 --- a/nixos-config/default.nix +++ b/nixos-config/default.nix @@ -146,6 +146,8 @@ hyprland.enable = true; }; + security.pam.services.swaylock = {}; + fonts = { enableDefaultFonts = true;