diff --git a/hosts/Infini-STICK/default.nix b/hosts/Infini-STICK/default.nix index 5f4abc4..5b191d8 100644 --- a/hosts/Infini-STICK/default.nix +++ b/hosts/Infini-STICK/default.nix @@ -4,8 +4,6 @@ (with profiles; [ networking.wireless - - btrfs ]) ./hardware-configuration.nix @@ -21,7 +19,13 @@ form.portable = true; }; services.proxy.enable = true; + filesystems = { + enable = true; + btrfs.enable = true; + }; }; + environment.persistence."/persist" = { }; + system.stateVersion = "21.11"; } diff --git a/hosts/Infini-STICK/readme.org b/hosts/Infini-STICK/readme.org new file mode 100644 index 0000000..89121a4 --- /dev/null +++ b/hosts/Infini-STICK/readme.org @@ -0,0 +1,48 @@ +#+TITLE: Infini-STICK Specification +#+AUTHOR: Infinidoge + +* Partition Scheme + +| Position | Label | FS Type | Size | Type | +|----------+----------------+---------+-------+----------------------| +| 0 | =Infini-STICK= | =btrfs= | 29.3G | Root Partition | +| 1 | =boot= | =vfat= | 511M | EFI System Partition | + +* Configuration + +Setup with a wide array of hardware compatibility, specifically using the =portable= form defined in the =hardware/form= module. + +* Setup Script + +#+BEGIN_SRC bash :tangle setup.bash +#!/usr/bin/env bash +DISK=$1 + +sudo parted $DISK -- mktable gpt +sudo parted $DISK -- mkpart primary btrfs 512MiB 100% +sudo parted $DISK -- mkpart ESP fat32 1MiB 512MiB +sudo parted $DISK -- set 2 esp on + +sudo mkfs.btrfs "${DISK}1" -L "Infini-STICK" +sudo mkfs.fat -F 32 -n boot "${DISK}2" + +sudo mount "${DISK}1" /mnt +sudo btrfs subvolume create /mnt/root +sudo btrfs subvolume create /mnt/root/home +sudo mkdir -p /mnt/root/etc +sudo btrfs subvolume create /mnt/root/etc/nixos +sudo btrfs subvolume create /mnt/boot +sudo btrfs subvolume create /mnt/nix +sudo btrfs subvolume create /mnt/nix/store + + +sudo mount -t tmpfs root /mnt + +sudo mkdir -p /mnt/persist /mnt/nix /mnt/boot +sudo mount -o subvol=root,autodefrag,noatime "${DISK}1" /mnt/persist +sudo mount -o subvol=nix,autodefrag,noatime "${DISK}1" /mnt/nix +sudo mount -o subvol=boot,autodefrag,noatime "${DISK}1" /mnt/boot + +sudo mkdir -p /mnt/boot/efi +sudo mount "${DISK}2" /mnt/boot/efi +#+END_SRC diff --git a/hosts/Infini-STICK/setup.bash b/hosts/Infini-STICK/setup.bash new file mode 100644 index 0000000..f2f5ff6 --- /dev/null +++ b/hosts/Infini-STICK/setup.bash @@ -0,0 +1,30 @@ +#!/usr/bin/env bash +DISK=$1 + +sudo parted $DISK -- mktable gpt +sudo parted $DISK -- mkpart primary btrfs 512MiB 100% +sudo parted $DISK -- mkpart ESP fat32 1MiB 512MiB +sudo parted $DISK -- set 2 esp on + +sudo mkfs.btrfs "${DISK}1" -L "Infini-STICK" +sudo mkfs.fat -F 32 -n boot "${DISK}2" + +sudo mount "${DISK}1" /mnt +sudo btrfs subvolume create /mnt/root +sudo btrfs subvolume create /mnt/root/home +sudo mkdir -p /mnt/root/etc +sudo btrfs subvolume create /mnt/root/etc/nixos +sudo btrfs subvolume create /mnt/boot +sudo btrfs subvolume create /mnt/nix +sudo btrfs subvolume create /mnt/nix/store + + +sudo mount -t tmpfs root /mnt + +sudo mkdir -p /mnt/persist /mnt/nix /mnt/boot +sudo mount -o subvol=root,autodefrag,noatime "${DISK}1" /mnt/persist +sudo mount -o subvol=nix,autodefrag,noatime "${DISK}1" /mnt/nix +sudo mount -o subvol=boot,autodefrag,noatime "${DISK}1" /mnt/boot + +sudo mkdir -p /mnt/boot/efi +sudo mount "${DISK}2" /mnt/boot/efi