From ac39d93be354e17729922d4320e9adee086f28c4 Mon Sep 17 00:00:00 2001 From: ItsDrike Date: Sat, 13 Apr 2024 00:07:53 +0200 Subject: [PATCH] Use silent boot if plymouth is enabled --- options/system/boot/default.nix | 5 +++++ system/boot/generic.nix | 20 ++++++++++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/options/system/boot/default.nix b/options/system/boot/default.nix index b29c5bb..50b82d9 100644 --- a/options/system/boot/default.nix +++ b/options/system/boot/default.nix @@ -23,5 +23,10 @@ in { This option defaults to `true` if the host provides patches to the kernel package in `boot.kernelPatches` ''; + + silentBoot = mkEnableOption '' + almost entirely silent boot process through `quiet` kernel parameter + '' + // { default = cfg.plymouth.enable; }; }; } diff --git a/system/boot/generic.nix b/system/boot/generic.nix index 4c82521..7efa56a 100644 --- a/system/boot/generic.nix +++ b/system/boot/generic.nix @@ -1,9 +1,9 @@ { config, lib, ... }: let - inherit (lib) mkDefault; + inherit (lib) mkDefault optionals; cfg = config.myOptions.system.boot; in { - config.boot = { + boot = { # kernel console loglevel consoleLogLevel = 3; @@ -38,5 +38,21 @@ in { # but should be tweaked based on your systems capabilities tmpfsSize = mkDefault "50%"; }; + + kernelParams = (optionals cfg.silentBoot [ + # tell the kernel to not be verbose + "quiet" + + "loglevel=3" # 1: system is unusable | 3: error condition | 7: very verbose + + # udev log message level + # rd prefix means systemd-udev will be used instead of initrd + "udev.log_level=3" + "rd.udev.log_level=3" + + # disable systemd status messages + "systemd.show_status=auto" + "rd.systemd.show_status=auto" + ]); }; }