nixos-generators
nixos-generators copied to clipboard
NFS mounts not working in (at least) VM
I tried generating a VM to test a config of mine, and it worked find in general (users, installed packages etc. ). Only the NFS mounts were not in the VM, and there was no error.
In a "proper" VM the config works as expected and mounts the images.
This is the part of my config:
fileSystems."/mnt/nas-xxx" = {
device = "192.168.xx.xx:/mnt/xxx/xxx";
fsType = "nfs";
};
And i used this command to create/start the VM:
nixos-generate -c config.nix -f vm --run
ah yeah, nixos ignores fileSystems options in vms. seems more like a nixpkgs issue to me and you would need to investigate there if there is some kind of override mechanism for that
Try this:
fileSystems."/mnt/nas-xxx" = lib.mkForce {
device = "192.168.xx.xx:/mnt/xxx/xxx";
fsType = "nfs";
};
lib.mkVMOverride
might also work