diff options
author | Jasper Ras <jras@hostnet.nl> | 2025-03-29 11:32:09 +0100 |
---|---|---|
committer | Jasper Ras <jras@hostnet.nl> | 2025-03-29 11:32:09 +0100 |
commit | 5b41ca762c6a44fa7a77e5f5324bcecf8a47f4c7 (patch) | |
tree | 1613d6bc1f613bf9248ceb858b8b4110836d532b /nodes/backup.jras.nl/disk-config.nix | |
parent | 2b8c1de8ca4d1a9ce90268189d5206ae27e6634b (diff) | |
parent | 5e3187e05d876f4e6b6fe20cc4c387daeffabe9c (diff) |
Merge branch 'main' of snorlax.home:nixos
Diffstat (limited to 'nodes/backup.jras.nl/disk-config.nix')
-rw-r--r-- | nodes/backup.jras.nl/disk-config.nix | 109 |
1 files changed, 109 insertions, 0 deletions
diff --git a/nodes/backup.jras.nl/disk-config.nix b/nodes/backup.jras.nl/disk-config.nix new file mode 100644 index 0000000..d075422 --- /dev/null +++ b/nodes/backup.jras.nl/disk-config.nix @@ -0,0 +1,109 @@ +{ + disko.devices = { + disk = { + vda = { + device = "/dev/vda"; + type = "disk"; + content = { + type = "gpt"; + partitions = { + boot = { + name = "boot"; + size = "1M"; + type = "EF02"; + }; + esp = { + name = "ESP"; + size = "500M"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + }; + }; + 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"; + }; + }; + }; + }; + + zpool = { + backup = { + type = "zpool"; + + rootFsOptions = { + compression = "zstd"; + }; + }; + }; + }; +} |