-
-
Notifications
You must be signed in to change notification settings - Fork 104
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
find and document automation to dump/load hosts /nix/store db #196
Comments
Documenting my current implementation here before I forget any details. I'm running my microvm as a user systemd service, templated by the vm name. There is a dependency on a virtiofsd service. Before starting the VM, the microvm service does:
The first line dumps the hosts nix database to In the microvm flake.nix I got:
|
It looks like local-overlay stores have been merged as an experimental feature. https://nix.dev/manual/nix/2.22/store/types/experimental-local-overlay-store I'm curious if there's any interest/development in the VM guest use case... If no one has tried it yet I might spend a weekend working on it. |
I'd love to have an example for this! |
The hosts /nix/store is mounted inside the microvm. However nix inside the VM does not use objects from /nix/store. It does not know these objects since they are not in the Nix database (/nix/var/nix/db).
Probably the best solution is currently worked on as [RFC 0152] local-overlay store.
A workaround is to use nix-store --dump-db on the host and nix-store --load-db in the guest VM.
Of course this is a hack. But for my use case of local project development VMs it should work fine.
I've not yet figured out a nice automation for this. Ideally, a db-dump would be made on microvm boot, copied in the VM and loaded inside the VM.
The text was updated successfully, but these errors were encountered: