diff --git a/hosts/common/disks/zfs/zspeed.nix b/hosts/common/disks/zfs/zspeed.nix new file mode 100644 index 0000000..f04e870 --- /dev/null +++ b/hosts/common/disks/zfs/zspeed.nix @@ -0,0 +1,72 @@ +{ + disko.devices = { + disk = { + x = { + type = "disk"; + device = "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi0"; + content = { + type = "gpt"; + partitions = { + zfs = { + size = "100%"; + content = { + type = "zfs"; + pool = "zspeed"; + }; + }; + }; + }; + }; + y = { + type = "disk"; + device = "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi3"; + content = { + type = "gpt"; + partitions = { + zfs = { + size = "100%"; + content = { + type = "zfs"; + pool = "zspeed"; + }; + }; + }; + }; + }; + }; + zpool = { + zspeed = { + type = "zpool"; + mode = "mirror"; + options = { + "compression" = "zstd-4"; + "com.sun:auto-snapshot" = "false"; + "atime" = "off"; + "xattr" = "sa"; + "ashift" = "13"; + }; + mountpoint = "/mnt/zfs"; + postCreateHook = "zfs list -t snapshot -H -o name | grep -E '^zspeed@blank$' || zfs snapshot zspeed@blank"; + + datasets = { + postgres = { + type = "zfs_volume"; + size = "10G"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/mnt/postgres"; + options = { + "com.sun:auto-snapshot:daily" = "true"; + "atime" = "off"; + "xattr" = "sa"; + "ashift" = "13"; + "recordsize" = "8k"; + }; + }; + }; + }; + }; + }; + }; +} diff --git a/hosts/nebula/default.nix b/hosts/nebula/default.nix index f57a197..e1e67ce 100644 --- a/hosts/nebula/default.nix +++ b/hosts/nebula/default.nix @@ -13,7 +13,7 @@ in # Create users for this host ../common/users/${user} - # Disk configuration + # Root disk configuration inputs.disko.nixosModules.disko (import ../common/disks { device = dev; impermanence = impermanence; fsType = fsType; encrypted = encrypted; })