mirror of
https://github.com/nix-community/home-manager
synced 2024-11-23 11:39:46 +01:00
parent
1fd874b7ea
commit
f56c4187a4
1 changed files with 10 additions and 3 deletions
|
@ -17,6 +17,14 @@ in {
|
||||||
example = "\${pkgs.i3lock}/bin/i3lock -n -c 000000";
|
example = "\${pkgs.i3lock}/bin/i3lock -n -c 000000";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enableDetectSleep = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = true;
|
||||||
|
description = ''
|
||||||
|
Whether to reset timers when awaking from sleep.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
inactiveInterval = mkOption {
|
inactiveInterval = mkOption {
|
||||||
type = types.int;
|
type = types.int;
|
||||||
default = 10;
|
default = 10;
|
||||||
|
@ -42,7 +50,6 @@ in {
|
||||||
Extra command-line arguments to pass to <command>xss-lock</command>.
|
Extra command-line arguments to pass to <command>xss-lock</command>.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
@ -58,10 +65,10 @@ in {
|
||||||
Service = {
|
Service = {
|
||||||
ExecStart = concatStringsSep " " ([
|
ExecStart = concatStringsSep " " ([
|
||||||
"${pkgs.xautolock}/bin/xautolock"
|
"${pkgs.xautolock}/bin/xautolock"
|
||||||
"-detectsleep"
|
|
||||||
"-time ${toString cfg.inactiveInterval}"
|
"-time ${toString cfg.inactiveInterval}"
|
||||||
"-locker '${pkgs.systemd}/bin/loginctl lock-session $XDG_SESSION_ID'"
|
"-locker '${pkgs.systemd}/bin/loginctl lock-session $XDG_SESSION_ID'"
|
||||||
] ++ cfg.xautolockExtraOptions);
|
] ++ optional cfg.enableDetectSleep "-detectsleep"
|
||||||
|
++ cfg.xautolockExtraOptions);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue