Partition setup can be specified in Nixos config file?

I’m a Linux newbie and not a techie. Can the Nixos config file handle custom partition layouts? For example, say I want to install Ubuntu with some non-standard partitions to handle Btrfs instead of ext4. Can that non-standard partition layout be specified in Nixos config file so when I recreate (reinstall) my system from the config file, all the non-standard partitions are created automatically?

The NixOS configuration file does not cover partition creation, but it will allow you to delare how those paritions are mounted when booting. The graphical NixOS installer will allow you to lay out your partitions at installation time, I’ve only used it personally for simpler ext4 partitions though with encryption but there is a decent amount of configurability such as types of filesystems like btrfs. Parted is also available on the installer ISO to do any manual partitioning you might want to do.

There is a new tool recently released called disko which does allow you do declare a partition setup, and it will run and create that setup for you. I last heard it’s destructive in that it will overwrite the partition table, not resize existing partitions. But perhaps that’s being worked on, or already resolved. I don’t have much experience with it, just watched a talk presenting it. Keep in mind it’s fairly new and I don’t think widely adopted yet. Given that you’re a self-described newbie, it might be a bit early to try but maybe worth looking at.