feat(install): add disko direct-url workflow

This commit is contained in:
randogoth 2026-02-04 15:57:45 +02:00
parent 7a42926fba
commit 973bac7ed0
8 changed files with 154 additions and 92 deletions

View file

@ -1,22 +1,37 @@
Nanuqsaurus NixOS installer
===========================
Run the non-interactive installer:
Direct-from-URL install (wipes the whole disk)
---------------------------------------------
Pick a stable disk path (prefer /dev/disk/by-id/*) and run:
sudo nix --experimental-features "nix-command flakes" \
run github:nix-community/disko/latest#disko-install -- \
--mode format \
--flake "git+https://codeberg.org/<owner>/<repo>.git#nanuqsaurus" \
--disk main /dev/disk/by-id/<your-disk> \
--mount-point /mnt
ISO shortcut
------------
If you are using the custom ISO from this repo, it embeds the flake at /etc/nixos.
You can run the wrapper script (defaults: DISK=/dev/vda, TARGET_HOST=nanuqsaurus):
sudo /etc/nixos/scripts/install-btrfs.sh
Optionally set DISK and TARGET_HOST (defaults: DISK=/dev/vda, TARGET_HOST=nanuqsaurus)
Optionally set DISK, TARGET_HOST, and FLAKE:
sudo DISK=/dev/vda TARGET_HOST=nanuqsaurus /etc/nixos/scripts/install-btrfs.sh
sudo DISK=/dev/disk/by-id/<your-disk> TARGET_HOST=nanuqsaurus \
FLAKE="github:<owner>/<repo>" \
/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).
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#local-${TARGET_HOST}" --no-root-passwd
This uses disko to create a GPT disk with a 550M EFI partition and a Btrfs partition
containing subvolumes root, home, and nix, mounted with compress=zstd.
After install finishes, reboot into the new system.