···26 };
2728 locker = mkOption {
29- default = "xlock"; # default according to `man xautolock`
30- example = "i3lock -i /path/to/img";
31- type = types.string;
3233 description = ''
34 The script to use when automatically locking the computer.
···3738 nowlocker = mkOption {
39 default = null;
40- example = "i3lock -i /path/to/img";
41- type = types.nullOr types.string;
4243 description = ''
44 The script to use when manually locking the computer with <command>xautolock -locknow</command>.
···5657 notifier = mkOption {
58 default = null;
59- example = literalExample ''
60- "${pkgs.libnotify}/bin/notify-send \"Locking in 10 seconds\""
61- '';
62- type = types.nullOr types.string;
6364 description = ''
65 Notification script to be used to warn about the pending autolock.
···6869 killer = mkOption {
70 default = null; # default according to `man xautolock` is none
71- example = "systemctl suspend";
72- type = types.nullOr types.string;
7374 description = ''
75 The script to use when nothing has happend for as long as <option>killtime</option>
···131 assertion = cfg.killer != null -> cfg.killtime >= 10;
132 message = "killtime has to be at least 10 minutes according to `man xautolock`";
133 }
134- ];
000000135 };
136 }
···26 };
2728 locker = mkOption {
29+ default = "${pkgs.xlockmore}/bin/xlock"; # default according to `man xautolock`
30+ example = "${pkgs.i3lock}/bin/i3lock -i /path/to/img";
31+ type = types.str;
3233 description = ''
34 The script to use when automatically locking the computer.
···3738 nowlocker = mkOption {
39 default = null;
40+ example = "${pkgs.i3lock}/bin/i3lock -i /path/to/img";
41+ type = types.nullOr types.str;
4243 description = ''
44 The script to use when manually locking the computer with <command>xautolock -locknow</command>.
···5657 notifier = mkOption {
58 default = null;
59+ example = "${pkgs.libnotify}/bin/notify-send \"Locking in 10 seconds\"";
60+ type = types.nullOr types.str;
006162 description = ''
63 Notification script to be used to warn about the pending autolock.
···6667 killer = mkOption {
68 default = null; # default according to `man xautolock` is none
69+ example = "${pkgs.systemd}/bin/systemctl suspend";
70+ type = types.nullOr types.str;
7172 description = ''
73 The script to use when nothing has happend for as long as <option>killtime</option>
···129 assertion = cfg.killer != null -> cfg.killtime >= 10;
130 message = "killtime has to be at least 10 minutes according to `man xautolock`";
131 }
132+ ] ++ (lib.flip map [ "locker" "notifier" "nowlocker" "killer" ]
133+ (option:
134+ {
135+ assertion = cfg."${option}" != null -> builtins.substring 0 1 cfg."${option}" == "/";
136+ message = "Please specify a canonical path for `services.xserver.xautolock.${option}`";
137+ })
138+ );
139 };
140 }