nix/hosts/laptop/modules/bootloader.nix
2024-12-02 06:52:33 -07:00

49 lines
No EOL
1.5 KiB
Nix

{ inputs, system, ... }:
{
boot = {
loader = {
# Configure GRUB bootloader
grub = {
enable = true;
useOSProber = false; # Don't show other OS-es, the main grub install handles that
devices = [ "nodev" ]; # Assume grub is already installed properly
efiSupport = true;
# Add extra power options to bootloader
extraEntries = ''
menuentry "Poweroff" {
halt
}
menuentry "Reboot" {
reboot
}
'';
# Use NixOS hyperfluent theme for nicer-looking os-themed bootloader
theme = inputs.nixos-grub-themes.packages."${system}".hyperfluent;
};
efi.canTouchEfiVariables = true;
timeout = 10;
};
# Enable plymouth for a nicer boot sequence
plymouth = {
enable = true;
theme = "bgrt"; # Emulates windows-style boot animation (vendor + os + spinner)
};
# Configure silent boot (no logging displayed)
consoleLogLevel = 0;
initrd.verbose = false;
kernelParams = [
"quiet"
"splash"
"boot.shell_on_fail"
"loglevel=3"
"rd.systemd.show_status=false"
"rd.udev.log_level=3"
"udev.log_priority=3"
];
# Enable systemd early
initrd.systemd.enable = true;
};
}