From 2be4a5df9de45ab128693086c581588c053b740c Mon Sep 17 00:00:00 2001 From: baritone Date: Tue, 15 Apr 2025 11:30:05 +0200 Subject: [PATCH] added more comments to disko config --- disko.nix | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/disko.nix b/disko.nix index 98f064a..a2e8b6b 100755 --- a/disko.nix +++ b/disko.nix @@ -8,12 +8,14 @@ disko.devices = { disk = { + # Main SSD where /nix/store /etc /boot etc. is located. main = { type = "disk"; device = root-disk; content = { type = "gpt"; partitions = { + # Define a 512 megabyte boot partition boot = { size = "512M"; type = "EF00"; @@ -24,6 +26,7 @@ mountOptions = ["umask=0077"]; }; }; + # If the swap argument is defined then create a swap partition of the given size swap = lib.mkIf (swap-size != -1) { size = swap-size; content = { @@ -32,6 +35,7 @@ resumeDevice = true; }; }; + # Finally allocate the rest of the disk as a zfs device root = { size = "100%"; content = { @@ -62,12 +66,13 @@ }); zpool = { + # Set up zroot pool zroot = { type = "zpool"; rootFsOptions = { mountpoint = "none"; - acltype = "posixacl"; - xattr = "sa"; + acltype = "posixacl"; # POSIX compliant file permissions + xattr = "sa"; # Store attributes in inodes to reduce disk reads }; datasets = { @@ -83,16 +88,17 @@ }; }; + # If any disks where defined to be in the raid we set up the raid5 pool raid5 = lib.mkIf (builtins.length raid-disks > 0) { type = "zpool"; mode = "raidz"; rootFsOptions = { - compression = "zstd"; - mountpoint = "none"; - acltype = "posixacl"; - xattr = "sa"; - "com.sun:auto-snapshot" = "true"; + compression = "zstd"; # Compress filesystem for more storage + mountpoint = "none"; # Dont mount the zfs pool anywhere + acltype = "posixacl"; # POSIX compliant file permissions + xattr = "sa"; # Store attributes in inodes to reduce disk reads + "com.sun:auto-snapshot" = "true"; # Never a bad idea to have backups }; datasets = {