{ lib, ... }: # Second disk for db-host: the Postgres data directory lives on /dev/sdb, kept # separate from the OS disk (/dev/sda). The whole disk is one GPT partition, # ext4, mounted at /var/lib/postgresql — so the cluster data dir # (/var/lib/postgresql/17, the upstream NixOS default) sits on this drive and # survives an OS-disk rebuild. { disko.devices.disk.disk2 = { device = lib.mkDefault "/dev/sdb"; type = "disk"; content = { type = "gpt"; partitions = { data = { name = "data"; size = "100%"; content = { type = "filesystem"; format = "ext4"; mountpoint = "/var/lib/postgresql"; mountOptions = [ "defaults" ]; }; }; }; }; }; }