1
Fork 0
mirror of https://github.com/RGBCube/HTMNIX synced 2025-07-26 07:27:44 +00:00

Use a proper env var for the flakeref in build.sh

This commit is contained in:
RGBCube 2024-02-28 12:49:37 +03:00
parent 8d3f0fdde6
commit ebc812fbe7
No known key found for this signature in database

View file

@ -9,17 +9,11 @@ for dir in $(find site -type d); do
mkdir -p "_$dir" mkdir -p "_$dir"
done done
if [[ "$HTMNIX_LOCAL" == 1 ]]; then
FLAKE_REF=.
else
FLAKE_REF=github:RGBCube/HTMNIX
fi
for file in $(find site -type f); do for file in $(find site -type f); do
if [[ ! "$file" =~ ^_ ]]; then if [[ ! "$file" =~ ^_ ]]; then
if [[ "$file" =~ .nix$ ]]; then if [[ "$file" =~ .nix$ ]]; then
echo "Processing file $file to _${file%.nix}.html..." echo "Processing file $file to _${file%.nix}.html..."
TARGET_FILE=$(realpath "$file") nix eval "$FLAKE_REF#result" --impure --raw --apply toString > "_${file%.nix}.html" TARGET_FILE=$(realpath "$file") nix eval "${HTMNIX_REF:-github:RGBCube/HTMNIX}#result" --impure --raw --apply toString > "_${file%.nix}.html"
echo "Done!" echo "Done!"
else else
echo "Copying file $file to _$file..." echo "Copying file $file to _$file..."