From 45d103f623752f9965e9de7a4fa60b3be3db026b Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Thu, 9 Jan 2025 21:57:06 +0530 Subject: Move bslock package into module and use xautolock instead of script --- modules/lockscreen.nix | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 modules/lockscreen.nix (limited to 'modules') diff --git a/modules/lockscreen.nix b/modules/lockscreen.nix new file mode 100644 index 0000000..34214fa --- /dev/null +++ b/modules/lockscreen.nix @@ -0,0 +1,28 @@ +{ pkgs, ... }: +let + localPkgs = import ../packages/default.nix { inherit pkgs; }; +in { + environment.systemPackages = [ localPkgs.bslock ]; + + services.xserver.xautolock = { + enable = true; + time = 15; # minutes + locker = "${localPkgs.bslock}/bin/bslock"; + + enableNotifier = true; + notify = 30; + notifier = "${pkgs.libnotify}/bin/notify-send 'Locking in 30 seconds'"; + killer = null; + }; + + # Security wrappers + security.wrappers = { + bslock = { + # owner = config.users.users.imsohexy.name; + owner = "root"; + setuid = true; + group = "root"; + source = "${localPkgs.bslock}/bin/bslock"; + }; + }; +} -- cgit v1.3.1