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

32 lines
633 B
Nix
Raw Normal View History

2024-11-23 13:09:53 -08:00
{
lib,
config,
pkgs,
...
}:
let
2024-11-24 12:46:20 -08:00
inherit (lib) mkEnableOption mkIf getExe;
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 = mkEnableOption "screen-locker";
config = 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" ];
2024-11-24 12:46:20 -08:00
lockCmd = "${getExe pkgs.betterlockscreen} -l";
2024-11-23 13:09:53 -08:00
};
};
}