Update disk config

This commit is contained in:
hodasemi 2025-05-14 16:51:54 +02:00
parent 1ae700fb70
commit e3b966582e

View file

@ -1,57 +1,72 @@
# Example to create a bios compatible gpt partition # Example to create a bios compatible gpt partition
{ lib, ... }:
{ {
disko.devices = { disko.devices = {
disk.disk1 = { disk = {
device = lib.mkDefault "/dev/nvme0n1"; one = {
type = "disk"; type = "disk";
device = "/dev/nvme0n1";
content = { content = {
type = "gpt"; type = "gpt";
partitions = { partitions = {
boot = { ESP = {
name = "boot"; size = "1024M";
size = "1M";
type = "EF02";
};
esp = {
name = "ESP";
size = "1G";
type = "EF00"; type = "EF00";
content = { content = {
type = "filesystem"; type = "filesystem";
format = "vfat"; format = "vfat";
mountpoint = "/boot"; mountpoint = "/boot";
mountOptions = [ "umask=0077" ];
}; };
}; };
root = { zfs = {
name = "root";
size = "100%"; size = "100%";
content = { content = {
type = "lvm_pv"; type = "zfs";
vg = "pool"; pool = "zroot";
}; };
}; };
}; };
}; };
}; };
lvm_vg = { two = {
pool = { type = "disk";
type = "lvm_vg"; device = "/dev/nvme1n1";
lvs = {
root = {
size = "100%FREE";
content = { content = {
type = "filesystem"; type = "gpt";
format = "ext4"; partitions = {
mountpoint = "/"; zfs = {
mountOptions = [ size = "100%";
"defaults" content = {
]; type = "zfs";
pool = "zroot";
}; };
}; };
}; };
}; };
}; };
}; };
zpool = {
zroot = {
type = "zpool";
mode = "mirror";
# Workaround: cannot import 'zroot': I/O error in disko tests
options.cachefile = "none";
rootFsOptions = {
compression = "zstd";
"com.sun:auto-snapshot" = "false";
};
mountpoint = "/";
postCreateHook = "zfs list -t snapshot -H -o name | grep -E '^zroot@blank$' || zfs snapshot zroot@blank";
datasets = {
zfs_fs = {
type = "zfs_fs";
mountpoint = "/zfs_fs";
options."com.sun:auto-snapshot" = "true";
};
};
};
};
};
} }