{ lib, config, pkgs, ... }: let cfg = config.marleyos.services.screen-locker; hasXorg = config.xsession.enable; in { options.marleyos.services.screen-locker.enable = lib.mkEnableOption "screen-locker"; config = lib.mkIf (cfg.enable && hasXorg) { home.packages = with pkgs; [ betterlockscreen ]; services.screen-locker = { enable = true; inactiveInterval = 20; # exec xss-lock {xss-lock.extraOptions} -- {lockCmd} xss-lock.extraOptions = ["--transfer-sleep-lock"]; lockCmd = "${lib.getExe pkgs.betterlockscreen} -l"; }; }; }