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.
This commit is contained in:
Owen McGrath 2022-11-03 14:04:43 -05:00
parent ca258d7988
commit ee090cd808

View file

@ -57,6 +57,14 @@ in
'';
};
muteKernelMessages = mkOption {
type = types.bool;
default = false;
description = lib.mdDoc ''
Disable kernel messages on console while physlock is running.
'';
};
lockOn = {
suspend = mkOption {
@ -116,7 +124,7 @@ in
++ 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}\""}";
};
};