1 { pkgs, lib, config, ... }:
4 options.services.xsecurelock = {
6 description = "xsecurelock settings";
7 type = lib.types.submodule {
8 freeformType = with types; attrsOf str;
14 services.xsecurelock.settings = {
15 XSECURELOCK_BLANK_DPMS_STATE = mkDefault "off";
16 XSECURELOCK_BLANK_TIMEOUT = mkDefault "1";
17 XSECURELOCK_DIM_TIME_MS = mkDefault "2000";
18 XSECURELOCK_DISCARD_FIRST_KEYPRESS = mkDefault "0";
19 XSECURELOCK_FONT = mkDefault "monospace:size=12";
20 XSECURELOCK_SAVER = mkDefault "saver_blank";
21 XSECURELOCK_SHOW_DATETIME = mkDefault "1";
22 XSECURELOCK_SHOW_HOSTNAME = mkDefault "1";
23 XSECURELOCK_SHOW_USERNAME = mkDefault "1";
24 #XSECURELOCK_SWITCH_USER_COMMAND = mkDefault "${pkgs.lightdm}/bin/dm-tool switch-to-greeter";
25 XSECURELOCK_WAIT_TIME_MS = mkDefault "2000";
31 services.screen-locker = {
33 lockCmd = toString (pkgs.writeShellScript "xsecurelock" ''
34 export PATH=${with pkgs; makeBinPath [coreutils gnugrep xsecurelock xorg.xset]}
35 ${concatMapStringsSep "\n"
36 ({name, value}: "export "+escapeShellArg name+"="+escapeShellArg value)
37 (attrsToList config.services.xsecurelock.settings)}
38 ${pkgs.xsecurelock}/bin/xsecurelock
40 inactiveInterval = mkDefault 3; # minutes
41 xautolock.detectSleep = true;
42 xss-lock.extraOptions = [
43 "--transfer-sleep-lock"
44 #"-n" "${pkgs.xss-lock}/share/doc/xss-lock/dim-screen.sh"