From 49283fab73b55a1ac82c1e33f29769872432de5c Mon Sep 17 00:00:00 2001 From: Gerg-L Date: Sat, 7 Dec 2024 13:09:29 -0500 Subject: [PATCH] split boot module --- modules/{boot.nix => boot/other.nix} | 46 ++++++---------------------- modules/boot/silent.nix | 42 +++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 36 deletions(-) rename modules/{boot.nix => boot/other.nix} (57%) create mode 100644 modules/boot/silent.nix diff --git a/modules/boot.nix b/modules/boot/other.nix similarity index 57% rename from modules/boot.nix rename to modules/boot/other.nix index ae4ea21..e4be6fc 100644 --- a/modules/boot.nix +++ b/modules/boot/other.nix @@ -1,55 +1,29 @@ { - self', lib, - config, + self', pkgs, + config, }: { options.local.bootConfig.disable = lib.mkEnableOption ""; + config = lib.mkIf (!config.local.bootConfig.disable) { - environment.etc = { - "issue" = { - text = "[?12l[?25h"; - mode = "0444"; - }; - }; boot = { - blacklistedKernelModules = [ "pcspkr" ]; - kernelParams = lib.mkBefore [ - "logo.nologo" - "fbcon=nodefer" - "bgrt_disable" - "vt.global_cursor_default=0" - "quiet" - "systemd.show_status=false" - "rd.udev.log_level=3" - "splash" - ]; - consoleLogLevel = 3; - initrd = { - verbose = false; - systemd.enable = true; - }; - plymouth = { - enable = lib.mkDefault true; - theme = "breeze"; - logo = "${self'.packages.images}/logo.png"; - }; loader = { - grub = { - configurationLimit = 10; - extraConfig = '' - GRUB_TIMEOUT_STYLE=hidden - ''; - }; + grub.configurationLimit = 10; systemd-boot = { configurationLimit = 10; enable = lib.mkDefault true; consoleMode = "max"; editor = false; }; + efi.canTouchEfiVariables = lib.mkDefault true; - timeout = 0; + }; + plymouth = { + enable = lib.mkDefault true; + theme = "breeze"; + logo = "${self'.packages.images}/logo.png"; }; }; systemd.services.efibootmgr = { diff --git a/modules/boot/silent.nix b/modules/boot/silent.nix new file mode 100644 index 0000000..341a4d6 --- /dev/null +++ b/modules/boot/silent.nix @@ -0,0 +1,42 @@ +{ lib }: +{ + /* + Lots taken from here + https://wiki.archlinux.org/title/Silent_boot + */ + environment.etc.issue = { + /* + Turns the cursor back on in the TTY + It's the output of this commmand + setterm -cursor on + */ + + text = "[?12l[?25h"; + mode = "0444"; + }; + boot = { + kernelParams = lib.mkBefore [ + "fbcon=nodefer" # Wipes the vendor logo earlier + "vt.global_cursor_default=0" # Stops cursor blinking while booting + "quiet" # Less log messages + "systemd.show_status=auto" # Only show systemd errors + "udev.log_level=3" # Only show udev errors + "splash" # Show splash + ]; + consoleLogLevel = 3; # Only errors + initrd = { + verbose = false; # Less stage1 messages + systemd.enable = true; # Use systemd initrd + }; + # Hide grub (if it's being used) + loader.grub.extraConfig = '' + GRUB_TIMEOUT_STYLE=hidden + GRUB_HIDDEN_TIMEOUT_QUIET=true + ''; + /* + Not recommended + rolling back can be a pain + */ + #timeout = 0; + }; +}