66 lines
1.5 KiB
Nix
66 lines
1.5 KiB
Nix
{config, ...}: {
|
|
disko.devices = {
|
|
# Partition the physical disk
|
|
disk.storage = {
|
|
device = "/dev/nvme0n1";
|
|
content = {
|
|
type = "gpt";
|
|
partitions = {
|
|
esp = {
|
|
size = "1G";
|
|
type = "ef00";
|
|
content = {
|
|
type = "filesystem";
|
|
format = "vfat";
|
|
mountpoint = "/boot";
|
|
};
|
|
};
|
|
zfs = {
|
|
size = "100%";
|
|
content = {
|
|
type = "zfs";
|
|
pool = "zroot";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
# Construct the primary zfs pool for this system.
|
|
zpool.zroot = {
|
|
type = "zpool";
|
|
options = config.constants.zfsPoolOptions;
|
|
rootFsOptions = config.constants.zfsRootFsOptions;
|
|
datasets = {
|
|
# Encrypt main dataset
|
|
main = {
|
|
type = "zfs_fs";
|
|
options = {
|
|
encryption = "on";
|
|
keyformat = "passphrase";
|
|
};
|
|
};
|
|
# Create dataset for home
|
|
"main/home" = {
|
|
type = "zfs_fs";
|
|
mountpoint = "/home";
|
|
};
|
|
# Create dataset for nix store
|
|
"main/nix" = {
|
|
type = "zfs_fs";
|
|
mountpoint = "/nix";
|
|
};
|
|
# Create dataset for root
|
|
"main/root" = {
|
|
type = "zfs_fs";
|
|
mountpoint = "/";
|
|
};
|
|
# Reserve space for performance
|
|
reservation = {
|
|
type = "zfs_fs";
|
|
options.refreservation = "128G";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
}
|