Add HM bootstrap script and tidy installer workflow

This commit is contained in:
randogoth 2026-02-02 14:04:56 +02:00
parent dd15c09fdd
commit d1713bdc99
10 changed files with 184 additions and 43 deletions

View file

@ -6,9 +6,9 @@ Run the non-interactive installer:
sudo /etc/nixos/scripts/install-btrfs.sh
Optionally set DISK and HOSTNAME (defaults: DISK=/dev/vda, HOSTNAME=nanuqsaurus)
Optionally set DISK and TARGET_HOST (defaults: DISK=/dev/vda, TARGET_HOST=nanuqsaurus)
sudo DISK=/dev/vda HOSTNAME=nanuqsaurus /etc/nixos/scripts/install-btrfs.sh
sudo DISK=/dev/vda TARGET_HOST=nanuqsaurus /etc/nixos/scripts/install-btrfs.sh
The script wipes the whole disk, creates Btrfs subvolumes (root, home, nix), copies the flake, generates hardware config, and installs. It writes host files under `/etc/nixos/hosts/local-<hostname>.nix` and `local-<hostname>-hardware.nix` (kept local to the machine).
@ -16,7 +16,7 @@ The script wipes the whole disk, creates Btrfs subvolumes (root, home, nix), cop
If you need a more custom setup please run the partitioning manually, mount the target to /mnt and then install the system:
nixos-install --root /mnt --flake "/mnt/etc/nixos#${HOSTNAME}" --no-root-passwd
nixos-install --root /mnt --flake "/mnt/etc/nixos#local-${TARGET_HOST}" --no-root-passwd
After install finishes, reboot into the new system.