hosts/Infini-STICK: begin new stick configuration

This commit is contained in:
Infinidoge 2021-12-08 18:50:34 -05:00
parent 19255f1942
commit 675335de37
3 changed files with 84 additions and 2 deletions

View file

@ -4,8 +4,6 @@
(with profiles; [ (with profiles; [
networking.wireless networking.wireless
btrfs
]) ])
./hardware-configuration.nix ./hardware-configuration.nix
@ -21,7 +19,13 @@
form.portable = true; form.portable = true;
}; };
services.proxy.enable = true; services.proxy.enable = true;
filesystems = {
enable = true;
btrfs.enable = true;
};
}; };
environment.persistence."/persist" = { };
system.stateVersion = "21.11"; system.stateVersion = "21.11";
} }

View file

@ -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

View file

@ -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