lock on suspend + manual

This commit is contained in:
Odweta
2026-01-11 20:17:24 +01:00
parent 5f6db95c9a
commit bc1c93759c
3 changed files with 24 additions and 3 deletions
+19
View File
@@ -0,0 +1,19 @@
{ config, pkgs, ... }:
{
services.logind = {
lidSwitch = "suspend"; # suspend on lid close
handleLidSwitch = "suspend"; # explicit
};
systemd.services.hyprlock-pre-suspend = {
description = "Lock screen before suspend";
serviceConfig = {
Type = "oneshot";
# Run as your user
ExecStart = "${pkgs.hyprlock}/bin/hyprlock -n";
};
install.wantedBy = [ "sleep.target" ];
};
}