about summary refs log tree commit diff
path: root/modules/slock.nix
blob: 85c78de7066107171ccc8cd6888013314c04f7ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
{ config, pkgs, ... }:

let
  slock = pkgs.slock.overrideAttrs(oldAttrs: {
    buildInputs = oldAttrs.buildInputs ++ [
      # pkgs.imlib2
      # pkgs.linux-pam
      pkgs.xlibs.libXinerama
    ];
    patches = [
      # ../platforms/linux/xorg/slock/slock-pam_auth-20190207-35633d4.diff
      ../platforms/linux/xorg/slock/slock-capscolor-20170106-2d2a21a.diff
      ../platforms/linux/xorg/slock/slock-dpms-1.4.diff
      ../platforms/linux/xorg/slock/slock-mediakeys.diff
    ];
  });
in {
  environment.systemPackages = [ slock ];
  security.wrappers.slock.source = "${slock.out}/bin/slock";
  services.xserver.xautolock = {
    enable = true;
    locker = "${config.security.wrapperDir}/slock";
    enableNotifier = true;
    notifier = "${pkgs.libnotify}/bin/notify-send \"Locking in 10 seconds\"";
    killer = "/run/current-system/systemd/bin/systemctl suspend-then-hibernate";
    killtime = 30;
    extraOptions = [ "-detectsleep" ];
  };
}