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
When I'm working on web stuff I like to mount the docroot into the VM with --mount so I can edit files on the host and see the effects immediately. Unfortunately cache=loose means the guest keeps the old version of the file for random time intervals (sometimes over a minute) so this workflow is blocked.
Before I start working on this I would like to agree on a plan. I had a few ideas:
add --mount-cache to specify how all directories are mounted
extend --mount to specify mount options on a per-directory basis, eg: --mount,cache=none /host /guest
These involve a bit of work on the command line parsing though and that may become more complex as nixos-shell evolves.
Perhaps it would be better to incorporate VM options into the vm.nix file itself so we can leverage the whole NixOS module system, akin to the way NixOps does it (deployment.targetEnv etc). We may end up with something like this:
{vm.mounts={mountHome=true;mountNixProfile=true;# defaultscache="loose";extraMounts={# uses defaults defined above"/tank"="/tank";"/var/www"={target="./src";cache="none";};};};# normal NixOS options…}
I would love to hear your take on this.
The text was updated successfully, but these errors were encountered:
When I'm working on web stuff I like to mount the docroot into the VM with
--mount
so I can edit files on the host and see the effects immediately. Unfortunatelycache=loose
means the guest keeps the old version of the file for random time intervals (sometimes over a minute) so this workflow is blocked.Before I start working on this I would like to agree on a plan. I had a few ideas:
--mount-cache
to specify how all directories are mounted--mount
to specify mount options on a per-directory basis, eg:--mount,cache=none /host /guest
These involve a bit of work on the command line parsing though and that may become more complex as nixos-shell evolves.
Perhaps it would be better to incorporate VM options into the
vm.nix
file itself so we can leverage the whole NixOS module system, akin to the way NixOps does it (deployment.targetEnv
etc). We may end up with something like this:I would love to hear your take on this.
The text was updated successfully, but these errors were encountered: