You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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).
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 ~/.local/share/microvm/nix-store-db-dump if the db.sqlite is not older than the dump file.
The second line hard-links the dump into a folder that gets mounted into the VM.
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: