nix/qemu/disko-gpt.nix
Hunter Haugen 97c737637d initial
2025-04-20 14:36:58 -04:00

106 lines
2.5 KiB
Nix

{
disko.devices = {
disk = {
vda = {
type = "disk";
device = "/dev/vda";
content = {
type = "gpt";
partitions = {
boot = {
size = "1M";
type = "EF02";
};
ESP = {
name = "ESP";
size = "512M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [ "umask=0077" ];
};
};
swap = {
size = "8G";
content = {
type = "swap";
randomEncryption = true;
};
};
zfs = {
size = "100%";
content = {
type = "zfs";
pool = "rpool";
};
};
};
};
};
};
zpool = {
rpool = {
type = "zpool";
rootFsOptions = {
acltype = "posixacl";
compression = "lz4";
dnodesize = "auto";
normalization = "formD";
relatime = "on";
xattr = "sa";
};
options = {
ashift = "12";
autotrim = "on";
};
datasets = {
"local/root" = {
type = "zfs_fs";
options = {
mountpoint = "legacy";
canmount = "noauto";
};
mountpoint = "/";
postCreateHook = ''
zfs snapshot rpool/local/root@blank
'';
};
"local/nix" = {
type = "zfs_fs";
options.mountpoint = "legacy";
mountpoint = "/nix";
};
"safe/persist" = {
type = "zfs_fs";
options.mountpoint = "legacy";
mountpoint = "/persist";
};
"safe/home" = {
type = "zfs_fs";
options.mountpoint = "legacy";
mountpoint = "/home";
};
"local/var" = {
type = "zfs_fs";
options = {
mountpoint = "none";
canmount = "off";
};
};
"local/var/lib" = {
type = "zfs_fs";
options.mountpoint = "legacy";
mountpoint = "/var/lib";
};
"local/var/log" = {
type = "zfs_fs";
options.mountpoint = "legacy";
mountpoint = "/var/log";
};
};
};
};
};
}