diff --git a/docs/install-help.txt b/docs/install-help.txt index 85f2bda..a6fff46 100644 --- a/docs/install-help.txt +++ b/docs/install-help.txt @@ -1,16 +1,22 @@ -NixOS installer (flake + Lix) -============================= +Nanuqsaurus NixOS installer +=========================== -1) Build is prewired with Lix; the installer ISO includes the repo at /etc/nixos. -2) Run the non-interactive Btrfs installer (set envs as needed): +Run the non-interactive installer: - sudo DISK=/dev/vda HOSTNAME=installer /etc/nixos/scripts/install-btrfs.sh + sudo /etc/nixos/scripts/install-btrfs.sh - Defaults: DISK=/dev/vda, HOSTNAME=installer - The script wipes the disk, creates Btrfs subvolumes (root, home, nix), copies the flake, generates hardware config, and installs with the chosen host name. -3) After install finishes, reboot into the new system. +Optionally set DISK and HOSTNAME -Notes -- Filesystem is Btrfs with subvolumes: root, home, nix. -- The flake lives under /etc/nixos on the target; edit hosts/.nix to customize. + sudo DISK=/dev/vda HOSTNAME=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. + + +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 + + +After install finishes, reboot into the new system. \ No newline at end of file diff --git a/hosts/installer.nix b/hosts/installer.nix index 1f8b7a9..fc46ed7 100644 --- a/hosts/installer.nix +++ b/hosts/installer.nix @@ -8,7 +8,7 @@ ../modules/users/admin.nix ]; - networking.hostName = "nix-installer"; + networking.hostName = "nanuqsaurus"; environment.etc."INSTALL.txt".source = ../docs/install-help.txt; environment.etc."motd".text = builtins.readFile ../docs/install-help.txt; diff --git a/scripts/install-btrfs.sh b/scripts/install-btrfs.sh old mode 100644 new mode 100755 index 0d306f5..2deddfe --- a/scripts/install-btrfs.sh +++ b/scripts/install-btrfs.sh @@ -2,14 +2,16 @@ set -euo pipefail # Non-interactive Btrfs installer using the flake in this repo. -# Defaults: DISK=/dev/vda HOSTNAME=installer +# Defaults: DISK=/dev/vda HOSTNAME=nanuqsaurus DISK=${DISK:-/dev/vda} -HOSTNAME=${HOSTNAME:-installer} +HOSTNAME=${HOSTNAME:-nanuqsaurus} SCRIPT_DIR=$(cd -- "$(dirname "${BASH_SOURCE[0]}")" && pwd) REPO_ROOT=$(cd -- "${SCRIPT_DIR}/.." && pwd) +clear + echo "[1/7] Partitioning ${DISK}" printf "label: gpt\n,550M,U\n,,L\n" | sfdisk "${DISK}"