From ee090cd8081d99a82ec12191df5fff9e93d5fd2c Mon Sep 17 00:00:00 2001 From: Owen McGrath Date: Thu, 3 Nov 2022 14:04:43 -0500 Subject: [PATCH] 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. --- nixos/modules/services/security/physlock.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/nixos/modules/services/security/physlock.nix b/nixos/modules/services/security/physlock.nix index 3db9e0ac4458..cd7747659152 100644 --- a/nixos/modules/services/security/physlock.nix +++ b/nixos/modules/services/security/physlock.nix @@ -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}\""}"; }; };