diff options
author | Jasper Ras <jras@hostnet.nl> | 2025-02-16 21:04:52 +0100 |
---|---|---|
committer | Jasper Ras <jras@hostnet.nl> | 2025-02-16 21:04:52 +0100 |
commit | fad1f2c812eba1a166bd3a28b23f8df7ddcf3218 (patch) | |
tree | c3ab084849839acd1e8c118b658fc77a96120787 /modules/backup/disk-config.nix | |
parent | b01725eb25f21d55d58862ae38733b0ada99b673 (diff) |
mumbujumbo
Diffstat (limited to 'modules/backup/disk-config.nix')
-rw-r--r-- | modules/backup/disk-config.nix | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/modules/backup/disk-config.nix b/modules/backup/disk-config.nix new file mode 100644 index 0000000..9244686 --- /dev/null +++ b/modules/backup/disk-config.nix @@ -0,0 +1,52 @@ +{ + disko.devices = { + disk = { + sda = { + device = "/dev/vda"; + type = "disk"; + content = { + type = "gpt"; + partitions = { + ESP = { + type = "EF00"; + size = "500M"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + mountOptions = [ "umask=0077" ]; + }; + }; + zfs = { + size = "100%"; + content = { + type = "zfs"; + pool = "zroot"; + }; + }; + }; + }; + }; + }; + + zpool = { + zroot = { + type = "zpool"; + rootFsOptions = { + compression = "zstd"; + "com.sun:auto-snapshot" = "false"; + }; + mountpoint = "/"; + postCreateHook = "zfs list -t snap -H -o name | grep -E '^zroot@blank$' || zfs snapshot zroot@blank"; + + datasets = { + persist = { + type = "zfs_fs"; + mountpoint = "/persist"; + options."com.sun:auto-snapshot" = "true"; + }; + }; + }; + }; + }; +} |