From 2d92e9d55dcdf438213eea79075721b821def927 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Fri, 8 May 2026 20:48:05 -0700 Subject: [PATCH] Use WhiteSur ultrawide GRUB theme --- .../{grub-windows.nix => grub.nix} | 27 ++++++++++++++----- nixos/configuration.nix | 2 +- nixos/flake.lock | 21 +++++++++++++++ nixos/flake.nix | 4 +++ nixos/machines/ryzen-shine.nix | 11 +++++++- nixos/raspberry-pi.nix | 2 +- nixos/wsl.nix | 2 +- 7 files changed, 59 insertions(+), 10 deletions(-) rename nixos/bootloaders/{grub-windows.nix => grub.nix} (67%) diff --git a/nixos/bootloaders/grub-windows.nix b/nixos/bootloaders/grub.nix similarity index 67% rename from nixos/bootloaders/grub-windows.nix rename to nixos/bootloaders/grub.nix index 087ad849..152cf6c0 100644 --- a/nixos/bootloaders/grub-windows.nix +++ b/nixos/bootloaders/grub.nix @@ -3,11 +3,11 @@ lib, ... }: let - cfg = config.myModules.bootloaders.grubWindows; + cfg = config.myModules.bootloaders.grub; systemdBootCfg = config.myModules.bootloaders.systemdBoot; in { - options.myModules.bootloaders.grubWindows = { - enable = lib.mkEnableOption "GRUB with Windows chainloading support"; + options.myModules.bootloaders.grub = { + enable = lib.mkEnableOption "GRUB bootloader support"; configurationLimit = lib.mkOption { default = 5; @@ -24,6 +24,18 @@ in { entries discovered by os-prober. ''; }; + + theme = lib.mkOption { + default = null; + type = lib.types.nullOr lib.types.path; + description = "GRUB theme directory."; + }; + + gfxmode = lib.mkOption { + default = "auto"; + type = lib.types.str; + description = "GRUB graphical mode used for EFI and BIOS."; + }; }; config = lib.mkIf cfg.enable { @@ -31,14 +43,14 @@ in { { assertion = !systemdBootCfg.enable; message = '' - myModules.bootloaders.grubWindows.enable conflicts with + myModules.bootloaders.grub.enable conflicts with myModules.bootloaders.systemdBoot.enable. Disable systemdBoot before - enabling the GRUB Windows boot strategy. + enabling the GRUB boot strategy. ''; } { assertion = builtins.hasAttr "/boot" config.fileSystems; - message = "The GRUB Windows boot strategy expects an EFI filesystem mounted at /boot."; + message = "The GRUB boot strategy expects an EFI filesystem mounted at /boot."; } ]; @@ -55,6 +67,9 @@ in { useOSProber = true; configurationLimit = cfg.configurationLimit; timeoutStyle = "menu"; + theme = lib.mkIf (cfg.theme != null) (lib.mkDefault cfg.theme); + gfxmodeEfi = lib.mkDefault cfg.gfxmode; + gfxmodeBios = lib.mkDefault cfg.gfxmode; extraEntries = lib.optionalString (cfg.windowsEfiUuid != null) '' menuentry "Windows Boot Manager" { insmod part_gpt diff --git a/nixos/configuration.nix b/nixos/configuration.nix index 2bb02afe..5a8bbbe6 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -7,7 +7,7 @@ ./android.nix ./base.nix ./ben.nix - ./bootloaders/grub-windows.nix + ./bootloaders/grub.nix ./bootloaders/systemd-boot.nix ./cache-server.nix ./cache.nix diff --git a/nixos/flake.lock b/nixos/flake.lock index 38500f79..a97fcb7a 100644 --- a/nixos/flake.lock +++ b/nixos/flake.lock @@ -594,6 +594,26 @@ "type": "github" } }, + "grub2-themes": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1757136219, + "narHash": "sha256-tKU+vq34KHu/A2wD7WdgP5A4/RCmSD8hB0TyQAUlixA=", + "owner": "vinceliuice", + "repo": "grub2-themes", + "rev": "80dd04ddf3ba7b284a7b1a5df2b1e95ee2aad606", + "type": "github" + }, + "original": { + "owner": "vinceliuice", + "repo": "grub2-themes", + "type": "github" + } + }, "hercules-ci-effects": { "inputs": { "flake-parts": "flake-parts_3", @@ -1678,6 +1698,7 @@ "git-blame-rank": "git-blame-rank", "git-ignore-nix": "git-ignore-nix", "git-sync-rs": "git-sync-rs", + "grub2-themes": "grub2-themes", "home-manager": "home-manager", "hypr-workspace-history": "hypr-workspace-history", "hyprNStack": "hyprNStack", diff --git a/nixos/flake.nix b/nixos/flake.nix index fed1ad26..40666d65 100644 --- a/nixos/flake.nix +++ b/nixos/flake.nix @@ -236,6 +236,10 @@ }; }; + grub2-themes = { + url = "github:vinceliuice/grub2-themes"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = inputs @ { diff --git a/nixos/machines/ryzen-shine.nix b/nixos/machines/ryzen-shine.nix index fd3fca62..73c7a1d1 100644 --- a/nixos/machines/ryzen-shine.nix +++ b/nixos/machines/ryzen-shine.nix @@ -1,9 +1,11 @@ { + inputs, lib, pkgs, ... }: { imports = [ + inputs.grub2-themes.nixosModules.default ../configuration.nix ../nixified.ai.nix ]; @@ -41,9 +43,16 @@ boot.loader.systemd-boot.configurationLimit = 5; myModules.bootloaders.systemdBoot.enable = false; - myModules.bootloaders.grubWindows = { + myModules.bootloaders.grub = { enable = true; windowsEfiUuid = "B270-C7E6"; + gfxmode = "3440x1440,auto"; + }; + boot.loader.grub2-theme = { + enable = true; + theme = "whitesur"; + icon = "whitesur"; + screen = "ultrawide2k"; }; networking.hostName = "ryzen-shine"; diff --git a/nixos/raspberry-pi.nix b/nixos/raspberry-pi.nix index 746143f5..9a33b4b8 100644 --- a/nixos/raspberry-pi.nix +++ b/nixos/raspberry-pi.nix @@ -16,7 +16,7 @@ makeEnable config "myModules.raspberry-pi" false { hardware.raspberry-pi."4".fkms-3d.enable = true; # hardware.raspberry-pi."4".audio.enable = true; myModules.bootloaders.systemdBoot.enable = false; - myModules.bootloaders.grubWindows.enable = false; + myModules.bootloaders.grub.enable = false; boot = { initrd.systemd.tpm2.enable = false; diff --git a/nixos/wsl.nix b/nixos/wsl.nix index d2364d36..2ea05421 100644 --- a/nixos/wsl.nix +++ b/nixos/wsl.nix @@ -13,7 +13,7 @@ makeEnable config "myModules.wsl" false { myModules.base.enable = false; myModules.desktop.enable = false; myModules.bootloaders.systemdBoot.enable = false; - myModules.bootloaders.grubWindows.enable = false; + myModules.bootloaders.grub.enable = false; myModules.xmonad.enable = false; myModules.plasma.enable = false; # Tailscale-in-WSL is usually better handled by the Windows host Tailscale