{ lib, config, pkgs, ... }: let inherit (lib) mkEnableOption mkIf getExe; cfg = config.marleyos.services.screen-locker; hasXorg = config.xsession.enable; in { options.marleyos.services.screen-locker.enable = mkEnableOption "screen-locker"; config = 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 = "${getExe pkgs.betterlockscreen} -l"; }; }; }