Initial NixOS + Home Manager config for aspire-laptop

This commit is contained in:
sam
2026-01-05 22:01:55 +11:00
parent ea45405814
commit 735f19049d
39 changed files with 1009 additions and 0 deletions

47
scripts/install-from-iso.sh Executable file
View File

@@ -0,0 +1,47 @@
#!/usr/bin/env bash
set -euo pipefail
DISK="${DISK:-/dev/sda}"
echo "About to WIPE: ${DISK}"
lsblk "${DISK}" || true
read -r -p 'Type WIPE to continue: ' CONFIRM
if [ "${CONFIRM}" != "WIPE" ]; then
echo "Aborted."
exit 1
fi
wipefs -a "${DISK}"
parted -s "${DISK}" mklabel gpt
parted -s "${DISK}" mkpart ESP fat32 1MiB 513MiB
parted -s "${DISK}" set 1 esp on
parted -s "${DISK}" mkpart primary btrfs 513MiB 100%
EFI_PART="${DISK}1"
ROOT_PART="${DISK}2"
mkfs.fat -F 32 "${EFI_PART}"
mkfs.btrfs -f "${ROOT_PART}"
mount "${ROOT_PART}" /mnt
btrfs subvolume create /mnt/@
btrfs subvolume create /mnt/@home
umount /mnt
mount -o subvol=@,compress=zstd,noatime "${ROOT_PART}" /mnt
mkdir -p /mnt/home
mount -o subvol=@home,compress=zstd,noatime "${ROOT_PART}" /mnt/home
mkdir -p /mnt/boot/efi
mount "${EFI_PART}" /mnt/boot/efi
nixos-generate-config --root /mnt
echo
echo "Partitioning done."
echo "Generated /mnt/etc/nixos/hardware-configuration.nix"
echo "Next steps:"
echo "1) Put your flake repo at /mnt/etc/nixos (clone it there)."
echo "2) Copy /mnt/etc/nixos/hardware-configuration.nix into:"
echo " /mnt/etc/nixos/hosts/aspire-laptop/hardware-configuration.nix"
echo "3) Run: nixos-install --flake /mnt/etc/nixos#aspire-laptop"