Hello, sometimes my rebuilds fail, and I notice that /tmp still has the derivation, I assume of my entire system, or something that would indicate where the build is at. When I have a large build, and it fails, i would like to resume from this build, is it possible? looks like this i think:
nixos-rebuild.r1eVrd
maybe it goes by a different name.
I don’t think this is possible.
Nix creates a new directory in /tmp
for every derivation. There’s not one for your “entire system”. Your system is comprised of many many derivations. When the build fails, these tmp directories are cleaned up and deleted. When you restart the build, it will share all the derivations that have already been completed, so it will resume where it left off, effectively. The issue is that this is at a derivation-level granularity. If you have one large derivation, like the linux kernel, and that derivation fails, yes, it will have to be restarted from scratch. There is no way around this. Trying to get around this would create the exact sort of impurities and anti-hermeticity that Nix is designed to avoid; different builds should not affect each other.
The nixos-rebuild.r1eVrd
tmp directories you found are different. The nixos-rebuild
tool creates its own tmp directory where it keeps some largely irrelevant things like temporary GC roots, SSH control sockets, etc…