Use WhiteSur ultrawide GRUB theme

This commit is contained in:
2026-05-08 20:48:05 -07:00
parent b8e6abd628
commit 2d92e9d55d
7 changed files with 59 additions and 10 deletions

View File

@@ -3,11 +3,11 @@
lib, lib,
... ...
}: let }: let
cfg = config.myModules.bootloaders.grubWindows; cfg = config.myModules.bootloaders.grub;
systemdBootCfg = config.myModules.bootloaders.systemdBoot; systemdBootCfg = config.myModules.bootloaders.systemdBoot;
in { in {
options.myModules.bootloaders.grubWindows = { options.myModules.bootloaders.grub = {
enable = lib.mkEnableOption "GRUB with Windows chainloading support"; enable = lib.mkEnableOption "GRUB bootloader support";
configurationLimit = lib.mkOption { configurationLimit = lib.mkOption {
default = 5; default = 5;
@@ -24,6 +24,18 @@ in {
entries discovered by os-prober. 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 { config = lib.mkIf cfg.enable {
@@ -31,14 +43,14 @@ in {
{ {
assertion = !systemdBootCfg.enable; assertion = !systemdBootCfg.enable;
message = '' message = ''
myModules.bootloaders.grubWindows.enable conflicts with myModules.bootloaders.grub.enable conflicts with
myModules.bootloaders.systemdBoot.enable. Disable systemdBoot before myModules.bootloaders.systemdBoot.enable. Disable systemdBoot before
enabling the GRUB Windows boot strategy. enabling the GRUB boot strategy.
''; '';
} }
{ {
assertion = builtins.hasAttr "/boot" config.fileSystems; 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; useOSProber = true;
configurationLimit = cfg.configurationLimit; configurationLimit = cfg.configurationLimit;
timeoutStyle = "menu"; 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) '' extraEntries = lib.optionalString (cfg.windowsEfiUuid != null) ''
menuentry "Windows Boot Manager" { menuentry "Windows Boot Manager" {
insmod part_gpt insmod part_gpt

View File

@@ -7,7 +7,7 @@
./android.nix ./android.nix
./base.nix ./base.nix
./ben.nix ./ben.nix
./bootloaders/grub-windows.nix ./bootloaders/grub.nix
./bootloaders/systemd-boot.nix ./bootloaders/systemd-boot.nix
./cache-server.nix ./cache-server.nix
./cache.nix ./cache.nix

21
nixos/flake.lock generated
View File

@@ -594,6 +594,26 @@
"type": "github" "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": { "hercules-ci-effects": {
"inputs": { "inputs": {
"flake-parts": "flake-parts_3", "flake-parts": "flake-parts_3",
@@ -1678,6 +1698,7 @@
"git-blame-rank": "git-blame-rank", "git-blame-rank": "git-blame-rank",
"git-ignore-nix": "git-ignore-nix", "git-ignore-nix": "git-ignore-nix",
"git-sync-rs": "git-sync-rs", "git-sync-rs": "git-sync-rs",
"grub2-themes": "grub2-themes",
"home-manager": "home-manager", "home-manager": "home-manager",
"hypr-workspace-history": "hypr-workspace-history", "hypr-workspace-history": "hypr-workspace-history",
"hyprNStack": "hyprNStack", "hyprNStack": "hyprNStack",

View File

@@ -236,6 +236,10 @@
}; };
}; };
grub2-themes = {
url = "github:vinceliuice/grub2-themes";
inputs.nixpkgs.follows = "nixpkgs";
};
}; };
outputs = inputs @ { outputs = inputs @ {

View File

@@ -1,9 +1,11 @@
{ {
inputs,
lib, lib,
pkgs, pkgs,
... ...
}: { }: {
imports = [ imports = [
inputs.grub2-themes.nixosModules.default
../configuration.nix ../configuration.nix
../nixified.ai.nix ../nixified.ai.nix
]; ];
@@ -41,9 +43,16 @@
boot.loader.systemd-boot.configurationLimit = 5; boot.loader.systemd-boot.configurationLimit = 5;
myModules.bootloaders.systemdBoot.enable = false; myModules.bootloaders.systemdBoot.enable = false;
myModules.bootloaders.grubWindows = { myModules.bootloaders.grub = {
enable = true; enable = true;
windowsEfiUuid = "B270-C7E6"; windowsEfiUuid = "B270-C7E6";
gfxmode = "3440x1440,auto";
};
boot.loader.grub2-theme = {
enable = true;
theme = "whitesur";
icon = "whitesur";
screen = "ultrawide2k";
}; };
networking.hostName = "ryzen-shine"; networking.hostName = "ryzen-shine";

View File

@@ -16,7 +16,7 @@ makeEnable config "myModules.raspberry-pi" false {
hardware.raspberry-pi."4".fkms-3d.enable = true; hardware.raspberry-pi."4".fkms-3d.enable = true;
# hardware.raspberry-pi."4".audio.enable = true; # hardware.raspberry-pi."4".audio.enable = true;
myModules.bootloaders.systemdBoot.enable = false; myModules.bootloaders.systemdBoot.enable = false;
myModules.bootloaders.grubWindows.enable = false; myModules.bootloaders.grub.enable = false;
boot = { boot = {
initrd.systemd.tpm2.enable = false; initrd.systemd.tpm2.enable = false;

View File

@@ -13,7 +13,7 @@ makeEnable config "myModules.wsl" false {
myModules.base.enable = false; myModules.base.enable = false;
myModules.desktop.enable = false; myModules.desktop.enable = false;
myModules.bootloaders.systemdBoot.enable = false; myModules.bootloaders.systemdBoot.enable = false;
myModules.bootloaders.grubWindows.enable = false; myModules.bootloaders.grub.enable = false;
myModules.xmonad.enable = false; myModules.xmonad.enable = false;
myModules.plasma.enable = false; myModules.plasma.enable = false;
# Tailscale-in-WSL is usually better handled by the Windows host Tailscale # Tailscale-in-WSL is usually better handled by the Windows host Tailscale