Skip to content

Instantly share code, notes, and snippets.

@grahamc
Created August 30, 2019 02:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grahamc/43580a61505ed846604b82e1614c5240 to your computer and use it in GitHub Desktop.
Save grahamc/43580a61505ed846604b82e1614c5240 to your computer and use it in GitHub Desktop.
[
"sgdisk" "--new=1:0:512M" "--change-name=1:BIOS" "--typecode=1:ef00" "/dev/sdb",
"sgdisk" "--new=2:0:3993600" "--change-name=2:SWAP" "--typecode=2:8300" "/dev/sdb",
"sgdisk" "--new=3:0:0" "--change-name=3:ROOT" "--typecode=3:8300" "/dev/sdb",
"zpool" "create" "npool" "disk" "/dev/sda" "/dev/sdb3" "mirror" "/dev/sdc" "/dev/sdd" "raidz3" "/dev/sde" "/dev/sdf" "/dev/sdg",
"zfs" "create" "-o" "mountpoint=legacy" "npool/home",
"zfs" "create" "-o" "mountpoint=legacy" "npool/var",
"zfs" "create" "-o" "mountpoint=legacy" "npool/root",
"zfs" "create" "-o" "mountpoint=legacy" "npool/nix",
]
efi rewrite!
npool/root / zfs defaults 0 0
npool/nix /nix zfs defaults 0 0
npool/var /var zfs defaults 0 0
/dev/sdb2 none swap none 0 0
npool/home /home zfs defaults 0 0
/dev/sdb1 /boot vfat errors=remount-ro 0 2
efi rewrite!
fileSystems."/" = {
device = "npool/root";
fsType = "zfs";
options = "defaults";
};
fileSystems."/nix" = {
device = "npool/nix";
fsType = "zfs";
options = "defaults";
};
fileSystems."/var" = {
device = "npool/var";
fsType = "zfs";
options = "defaults";
};
fileSystems."/home" = {
device = "npool/home";
fsType = "zfs";
options = "defaults";
};
fileSystems."/boot" = {
device = "/dev/sdb1";
fsType = "vfat";
options = "errors=remount-ro";
};
!!!
swapDevices = [
{
device = "/dev/sdb2";
}
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment