nixos/physlock: add muteKernelMessages options

Add an option for physlock's -m flag, which mutes kernel messages on the
console. This ensures that the password prompt is the only thing on the
screen and isn't lost in a flood of kernel messages.

Changed files
+9 -1
nixos
modules
services
security
+9 -1
nixos/modules/services/security/physlock.nix
···
'';
};
+
muteKernelMessages = mkOption {
+
type = types.bool;
+
default = false;
+
description = lib.mdDoc ''
+
Disable kernel messages on console while physlock is running.
+
'';
+
};
+
lockOn = {
suspend = mkOption {
···
++ cfg.lockOn.extraTargets;
serviceConfig = {
Type = "forking";
-
ExecStart = "${pkgs.physlock}/bin/physlock -d${optionalString cfg.disableSysRq "s"}${optionalString (cfg.lockMessage != "") " -p \"${cfg.lockMessage}\""}";
+
ExecStart = "${pkgs.physlock}/bin/physlock -d${optionalString cfg.muteKernelMessages "m"}${optionalString cfg.disableSysRq "s"}${optionalString (cfg.lockMessage != "") " -p \"${cfg.lockMessage}\""}";
};
};