everywhere-config/disk-config.nix

73 lines
1.7 KiB
Nix
Raw Normal View History

2025-05-13 11:09:08 +00:00
# Example to create a bios compatible gpt partition
{
disko.devices = {
2025-05-14 14:51:54 +00:00
disk = {
one = {
type = "disk";
device = "/dev/nvme0n1";
content = {
type = "gpt";
partitions = {
ESP = {
size = "1024M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [ "umask=0077" ];
};
};
zfs = {
size = "100%";
content = {
type = "zfs";
pool = "zroot";
};
2025-05-13 11:09:08 +00:00
};
};
2025-05-14 14:51:54 +00:00
};
};
two = {
type = "disk";
device = "/dev/nvme1n1";
content = {
type = "gpt";
partitions = {
zfs = {
size = "100%";
content = {
type = "zfs";
pool = "zroot";
};
2025-05-13 11:09:08 +00:00
};
};
};
};
};
2025-05-14 14:51:54 +00:00
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";
2025-05-13 11:09:08 +00:00
};
};
};
};
};
}