fix(disko): drop deprecated rootFs, add type=zpool + proper datasets

This commit is contained in:
Nicole Dresselhaus 2025-06-10 21:54:01 +02:00
parent d4a4df8feb
commit 126221ce1e

View File

@ -1,4 +1,4 @@
# disko.nix Root-on-ZFS (rpool) + Datenpool (tank) # disko.nix Root-on-ZFS (rpool) + Daten-Pool (tank)
{ disks, ... }: { disks, ... }:
{ {
@ -6,12 +6,12 @@
disk.main = { disk.main = {
device = builtins.elemAt disks 0; device = builtins.elemAt disks 0;
type = "disk"; type = "disk";
content = { content = {
type = "gpt"; type = "gpt";
partitions = { partitions = {
ESP = { ESP = {
size = "512M"; size = "512M"; type = "EF00";
type = "EF00";
content = { content = {
type = "filesystem"; type = "filesystem";
format = "fat32"; format = "fat32";
@ -19,36 +19,46 @@
}; };
}; };
rpool = { rpool = {
size = "60G"; size = "60G"; type = "BF00";
type = "BE00"; content = { type = "zfs"; pool = "rpool"; };
content = {
type = "zfs";
pool = "rpool";
};
}; };
tank = { tank = {
type = "BE00"; type = "BF00";
content = { content = { type = "zfs"; pool = "tank"; };
type = "zfs";
pool = "tank";
};
}; };
}; };
}; };
}; };
zpool.rpool = { zpool.rpool = {
type = "zpool";
options = { ashift = "12"; autotrim = "on"; };
datasets = { datasets = {
root = { mountpoint = "/"; }; root = {
nix = { mountpoint = "/nix"; }; type = "zfs_fs";
home = { mountpoint = "/home"; }; mountpoint = "/";
options.compression = "zstd";
};
nix = {
type = "zfs_fs";
mountpoint = "/nix";
options.compression = "zstd";
};
home = {
type = "zfs_fs";
mountpoint = "/home";
options.compression = "zstd";
};
}; };
rootFs = "root";
}; };
zpool.tank = { zpool.tank = {
datasets = { type = "zpool";
media = { mountpoint = "/tank"; }; options = { ashift = "12"; autotrim = "on"; };
datasets.media = {
type = "zfs_fs";
mountpoint = "/tank";
options.compression = "zstd";
}; };
}; };
}; };