Update disk config

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

View file

@ -1,53 +1,68 @@
# 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";
content = { device = "/dev/nvme0n1";
type = "gpt"; content = {
partitions = { type = "gpt";
boot = { partitions = {
name = "boot"; ESP = {
size = "1M"; size = "1024M";
type = "EF02"; type = "EF00";
}; content = {
esp = { type = "filesystem";
name = "ESP"; format = "vfat";
size = "1G"; mountpoint = "/boot";
type = "EF00"; mountOptions = [ "umask=0077" ];
content = { };
type = "filesystem"; };
format = "vfat"; zfs = {
mountpoint = "/boot"; size = "100%";
content = {
type = "zfs";
pool = "zroot";
};
}; };
}; };
root = { };
name = "root"; };
size = "100%"; two = {
content = { type = "disk";
type = "lvm_pv"; device = "/dev/nvme1n1";
vg = "pool"; content = {
type = "gpt";
partitions = {
zfs = {
size = "100%";
content = {
type = "zfs";
pool = "zroot";
};
}; };
}; };
}; };
}; };
}; };
lvm_vg = { zpool = {
pool = { zroot = {
type = "lvm_vg"; type = "zpool";
lvs = { mode = "mirror";
root = { # Workaround: cannot import 'zroot': I/O error in disko tests
size = "100%FREE"; options.cachefile = "none";
content = { rootFsOptions = {
type = "filesystem"; compression = "zstd";
format = "ext4"; "com.sun:auto-snapshot" = "false";
mountpoint = "/"; };
mountOptions = [ mountpoint = "/";
"defaults" 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";
}; };
}; };
}; };