feat(branding): GRUB (UEFI) theme + distroId=nomarchy
Completes the remaining "Distro branding, round 2" work. GRUB theme: hosts/live.nix builds nomarchyGrubTheme whose background is the same composed splash as the isolinux/BIOS splash (accent logo on base), with a palette-coloured boot menu and accent timeout bar. Derived from nixos-grub2-theme only to reuse its bundled DejaVu .pf2; the stock NixOS logo is dropped (ours is in the background). Wired as isoImage.grubTheme so UEFI boot matches BIOS. distroId: set system.nixos.distroId = "nomarchy" so os-release is honest (ID=nomarchy, ID_LIKE=nixos). Safe — switch-to-configuration builds its "is this NixOS?" guard from the configured distroId (and /etc/NIXOS is the fallback), so rebuilds keep working. isNixos→false blanks the nixos.org URLs, so extraOSReleaseArgs restores them to the project. Adds checks.distro-id (runNixOSTest): boots distroId=nomarchy and runs switch-to-configuration dry-activate green; os-release eval-verified from the real downstream config; grub theme built + structure-verified. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -4,26 +4,85 @@
|
||||
{ lib, pkgs, username, nomarchySrc, ... }:
|
||||
|
||||
let
|
||||
# ISO boot splash: the Nomarchy monogram recolored to the palette accent,
|
||||
# ISO boot branding: the Nomarchy monogram recolored to the palette accent,
|
||||
# centred on the theme base. Built from the vendored vector logo and the
|
||||
# live theme-state.json (tokyo-night by default). Shows on the isolinux
|
||||
# (BIOS) boot menu; UEFI/GRUB still uses the stock theme (see roadmap).
|
||||
# live theme-state.json (tokyo-night by default). The same composed image
|
||||
# backs both the isolinux (BIOS) splash and the GRUB (UEFI) theme below, so
|
||||
# the two boot paths match.
|
||||
state = builtins.fromJSON (builtins.readFile ../theme-state.json);
|
||||
isoColor = key: fallback: lib.removePrefix "#" ((state.colors or { }).${key} or fallback);
|
||||
accent = isoColor "accent" "7aa2f7";
|
||||
base = isoColor "base" "1a1b26";
|
||||
subtext = isoColor "subtext" "787c99";
|
||||
|
||||
isoSplash = pkgs.runCommand "nomarchy-iso-splash.png"
|
||||
{ nativeBuildInputs = [ pkgs.imagemagick pkgs.librsvg ]; } ''
|
||||
rsvg-convert -h 320 ${../modules/nixos/branding/logo.svg} > logo.png
|
||||
magick logo.png -fill "#${isoColor "accent" "7aa2f7"}" -colorize 100 logo-c.png
|
||||
magick -size 1920x1080 xc:"#${isoColor "base" "1a1b26"}" \
|
||||
magick logo.png -fill "#${accent}" -colorize 100 logo-c.png
|
||||
magick -size 1920x1080 xc:"#${base}" \
|
||||
logo-c.png -gravity center -composite $out
|
||||
'';
|
||||
|
||||
# GRUB (UEFI) theme matched to the BIOS splash: the same accent-logo-on-base
|
||||
# image as the background, plus a palette-coloured boot menu in the lower
|
||||
# third (clear of the centred logo). Derived from nixos-grub2-theme only to
|
||||
# reuse its bundled DejaVu .pf2 font — we overwrite the background and
|
||||
# theme.txt and drop the stock NixOS logo (ours is in the background). grub
|
||||
# loads every .pf2 in the dir, so "DejaVu Regular" resolves.
|
||||
grubThemeTxt = pkgs.writeText "nomarchy-grub-theme.txt" ''
|
||||
title-text: ""
|
||||
desktop-image: "background.png"
|
||||
desktop-color: "#${base}"
|
||||
|
||||
message-font: "DejaVu Regular"
|
||||
message-color: "#${subtext}"
|
||||
terminal-font: "DejaVu Regular"
|
||||
|
||||
+ boot_menu {
|
||||
left = 50%-300
|
||||
width = 600
|
||||
top = 64%
|
||||
height = 26%
|
||||
item_font = "DejaVu Regular"
|
||||
item_color = "#${subtext}"
|
||||
item_height = 36
|
||||
item_spacing = 6
|
||||
selected_item_font = "DejaVu Regular"
|
||||
selected_item_color = "#${accent}"
|
||||
scrollbar = false
|
||||
}
|
||||
|
||||
+ progress_bar {
|
||||
id = "__timeout__"
|
||||
left = 50%-300
|
||||
top = 92%
|
||||
width = 600
|
||||
height = 16
|
||||
show_text = true
|
||||
text = "@TIMEOUT_NOTIFICATION_MIDDLE@"
|
||||
font = "DejaVu Regular"
|
||||
text_color = "#${subtext}"
|
||||
border_color = "#${accent}"
|
||||
bg_color = "#${base}"
|
||||
fg_color = "#${accent}"
|
||||
}
|
||||
'';
|
||||
|
||||
nomarchyGrubTheme = pkgs.runCommand "nomarchy-grub-theme" { } ''
|
||||
cp -r ${pkgs.nixos-grub2-theme} $out
|
||||
chmod -R u+w $out
|
||||
cp ${isoSplash} $out/background.png
|
||||
cp ${grubThemeTxt} $out/theme.txt
|
||||
rm -f $out/logo.png
|
||||
'';
|
||||
in
|
||||
{
|
||||
networking.hostName = "nomarchy-live";
|
||||
|
||||
isoImage.volumeID = lib.mkForce "NOMARCHY_LIVE";
|
||||
isoImage.edition = lib.mkForce "live";
|
||||
isoImage.splashImage = isoSplash;
|
||||
isoImage.splashImage = isoSplash; # isolinux / BIOS
|
||||
isoImage.grubTheme = nomarchyGrubTheme; # GRUB / UEFI
|
||||
|
||||
# The minimal-CD profile slims the image for a CONSOLE installer; this
|
||||
# ISO is the desktop, so re-enable what it strips. Above all
|
||||
|
||||
Reference in New Issue
Block a user