added more comments to disko config

This commit is contained in:
baritone 2025-04-15 11:30:05 +02:00
parent 6dad7e836a
commit 2be4a5df9d

View file

@ -8,12 +8,14 @@
disko.devices = { disko.devices = {
disk = disk =
{ {
# Main SSD where /nix/store /etc /boot etc. is located.
main = { main = {
type = "disk"; type = "disk";
device = root-disk; device = root-disk;
content = { content = {
type = "gpt"; type = "gpt";
partitions = { partitions = {
# Define a 512 megabyte boot partition
boot = { boot = {
size = "512M"; size = "512M";
type = "EF00"; type = "EF00";
@ -24,6 +26,7 @@
mountOptions = ["umask=0077"]; mountOptions = ["umask=0077"];
}; };
}; };
# If the swap argument is defined then create a swap partition of the given size
swap = lib.mkIf (swap-size != -1) { swap = lib.mkIf (swap-size != -1) {
size = swap-size; size = swap-size;
content = { content = {
@ -32,6 +35,7 @@
resumeDevice = true; resumeDevice = true;
}; };
}; };
# Finally allocate the rest of the disk as a zfs device
root = { root = {
size = "100%"; size = "100%";
content = { content = {
@ -62,12 +66,13 @@
}); });
zpool = { zpool = {
# Set up zroot pool
zroot = { zroot = {
type = "zpool"; type = "zpool";
rootFsOptions = { rootFsOptions = {
mountpoint = "none"; mountpoint = "none";
acltype = "posixacl"; acltype = "posixacl"; # POSIX compliant file permissions
xattr = "sa"; xattr = "sa"; # Store attributes in inodes to reduce disk reads
}; };
datasets = { 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) { raid5 = lib.mkIf (builtins.length raid-disks > 0) {
type = "zpool"; type = "zpool";
mode = "raidz"; mode = "raidz";
rootFsOptions = { rootFsOptions = {
compression = "zstd"; compression = "zstd"; # Compress filesystem for more storage
mountpoint = "none"; mountpoint = "none"; # Dont mount the zfs pool anywhere
acltype = "posixacl"; acltype = "posixacl"; # POSIX compliant file permissions
xattr = "sa"; xattr = "sa"; # Store attributes in inodes to reduce disk reads
"com.sun:auto-snapshot" = "true"; "com.sun:auto-snapshot" = "true"; # Never a bad idea to have backups
}; };
datasets = { datasets = {