2024-11-23 13:09:53 -08:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
...
|
2025-01-13 21:05:10 -08:00
|
|
|
}: let
|
2024-11-23 13:09:53 -08:00
|
|
|
cfg = config.marleyos.services.screen-locker;
|
|
|
|
hasXorg = config.xsession.enable;
|
2025-01-13 21:05:10 -08:00
|
|
|
in {
|
|
|
|
options.marleyos.services.screen-locker.enable = lib.mkEnableOption "screen-locker";
|
2024-11-23 13:09:53 -08:00
|
|
|
|
2025-01-13 21:05:10 -08:00
|
|
|
config = lib.mkIf (cfg.enable && hasXorg) {
|
2024-11-24 12:46:20 -08:00
|
|
|
home.packages = with pkgs; [
|
|
|
|
betterlockscreen
|
|
|
|
];
|
|
|
|
|
2024-11-23 13:09:53 -08:00
|
|
|
services.screen-locker = {
|
|
|
|
enable = true;
|
|
|
|
inactiveInterval = 20;
|
|
|
|
|
|
|
|
# exec xss-lock {xss-lock.extraOptions} -- {lockCmd}
|
2025-01-13 21:05:10 -08:00
|
|
|
xss-lock.extraOptions = ["--transfer-sleep-lock"];
|
|
|
|
lockCmd = "${lib.getExe pkgs.betterlockscreen} -l";
|
2024-11-23 13:09:53 -08:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|