diff --git a/docs/ROADMAP.md b/docs/ROADMAP.md index 669a922..ebb5df1 100644 --- a/docs/ROADMAP.md +++ b/docs/ROADMAP.md @@ -215,10 +215,28 @@ how to override it. Items marked ✓ are shipped. ✓ `isoImage.splashImage` — the vendored vector logo (`modules/nixos/branding/logo.svg`, from legacy) recolored to the palette accent on the theme base, built at ISO-build time (`hosts/live.nix`). - Remaining: `isoImage.grubTheme` so UEFI boot matches the isolinux splash - (needs a full grub theme dir), and the `distroId` question (it changes - `DEFAULT_HOSTNAME` and upstream `isNixos` checks — needs a test pass; - nixos-* CLI names stay regardless) + ✓ **`isoImage.grubTheme` (UEFI boot matches BIOS):** `hosts/live.nix` now + builds a `nomarchyGrubTheme` dir whose background is the *same* composed + splash image as the isolinux splash (accent logo on base), with a + palette-coloured boot menu in the lower third (clear of the centred logo) + and an accent timeout bar. Derived from `nixos-grub2-theme` only to reuse + its bundled DejaVu `.pf2` (grub `loadfont`s every `.pf2` in the dir); the + stock NixOS `logo.png` is dropped since ours is in the background. Built + + structure-verified (theme.txt palette colours, 1920×1080 background, font + present). Remaining: a UEFI ISO-boot render check on hardware (the file + wiring is confirmed; the visual is not CI-testable, same as the splash). + ✓ **`distroId = "nomarchy"`:** os-release is now honest — `ID=nomarchy`, + `ID_LIKE=nixos` (the standard derivative-distro lineage marker, cf. + Ubuntu→debian), `DEFAULT_HOSTNAME=nomarchy`, lsb `DISTRIB_ID`/`CPE_NAME` + follow. **Verified safe:** `switch-to-configuration` builds its "is this + NixOS?" guard from the *configured* distroId (and `/etc/NIXOS` remains as + the fallback), so rebuilds keep working — a new `checks.distro-id` + VM-test boots such a system and runs `switch-to-configuration dry-activate` + green; nixos-* CLI tools are package names, untouched. The one side effect + (isNixos→false blanks the upstream nixos.org URLs) is handled by + `extraOSReleaseArgs` restoring `HOME_URL`/`DOCUMENTATION_URL`/`SUPPORT_URL`/ + `BUG_REPORT_URL` to the project. os-release output eval-verified from the + real downstream config. - ✓ **fastfetch branding:** `modules/home/fastfetch.nix` (`nomarchy.fastfetch.enable`) — the vendored vector logo, recolored to the palette accent and rendered to compact block-art via chafa at build diff --git a/flake.nix b/flake.nix index f8dfeb1..e56c2e0 100644 --- a/flake.nix +++ b/flake.nix @@ -206,6 +206,40 @@ ) ''; }; + + # The distroId question (roadmap "Distro branding"): set + # distroId = "nomarchy" so /etc/os-release is honest (ID=nomarchy, + # ID_LIKE=nixos). The risk is switch-to-configuration's "is this + # NixOS?" guard — but it builds the check from the *configured* + # distroId (and /etc/NIXOS still exists), so a rebuild must still + # work. This boots such a system and runs `switch-to-configuration + # dry-activate` to prove the guard passes. Inline (not the full + # module) so the VM stays minimal — the real wiring in default.nix + # is covered by the downstream-template-system build. + distro-id = pkgs.testers.runNixOSTest { + name = "nomarchy-distro-id"; + nodes.machine = { ... }: { + system.nixos.distroName = "Nomarchy"; + system.nixos.distroId = "nomarchy"; + # Test base omits switch-to-configuration by default; we need it + # to exercise the "is this NixOS?" guard. + system.switch.enable = true; + }; + testScript = { nodes, ... }: '' + machine.wait_for_unit("multi-user.target") + + # os-release reflects the rebrand, with the nixos lineage marker. + machine.succeed("grep -q '^ID=nomarchy$' /etc/os-release") + machine.succeed("grep -q '^ID_LIKE=nixos$' /etc/os-release") + machine.succeed("grep -q '^NAME=Nomarchy$' /etc/os-release") + + # The rebuild path must still recognise this as a NixOS install + # (the guard is built from the configured distroId, not "nixos"). + machine.succeed( + "${nodes.machine.system.build.toplevel}/bin/switch-to-configuration dry-activate" + ) + ''; + }; }; # ─── Reference host ──────────────────────────────────────────── diff --git a/hosts/live.nix b/hosts/live.nix index a8e9b2f..538e091 100644 --- a/hosts/live.nix +++ b/hosts/live.nix @@ -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 diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix index f0f3046..70d04da 100644 --- a/modules/nixos/default.nix +++ b/modules/nixos/default.nix @@ -25,11 +25,25 @@ in imports = [ ./options.nix ./plymouth.nix ./file-manager.nix ./power.nix ./services.nix ./hardware.nix ./timezone.nix ]; config = { - # The safe half of distro branding: distroName flows into - # /etc/os-release PRETTY_NAME, systemd-boot entry titles and the - # ISO boot-menu label. distroId stays "nixos" on purpose — it feeds - # DEFAULT_HOSTNAME and upstream isNixos checks (see roadmap). + # Distro branding. distroName flows into /etc/os-release PRETTY_NAME, + # systemd-boot entry titles and the ISO boot-menu label; distroId is the + # machine-readable ID (DEFAULT_HOSTNAME, lsb DISTRIB_ID, CPE name). + # distroId = "nomarchy" makes os-release honest — ID=nomarchy with + # ID_LIKE=nixos, the standard derivative-distro lineage marker (cf. + # Ubuntu→debian) — and is safe: switch-to-configuration builds its + # "is this NixOS?" guard from the *configured* distroId (and /etc/NIXOS + # still exists as the fallback), so rebuilds keep working; the nixos-* + # CLI tools are package names, untouched. The one side effect is that + # isNixos goes false and blanks the upstream nixos.org URLs, so we + # restore them pointing at the project instead. system.nixos.distroName = lib.mkDefault "Nomarchy"; + system.nixos.distroId = lib.mkDefault "nomarchy"; + system.nixos.extraOSReleaseArgs = lib.mkDefault { + HOME_URL = "https://git.bemagri.xyz/bernardo/Nomarchy"; + DOCUMENTATION_URL = "https://git.bemagri.xyz/bernardo/Nomarchy"; + SUPPORT_URL = "https://git.bemagri.xyz/bernardo/Nomarchy"; + BUG_REPORT_URL = "https://git.bemagri.xyz/bernardo/Nomarchy/issues"; + }; # MOTD on TTY/SSH login (the desktop auto-logs into Hyprland, so this # is mostly seen over SSH or on a bare console). Branded, and doubles