betterlockscreen: add module (#2292)
This commit is contained in:
parent
2952168ed5
commit
5e46262cb1
2
.github/CODEOWNERS
vendored
2
.github/CODEOWNERS
vendored
|
@ -214,6 +214,8 @@
|
|||
/modules/services/barrier.nix @Kritnich
|
||||
/tests/modules/services/barrier @Kritnich
|
||||
|
||||
/modules/services/betterlockscreen.nix @SebTM
|
||||
|
||||
/modules/services/caffeine.nix @uvNikita
|
||||
|
||||
/modules/services/cbatticon.nix @pmiddend
|
||||
|
|
|
@ -2188,6 +2188,14 @@ in
|
|||
A new module is available: 'services.fnott'.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2021-08-31T18:44:26+00:00";
|
||||
condition = hostPlatform.isLinux;
|
||||
message = ''
|
||||
A new module is available: 'services.betterlockscreen'.
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -148,6 +148,7 @@ let
|
|||
./programs/zsh.nix
|
||||
./programs/zsh/prezto.nix
|
||||
./services/barrier.nix
|
||||
./services/betterlockscreen.nix
|
||||
./services/blueman-applet.nix
|
||||
./services/caffeine.nix
|
||||
./services/cbatticon.nix
|
||||
|
|
50
modules/services/betterlockscreen.nix
Normal file
50
modules/services/betterlockscreen.nix
Normal file
|
@ -0,0 +1,50 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let cfg = config.services.betterlockscreen;
|
||||
|
||||
in {
|
||||
meta.maintainers = with maintainers; [ sebtm ];
|
||||
|
||||
options = {
|
||||
services.betterlockscreen = {
|
||||
enable = mkEnableOption "betterlockscreen, a screen-locker module";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.betterlockscreen;
|
||||
defaultText = literalExample "pkgs.betterlockscreen";
|
||||
description = "Package providing <command>betterlockscreen</command>.";
|
||||
};
|
||||
|
||||
arguments = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [ ];
|
||||
description =
|
||||
"List of arguments appended to <literal>./betterlockscreen --lock [args]</literal>";
|
||||
};
|
||||
|
||||
inactiveInterval = mkOption {
|
||||
type = types.int;
|
||||
default = 10;
|
||||
description = ''
|
||||
Value used for <option>services.screen-locker.inactiveInterval</option>.
|
||||
'';
|
||||
};
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = [ cfg.package ];
|
||||
|
||||
services.screen-locker = {
|
||||
enable = true;
|
||||
inactiveInterval = cfg.inactiveInterval;
|
||||
lockCmd = "${cfg.package}/bin/betterlockscreen --lock ${
|
||||
concatStringsSep " " cfg.arguments
|
||||
}";
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue