#!/usr/bin/env bash

# Build the Nomarchy Live ISO (Full Desktop Environment) using the flake.

echo "Building Nomarchy Live ISO..."

# The output will be a symlink named 'result' in the current directory
nix build .#nixosConfigurations.nomarchy-live.config.system.build.isoImage

if [ $? -eq 0 ]; then
    ISO_PATH=$(readlink -f result/iso/*.iso)
    echo "Success! Live ISO built at: $ISO_PATH"
    echo "You can now burn this to a USB drive using 'dd' or 'etcher'."
else
    echo "Error: Live ISO build failed."
    exit 1
fi
