Change:
fsType = "tmpfs"; neededForBoot = true; # Sync with systemd's tmp.mount; <del> options = [ "mode=1777" "strictatime" "nosuid" "nodev" ]; </del> <ins> options = [ "mode=1777" "strictatime" "nosuid" "nodev" "size=${toString config.boot.tmpOnTmpfsSize}" ]; </ins> }; "/tmp/xchg" = { device = "xchg";

Discussion:
defaults to the tmpfs defaults: 50% of RAM. What do you think about making it configurable? tmpfs has no real overhead when not used and just like normal memory, it can be swapped out if memory gets tight. I have a hp microserver n40l with 8GB RAM and i can't rebuild the linux kernel with , as my /tmp fills up even though i have a bit of RAM left.
I know i can do this instead (copied from one of my machines): but I don't like having a nice option for this, and still using the "manual" way.
since you have already found a solution for this, have you considered opening a PR?
i don't find that conversation atm (discussion was probably on irc?). anyway, my "fix" was too liberal in it accepts as input (bool and string) and didn't reuse the original systemd template/unit file. feel free to reuse this as a basis for your own pr or give me pointers how i could do that in a few lines and without messing around with the option. maybe i'll try a pr with the solution, but thats more of a hack. thanks for the reminder, that this is still an issue.
Why is a hack?
because it doesn't automatically get new features from the upstream systemd unit file. that was the main part of point two. whenever systemd gets a new feature, the unit files in every distro get automatic upgrades - just nixos would need manual intervention.
Oh I wasn't aware how this is currently done. Is it realistic to expect new "features" for a filesystem mount? Maybe my imagination is lacking, but I have no idea what that might be.
see
Thank you for your contributions. This has been automatically marked as stale because it has had no activity for 180 days. If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity. Here are suggestions that might help resolve this more quickly: for maintainers and people that previously touched the related code and @ mention them in a comment. on the . on the on .

This still seems like a desirable feature, especially since nix builds happen in /tmp.
I marked this as stale due to inactivity. &rarr;
Any activity on this? I've a build failing, even though boot.tmpOnTmpfs is set to false
have you tried increasing size of /tmp ? eg
Where is the RuntimeDirectory located? I thought that should be , which on my system is pretty big: I'll try to add that option to my config, not sure I fully understand what it does though, is it documented in more detail somewhere?_
sorry i made mistake in my post when i mentioned because its really not that one on my system it's You can look up systemd documentation for RuntimeDirectory
Rebuild nixos and reboot.
There is now an option for this:
For those who end up here, my problem was that for some reason was set to . Tip: just change the value and inspect the result with .