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" + ]); }; }