diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index 2720c7eb2..7326fb670 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -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
diff --git a/modules/misc/news.nix b/modules/misc/news.nix
index 69a187698..4807fcb79 100644
--- a/modules/misc/news.nix
+++ b/modules/misc/news.nix
@@ -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'.
+ '';
+ }
];
};
}
diff --git a/modules/modules.nix b/modules/modules.nix
index db6bdb295..a1a4c5f6e 100644
--- a/modules/modules.nix
+++ b/modules/modules.nix
@@ -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
diff --git a/modules/services/betterlockscreen.nix b/modules/services/betterlockscreen.nix
new file mode 100644
index 000000000..970f07728
--- /dev/null
+++ b/modules/services/betterlockscreen.nix
@@ -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 betterlockscreen.";
+ };
+
+ arguments = mkOption {
+ type = types.listOf types.str;
+ default = [ ];
+ description =
+ "List of arguments appended to ./betterlockscreen --lock [args]";
+ };
+
+ inactiveInterval = mkOption {
+ type = types.int;
+ default = 10;
+ description = ''
+ Value used for .
+ '';
+ };
+
+ };
+ };
+
+ 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
+ }";
+ };
+ };
+}