{ config, pkgs, lib, ... }: let hostname = config.networking.hostName or "traveldroid"; in { ################################# # Bootloader (UEFI + GRUB) ################################# boot.loader = { efi = { canTouchEfiVariables = true; efiSysMountPoint = "/boot"; }; grub = { enable = true; efiSupport = true; device = "nodev"; # safe for UEFI useOSProber = true; }; timeout = 5; }; ################################# # Kernel / initrd ################################# boot.kernelPackages = pkgs.linuxPackages_latest; boot.kernelParams = [ "quiet" "splash" "udev.log_level=3" "rd.systemd.show_status=false" ]; boot.consoleLogLevel = 0; boot.initrd.systemd.enable = true; boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" "rtsx_usb_sdmmc" ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-intel" ]; boot.extraModulePackages = [ ]; ################################# # Plymouth boot splash ################################# boot.plymouth = { enable = true; theme = "rings"; themePackages = [ (pkgs.adi1090x-plymouth-themes.override { selected_themes = [ "rings" ]; }) ]; }; ################################# # CPU microcode ################################# hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; ################################# # Nix host platform ################################# nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; ################################# # System state version ################################# system.stateVersion = "26.05"; ################################# # Automatic GRUB update after rebuild ################################# system.postBootCommands = '' echo "Regenerating GRUB menu..." ${pkgs.nixosModules.grub}/bin/grub-mkconfig -o /boot/grub/grub.cfg || true ''; systemd.services.grub-update = { description = "Update GRUB menu on boot"; after = [ "local-fs.target" ]; wantedBy = [ "multi-user.target" ]; serviceConfig = { Type = "oneshot"; ExecStart = "${pkgs.nixosModules.grub}/bin/grub-mkconfig -o /boot/grub/grub.cfg"; RemainAfterExit = true; }; }; }