Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

linux-builder: Add ephemeral option to delete VM's disk image on service restart #850

Merged
merged 1 commit into from
Jan 15, 2024

Conversation

tfc
Copy link
Contributor

@tfc tfc commented Jan 14, 2024

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:

  • Add an option workingDirectory to set the service's working directory so we have a central variable for that instead of the duplicated string literal
  • Add an ephemeral option to delete the nixos.qcow2 image of the builder VM upon service restart

This 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 is false by default.

cc @Enzime

modules/nix/linux-builder.nix Outdated Show resolved Hide resolved
modules/nix/linux-builder.nix Outdated Show resolved Hide resolved
@tfc
Copy link
Contributor Author

tfc commented Jan 15, 2024

@Enzime thank you for your actionable feedback. It's all incorporated now.

@tfc tfc changed the title linux-builder: Delete VM's disk image on service restart linux-builder: Add ephemeral option to delete VM's disk image on service restart Jan 15, 2024
modules/nix/linux-builder.nix Outdated Show resolved Hide resolved
modules/nix/linux-builder.nix Outdated Show resolved Hide resolved
@tfc
Copy link
Contributor Author

tfc commented Jan 15, 2024

@Enzime all done

Copy link
Collaborator

@Enzime Enzime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Enzime Enzime merged commit 44a6ec1 into LnL7:master Jan 15, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants