chore: helios fs

This commit is contained in:
Truxnell 2024-04-10 20:10:28 +10:00
parent 4427a56eaf
commit 853f858c80
2 changed files with 24 additions and 7 deletions

View file

@ -1,6 +1,12 @@
> https://grahamc.com/blog/erase-your-darlings/ > https://grahamc.com/blog/erase-your-darlings/
# Get hostid
run `head -c 8 /etc/machine-id`
and copy into networking.hostId to ensure ZFS doesnt get borked on reboot
# Partitioning # Partitioning
parted /dev/nvme0n1 -- mklabel gpt parted /dev/nvme0n1 -- mklabel gpt
parted /dev/nvme0n1 -- mkpart root ext4 512MB -8GB parted /dev/nvme0n1 -- mkpart root ext4 512MB -8GB
parted /dev/nvme0n1 -- mkpart swap linux-swap -8GB 100% parted /dev/nvme0n1 -- mkpart swap linux-swap -8GB 100%
@ -8,18 +14,24 @@ parted /dev/nvme0n1 -- mkpart ESP fat32 1MB 512MB
parted /dev/nvme0n1 -- set 3 esp on parted /dev/nvme0n1 -- set 3 esp on
# Formatting # Formatting
mkswap -L swap /dev/nvme0n1p2 mkswap -L swap /dev/nvme0n1p2
swapon /dev/nvme0n1p2
mkfs.fat -F 32 -n boot /dev/nvme0n1p3 mkfs.fat -F 32 -n boot /dev/nvme0n1p3
# ZFS on root partition # ZFS on root partition
zpool create -O mountpoint=none rpool /dev/nvme0n1p1 zpool create -O mountpoint=none rpool /dev/nvme0n1p1
zfs create -p -o mountpoint=none rpool/local/root zfs create -p -o mountpoint=legacy rpool/local/root
## immediate blank snapshot ## immediate blank snapshot
zfs snapshot rpool/local/root@blank zfs snapshot rpool/local/root@blank
mount -t zfs rpool/local/root /mnt mount -t zfs rpool/local/root /mnt
# Boot partition # Boot partition
mkdir /mnt/boot mkdir /mnt/boot
mount /dev/nvme0n1p3 /mnt/boot mount /dev/nvme0n1p3 /mnt/boot
@ -38,4 +50,4 @@ zfs create -p -o mountpoint=legacy rpool/safe/persist
mkdir /mnt/persist mkdir /mnt/persist
mount -t zfs rpool/safe/persist /mnt/persist mount -t zfs rpool/safe/persist /mnt/persist
Set `networking.hostid`` in the nixos config to `head -c 8 /etc/machine-id` Set ` networking.hostid`` in the nixos config to `head -c 8 /etc/machine-id`

View file

@ -64,6 +64,12 @@
fsType = "zfs"; fsType = "zfs";
}; };
fileSystems."/boot" =
{
device = "/dev/disk/by-uuid/4D87-0642";
fsType = "vfat";
};
fileSystems."/nix" = fileSystems."/nix" =
{ {
device = "rpool/local/nix"; device = "rpool/local/nix";
@ -75,11 +81,10 @@
device = "rpool/safe/persist"; device = "rpool/safe/persist";
fsType = "zfs"; fsType = "zfs";
}; };
fileSystems."/boot" =
{ swapDevices =
device = "/dev/disk/by-uuid/B19B-8223"; [{ device = "/dev/disk/by-uuid/4939bb1a-221c-455a-9011-a633f81490da"; }];
fsType = "vfat";
};
swapDevices = swapDevices =