When I install NixOS from a 32GB flash drive with nixos-install, I get errors due to running out of space, then I have to restart the PC and go through the installation song and dance again. A workaround is a command like this one to change the temp directory: TMPDIR=/mnt/Flake/tmp nixos-install.
Shouldn’t something like that be the default though? Maybe I don’t know enough but I think if the destination drive doesn’t have enough space for temp files then it probably can’t handle that nixos configuration well, or update it with enough storage space in the future?
The general assumption is, that you do not have to build much, and therefore not much of tmp is needed.
Also setting the TMPDIR to something under /mnt might break programs that are started before you acutally mount something. Also, I have been in situations where the installation target was smaller than the available tmpfs… This have been lab-experiments with some IoT-POC, but it might just happen in the real world as well.
So if you have a config that requires a lot of temporary space to be installable, you have to make sure to do so on your end.