This commit is contained in:
zoey 2025-05-28 12:33:51 -04:00
parent 0c30b1ed0d
commit 283241b727
Signed by: zoey
GPG key ID: 81FB9FECDD6A33E2
5 changed files with 67 additions and 69 deletions

View file

@ -1,7 +1,7 @@
{
disko.devices = {
disk = {
root = {
main = {
type = "disk";
device = "/dev/nvme0n1";
content = {
@ -14,7 +14,7 @@
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = ["nofail"];
mountOptions = ["umask=0077" "nofail"];
};
};
zfs = {
@ -33,11 +33,11 @@
content = {
type = "gpt";
partitions = {
zfs = {
zbk = {
size = "100%";
content = {
type = "zfs";
pool = "zbackup";
pool = "zbk";
};
};
};
@ -45,59 +45,71 @@
};
};
zpool = {
zroot = {
zbk = {
type = "zpool";
rootFsOptions = {
mountpoint = "none";
compression = "zstd";
acltype = "posixacl";
atime = "off";
compression = "zstd";
mountpoint = "none";
xattr = "sa";
"com.sun:auto-snapshot" = "true";
autotrim = "on";
};
options.ashift = "12";
datasets = {
"root" = {
type = "zfs_fs";
mountpoint = "/";
};
"root/nix" = {
type = "zfs_fs";
options.mountpoint = "/nix";
mountpoint = "/nix";
};
# README MORE: https://wiki.archlinux.org/title/ZFS#Swap_volume
"root/swap" = {
type = "zfs_volume";
size = "32G";
content = {
type = "swap";
};
options = {
volblocksize = "4096";
compression = "zle";
logbias = "throughput";
sync = "always";
primarycache = "metadata";
secondarycache = "none";
"com.sun:auto-snapshot" = "false";
};
datasets = {
"zbk" = {
type = "zfs_fs";
options.mountpoint = "none";
};
"zbk/zbk" = {
type = "zfs_fs";
mountpoint = "/mnt/zbk";
options."sharesmb" = "on";
# Used by services.zfs.autoSnapshot options.
options."com.sun:auto-snapshot" = "true";
};
};
};
zbackup = {
zroot = {
type = "zpool";
rootFsOptions = {
mountpoint = "none";
compression = "zstd";
# https://wiki.archlinux.org/title/Install_Arch_Linux_on_ZFS
acltype = "posixacl";
atime = "off";
compression = "zstd";
mountpoint = "none";
xattr = "sa";
autotrim = "on";
};
options.ashift = "12";
datasets = {
"root" = {
"local" = {
type = "zfs_fs";
mountpoint = "/mnt/zbk";
options.mountpoint = "none";
};
"local/home" = {
type = "zfs_fs";
mountpoint = "/home";
# Used by services.zfs.autoSnapshot options.
options."com.sun:auto-snapshot" = "true";
};
"local/nix" = {
type = "zfs_fs";
mountpoint = "/nix";
options."com.sun:auto-snapshot" = "false";
};
"local/persist" = {
type = "zfs_fs";
mountpoint = "/persist";
options."com.sun:auto-snapshot" = "false";
};
"local/root" = {
type = "zfs_fs";
mountpoint = "/";
options."com.sun:auto-snapshot" = "false";
postCreateHook = "zfs list -t snapshot -H -o name | grep -E '^zroot/local/root@blank$' || zfs snapshot zroot/local/root@blank";
};
};
};