diff options
author | Jasper Ras <jras@hostnet.nl> | 2025-03-25 14:06:59 +0100 |
---|---|---|
committer | Jasper Ras <jras@hostnet.nl> | 2025-03-25 14:06:59 +0100 |
commit | 210ec2ded46759782fc66fd36a3e3145dcb783d9 (patch) | |
tree | a81ca5fefd7252ac8c79ce804cc6ba1cccce1b56 /node/backup.jras.nl/disk-config.nix | |
parent | 2fa78656a47392fccc43c1ec7305e327187e9da0 (diff) |
backup.jras.nl
Diffstat (limited to 'node/backup.jras.nl/disk-config.nix')
-rw-r--r-- | node/backup.jras.nl/disk-config.nix | 102 |
1 files changed, 102 insertions, 0 deletions
diff --git a/node/backup.jras.nl/disk-config.nix b/node/backup.jras.nl/disk-config.nix new file mode 100644 index 0000000..8800806 --- /dev/null +++ b/node/backup.jras.nl/disk-config.nix @@ -0,0 +1,102 @@ +{ + disko.devices = { + disk = { + vda = { + device = "/dev/vda"; + type = "disk"; + content = { + type = "gpt"; + partitions = { + ESP = { + type = "EF00"; + size = "1G"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + mountOptions = [ "umask=0077" ]; + }; + }; + zfs = { + size = "100%"; + content = { + type = "zfs"; + pool = "local"; + }; + }; + }; + }; + }; + + vdb = { + device = "/dev/vdb"; + type = "disk"; + content = { + type = "gpt"; + partitions = { + zfs = { + size = "100%"; + content = { + type = "zfs"; + pool = "backup"; + }; + }; + }; + }; + }; + + vdc = { + device = "/dev/vdc"; + type = "disk"; + content = { + type = "gpt"; + partitions = { + zfs = { + size = "100%"; + content = { + type = "zfs"; + pool = "backup"; + }; + }; + }; + }; + }; + }; + + zpool = { + local = { + type = "zpool"; + + rootFsOptions = { + compression = "zstd"; + }; + + datasets = { + root = { + type = "zfs_fs"; + mountpoint = "/"; + postCreateHook = "zfs list -t snap -H -o name | grep -E '^local/root@blank$' || zfs snapshot local/root@blank"; + }; + + nix = { + type = "zfs_fs"; + mountpoint = "/nix"; + }; + + persist = { + type = "zfs_fs"; + mountpoint = "/persist"; + }; + }; + }; + + backup = { + type = "zpool"; + + rootFsOptions = { + compression = "zstd"; + }; + }; + }; + }; +} |