install.sh

918 B · raw

1#!/usr/bin/env bash2# Runs INSIDE the NixOS minimal installer (over serial) to lay down the golden3# system onto /dev/vda from the seed media. Driven by build-golden.sh.4set -euo pipefail56SEED_DIR="$(cd "$(dirname "$0")" && pwd)"7echo "=== NINA_INSTALL_START ==="89# Single BIOS-bootable ext4 root (MBR) — matches grub.device=/dev/vda.10parted -s /dev/vda mklabel msdos11parted -s /dev/vda mkpart primary ext4 1MiB 100%12parted -s /dev/vda set 1 boot on13mkfs.ext4 -F -L nixos /dev/vda11415mount /dev/disk/by-label/nixos /mnt1617# Generate hardware-configuration.nix for this disk, then drop in our config.18nixos-generate-config --root /mnt19cp "$SEED_DIR/configuration.nix" /mnt/etc/nixos/configuration.nix2021# Bake the injected nina binary (prove-the-loop: absolute-path /root/nina).22install -Dm755 "$SEED_DIR/nina" /mnt/root/nina2324nixos-install --no-root-passwd --root /mnt2526echo "=== NINA_INSTALL_DONE ==="27sync28poweroff