nixos-generators icon indicating copy to clipboard operation
nixos-generators copied to clipboard

NFS mounts not working in (at least) VM

Open tobimai opened this issue 2 years ago • 2 comments

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

tobimai avatar Jun 05 '22 17:06 tobimai

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

Lassulus avatar Oct 26 '22 19:10 Lassulus

Try this:

    fileSystems."/mnt/nas-xxx" = lib.mkForce {
        device = "192.168.xx.xx:/mnt/xxx/xxx";
        fsType = "nfs";
    };

lib.mkVMOverride might also work

Mic92 avatar Oct 27 '22 06:10 Mic92