This repository has been archived on 2024-11-08. You can view files and clone it, but cannot push or open issues or pull requests.
MiniNix/disko-nixos.nix
2024-07-06 22:38:39 -05:00

73 lines
1.6 KiB
Nix

{ disks ? [ "/dev/sda" ], ... }: {
disko.devices = {
disk = {
main = {
type = "disk";
device = builtins.elemAt disks 0;
content = {
type = "gpt";
partitions = {
ESP = {
size = "1024M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
};
zfs = {
size = "100%";
content = {
type = "zfs";
pool = "zroot";
};
};
};
};
};
};
zpool = {
zroot = {
type = "zpool";
mode = "";
rootFsOptions = {
compression = "zstd";
"com.sun:auto-snapshot" = "false";
mountpoint = "none";
acltype = "posixacl";
};
mountOptions = [
"ashift=12"
];
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";
};
var = {
type = "zfs_fs";
mountpoint = "/var";
};
home = {
type = "zfs_fs";
mountpoint = "/home";
options = {
"com.sun:auto-snapshot" = "true";
};
};
};
};
};
};
}