summaryrefslogtreecommitdiffstats
path: root/modules/linux/lockscreen.nix
blob: d3ddbd43b1139e87a3411c23cb835dfdaacf25d4 (plain) (blame)
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
30
31
{
  config,
  lib,
  pkgs,
  ...
}: let
  cfg = config.my.lockscreen;
in {
  options.my.lockscreen.enable = lib.mkEnableOption "betterlockscreen with xautolock";

  config = lib.mkIf cfg.enable {
    environment.systemPackages = with pkgs; [
      betterlockscreen
      lock-screen
    ];

    programs.i3lock = {
      enable = true;
      package = pkgs.i3lock-color;
    };

    security.pam.services.betterlockscreen = {};

    services.xserver.xautolock = {
      enable = true;
      enableNotifier = true;
      notifier = "${pkgs.dunst}/bin/notify-send 'Locking in 10 seconds'";
      locker = "${pkgs.betterlockscreen}/bin/betterlockscreen -l dimblur";
    };
  };
}