119 lines
2.4 KiB
Nix
119 lines
2.4 KiB
Nix
{ installDisk, ... }:
|
|
{
|
|
disko.devices = {
|
|
disk.main = {
|
|
type = "disk";
|
|
device = installDisk;
|
|
content = {
|
|
type = "gpt";
|
|
partitions = {
|
|
ESP = {
|
|
label = "EFI";
|
|
size = "1G";
|
|
type = "EF00";
|
|
content = {
|
|
type = "filesystem";
|
|
format = "vfat";
|
|
mountpoint = "/boot";
|
|
mountOptions = [ "umask=0077" ];
|
|
};
|
|
};
|
|
|
|
luks = {
|
|
label = "cryptroot";
|
|
size = "100%";
|
|
content = {
|
|
type = "luks";
|
|
name = "cryptroot";
|
|
settings = {
|
|
allowDiscards = true;
|
|
};
|
|
content = {
|
|
type = "zfs";
|
|
pool = "rpool";
|
|
};
|
|
};
|
|
};
|
|
|
|
};
|
|
};
|
|
};
|
|
|
|
zpool.rpool = {
|
|
type = "zpool";
|
|
|
|
options = {
|
|
ashift = "12";
|
|
autotrim = "on";
|
|
};
|
|
|
|
rootFsOptions = {
|
|
acltype = "posixacl";
|
|
atime = "off";
|
|
compression = "zstd";
|
|
dnodesize = "auto";
|
|
mountpoint = "none";
|
|
normalization = "formD";
|
|
xattr = "sa";
|
|
};
|
|
|
|
datasets = {
|
|
root = {
|
|
type = "zfs_fs";
|
|
options.mountpoint = "none";
|
|
};
|
|
|
|
"root/nixos" = {
|
|
type = "zfs_fs";
|
|
mountpoint = "/";
|
|
options = {
|
|
canmount = "noauto";
|
|
mountpoint = "legacy";
|
|
};
|
|
postCreateHook = "zfs snapshot rpool/root/nixos@blank";
|
|
};
|
|
|
|
home = {
|
|
type = "zfs_fs";
|
|
mountpoint = "/home";
|
|
options.mountpoint = "legacy";
|
|
};
|
|
|
|
nix = {
|
|
type = "zfs_fs";
|
|
mountpoint = "/nix";
|
|
options.mountpoint = "legacy";
|
|
};
|
|
|
|
persist = {
|
|
type = "zfs_fs";
|
|
mountpoint = "/persist";
|
|
options.mountpoint = "legacy";
|
|
};
|
|
|
|
var = {
|
|
type = "zfs_fs";
|
|
options.mountpoint = "none";
|
|
};
|
|
|
|
"var/log" = {
|
|
type = "zfs_fs";
|
|
mountpoint = "/var/log";
|
|
options.mountpoint = "legacy";
|
|
};
|
|
|
|
"var/lib" = {
|
|
type = "zfs_fs";
|
|
mountpoint = "/var/lib";
|
|
options.mountpoint = "legacy";
|
|
};
|
|
|
|
reserved = {
|
|
type = "zfs_volume";
|
|
size = "8G";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
}
|