117 lines
2.4 KiB
Nix
117 lines
2.4 KiB
Nix
{ installDisk, ... }:
|
|
{
|
|
disko.devices = {
|
|
disk.main = {
|
|
type = "disk";
|
|
device = installDisk;
|
|
content = {
|
|
type = "gpt";
|
|
partitions = {
|
|
firmware = {
|
|
label = "FIRMWARE";
|
|
size = "1G";
|
|
type = "0700";
|
|
content = {
|
|
type = "filesystem";
|
|
format = "vfat";
|
|
mountpoint = "/boot/firmware";
|
|
mountOptions = [ "umask=0077" ];
|
|
};
|
|
};
|
|
|
|
zfs = {
|
|
label = "zfs";
|
|
size = "100%";
|
|
content = {
|
|
type = "zfs";
|
|
pool = "rpool";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
zpool.rpool = {
|
|
type = "zpool";
|
|
|
|
options = {
|
|
ashift = "12";
|
|
autotrim = "on";
|
|
};
|
|
|
|
rootFsOptions = {
|
|
acltype = "posixacl";
|
|
atime = "off";
|
|
compression = "lz4";
|
|
dnodesize = "auto";
|
|
mountpoint = "none";
|
|
xattr = "sa";
|
|
};
|
|
|
|
datasets = {
|
|
root = {
|
|
type = "zfs_fs";
|
|
options.mountpoint = "none";
|
|
};
|
|
|
|
"root/nixos" = {
|
|
type = "zfs_fs";
|
|
mountpoint = "/";
|
|
options = {
|
|
canmount = "noauto";
|
|
mountpoint = "legacy";
|
|
};
|
|
postCreateHook = ''
|
|
zfs list -t snapshot -H -o name | grep -E '^rpool/root/nixos@blank$' \
|
|
|| zfs snapshot rpool/root/nixos@blank
|
|
'';
|
|
};
|
|
|
|
home = {
|
|
type = "zfs_fs";
|
|
mountpoint = "/home";
|
|
options.mountpoint = "legacy";
|
|
};
|
|
|
|
nix = {
|
|
type = "zfs_fs";
|
|
mountpoint = "/nix";
|
|
options = {
|
|
mountpoint = "legacy";
|
|
"com.sun:auto-snapshot" = "false";
|
|
primarycache = "metadata";
|
|
};
|
|
};
|
|
|
|
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 = "1G";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
}
|