marleyos/modules/home/services/screen-locker/default.nix

27 lines
597 B
Nix
Raw Normal View History

2024-11-23 13:09:53 -08:00
{
lib,
config,
pkgs,
...
}: let
2024-11-23 13:09:53 -08:00
cfg = config.marleyos.services.screen-locker;
hasXorg = config.xsession.enable;
in {
options.marleyos.services.screen-locker.enable = lib.mkEnableOption "screen-locker";
2024-11-23 13:09:53 -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}
xss-lock.extraOptions = ["--transfer-sleep-lock"];
lockCmd = "${lib.getExe pkgs.betterlockscreen} -l";
2024-11-23 13:09:53 -08:00
};
};
}