linux-builder: Add ephemeral
option to delete VM's disk image on service restart
#850
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
After enabling the linux builder on a new macOS system, the first thing I do is adding more configuration (bigger disk, more cores and RAM, etc.) and then rebuild the system again.
The problem is that such settings (especially disk space) do not propagate automatically into the disk image or can be incompatible with the state in the disk image.
This PR does:
workingDirectory
to set the service's working directory so we have a central variable for that instead of the duplicated string literalephemeral
option to delete thenixos.qcow2
image of the builder VM upon service restartThis should only harm build time as it drops nix store contents, too.If this is considered too harsh, we could also add a config attribute
nix.linux-builder.restart-prunes-disk = true/false;
or so that isfalse
by default.cc @Enzime