Files
Nomarchy/themes/engine/scripts/nomarchy-themes-prebuild
Bernardo Magri fb4755fdbf docs(theme): correct nomarchy-themes-prebuild header comment
The header said "Run once after install (the installer wires this
up)". The installer doesn't actually wire it up — install.sh:1848
prints a final-screen tip telling the user to run it, but doesn't
invoke it (pre-realising every theme adds significant install time
and the user can opt in later). Corrected the comment to match.
2026-05-21 20:41:43 +01:00

26 lines
920 B
Bash
Executable File

#!/usr/bin/env bash
# Pre-realise every theme's Home Manager generation into the Nix store so
# future `nomarchy-theme-set` swaps are cache hits — no Stylix rebuild, no
# downloads. Run once after install (the installer's final message prompts
# you to do so) and again after adding or updating palettes.
set -e
if [ -f "/etc/nixos/flake.nix" ]; then
REPO_DIR="/etc/nixos"
elif [ -f "/etc/nomarchy/flake.nix" ]; then
REPO_DIR="/etc/nomarchy"
else
echo "Error: Nomarchy flake repository not found in /etc/nixos or /etc/nomarchy." >&2
exit 1
fi
echo "Pre-building every theme variant from $REPO_DIR#allThemeVariants..."
echo "This is a one-time cache warm-up. Subsequent theme switches will be instant."
nix build --no-link --print-out-paths \
--extra-experimental-features "nix-command flakes" \
"$REPO_DIR#allThemeVariants"
echo "Theme variants cached. Theme switches now avoid rebuilds."