107 lines
2.6 KiB
Nix
107 lines
2.6 KiB
Nix
{
|
|
disko.devices = {
|
|
disk = {
|
|
ssd1 = {
|
|
type = "disk";
|
|
device = "/dev/nvme0n1";
|
|
content = {
|
|
type = "gpt";
|
|
partitions = {
|
|
efi = {
|
|
size = "512M";
|
|
type = "EF00";
|
|
content = {
|
|
type = "filesystem";
|
|
format = "vfat";
|
|
mountpoint = "/boot";
|
|
};
|
|
};
|
|
crypt = {
|
|
size = "100%";
|
|
content = {
|
|
type = "luks";
|
|
name = "crypt";
|
|
passwordFile = "/tmp/secret.key";
|
|
settings = {
|
|
allowDiscards = true;
|
|
};
|
|
content = {
|
|
type = "zfs";
|
|
pool = "zroot";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
hdd1 = {
|
|
type = "disk";
|
|
device = "/dev/sda";
|
|
content = {
|
|
type = "gpt";
|
|
partitions = {
|
|
crypt = {
|
|
size = "100%";
|
|
content = {
|
|
type = "luks";
|
|
name = "crypt";
|
|
passwordFile = "/tmp/secret.key";
|
|
settings = {
|
|
allowDiscards = true;
|
|
};
|
|
content = {
|
|
type = "zfs";
|
|
pool = "zstore";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
zpool = {
|
|
zroot = {
|
|
type = "zpool";
|
|
mode = "";
|
|
rootFsOptions = {
|
|
compression = "zstd";
|
|
canmount = "off";
|
|
"com.sun:auto-snapshot" = "false";
|
|
};
|
|
postCreateHook = "zfs list -t snapshot -H -o name | grep -E '^zroot@blank$' || zfs snapshot zroot@blank";
|
|
|
|
datasets = {
|
|
root = {
|
|
type = "zfs_fs";
|
|
mountpoint = "/";
|
|
};
|
|
nix = {
|
|
type = "zfs_fs";
|
|
mountpoint = "/nix";
|
|
};
|
|
persist = {
|
|
type = "zfs_fs";
|
|
mountpoint = "/persist";
|
|
};
|
|
};
|
|
};
|
|
zstore = {
|
|
type = "zpool";
|
|
mode = "";
|
|
rootFsOptions = {
|
|
compression = "zstd";
|
|
canmount = "off";
|
|
"com.sun:auto-snapshot" = "false";
|
|
};
|
|
postCreateHook = "zfs list -t snapshot -H -o name | grep -E '^zroot@blank$' || zfs snapshot zroot@blank";
|
|
|
|
datasets = {
|
|
persist = {
|
|
type = "zfs_fs";
|
|
mountpoint = "/persist/ext";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
}
|