···2626 };
27272828 locker = mkOption {
2929- default = "xlock"; # default according to `man xautolock`
3030- example = "i3lock -i /path/to/img";
3131- type = types.string;
2929+ default = "${pkgs.xlockmore}/bin/xlock"; # default according to `man xautolock`
3030+ example = "${pkgs.i3lock}/bin/i3lock -i /path/to/img";
3131+ type = types.str;
32323333 description = ''
3434 The script to use when automatically locking the computer.
···37373838 nowlocker = mkOption {
3939 default = null;
4040- example = "i3lock -i /path/to/img";
4141- type = types.nullOr types.string;
4040+ example = "${pkgs.i3lock}/bin/i3lock -i /path/to/img";
4141+ type = types.nullOr types.str;
42424343 description = ''
4444 The script to use when manually locking the computer with <command>xautolock -locknow</command>.
···56565757 notifier = mkOption {
5858 default = null;
5959- example = literalExample ''
6060- "${pkgs.libnotify}/bin/notify-send \"Locking in 10 seconds\""
6161- '';
6262- type = types.nullOr types.string;
5959+ example = "${pkgs.libnotify}/bin/notify-send \"Locking in 10 seconds\"";
6060+ type = types.nullOr types.str;
63616462 description = ''
6563 Notification script to be used to warn about the pending autolock.
···68666967 killer = mkOption {
7068 default = null; # default according to `man xautolock` is none
7171- example = "systemctl suspend";
7272- type = types.nullOr types.string;
6969+ example = "${pkgs.systemd}/bin/systemctl suspend";
7070+ type = types.nullOr types.str;
73717472 description = ''
7573 The script to use when nothing has happend for as long as <option>killtime</option>
···131129 assertion = cfg.killer != null -> cfg.killtime >= 10;
132130 message = "killtime has to be at least 10 minutes according to `man xautolock`";
133131 }
134134- ];
132132+ ] ++ (lib.flip map [ "locker" "notifier" "nowlocker" "killer" ]
133133+ (option:
134134+ {
135135+ assertion = cfg."${option}" != null -> builtins.substring 0 1 cfg."${option}" == "/";
136136+ message = "Please specify a canonical path for `services.xserver.xautolock.${option}`";
137137+ })
138138+ );
135139 };
136140 }