nixos/qemu-vm: introduce virtualisation.mountHostNixStore option#227881
nixos/qemu-vm: introduce virtualisation.mountHostNixStore option#227881RaitoBezarius merged 1 commit intomasterfrom
virtualisation.mountHostNixStore option#227881Conversation
Now that `useBootLoader` produces a full system image, moving disk images can be slow because they have a full Nix store in them. It does not make sense to keep the 9p mountpoint to shadow the /nix/store of the VM. We disable it if we have `useBootLoader` and introduce an option for easy overrides.
36933e4 to
0df5257
Compare
|
This broke the initrd-luks-empty-passphrase NixOS test. |
Root cause: Overlay filesystem mounting of Mounting the host Nix store was hiding this issue because well, you never had to worry about mounting the Nix store at the right moment. I believe that by moving the |
|
I spent all the day working on that. The whole problem is that we had very weird semantics on how we did our LUKS testing. Instead of booting on the real rootfs, we just had a "bootfs" which was used for preparating a LUKS rootfs. This way, what we do is booting on bootfs, formatting our LUKS rootfs, use The problem here is that a large implicit assumption is done here: when booting the LUKS rootfs, we assume we have a proper Nix store to "boot" into our system closure even if the LUKS rootfs is… empty (of 512MiB). It's not written anywhere and it is like some ad-hoc practice to do this kind of testing. I think this is misleading test, what should be tested is booting a NixOS system in a LUKS rootfs, not a frankenstein of NixOS system in host Nix store and empty LUKS rootfs via specialization. Therefore, I set to find a solution on how to get our framework to enable testing LUKS rootfs, which is annoyingly hard because And even if I hacked a support for LUKS there (which does not really make sense), parameters would will expose an impedence mismatch. So really, the end solution here is to provide custom partitioning scripts via disko or any structured tooling similar, but that's not realistic for the time being. Other options include:
I'm looking into the 2 last solutions at the moment, if you have any preference or input @alyssais let me know. |
Isn't this what the installer tests are for? Testing LUKS doesn't necessarily mean testing the store being on the root fs, and the latter is significantly less lightweight as a test. |
Now you are saying this, I feel relieved, I don't have to implement a NixOS test trick for that actually indeed. I can just try to unlock LUKS on another disk, do you agree with this? |
|
(But I think we should test re-encryption, this is neat.) |
|
cc @lheckemann @therishidesai who have worked on the initrd tests |
@RaitoBezarius Yea that's probably ok. |
|
I guess you'll want to make sure to test that the device is actually unlocked and present in |
|
Will open a "mass" fix PR for all failed tests due to this PR. (thankfully, they are exactly the set of PRs which useBootLoader = true; (i.e. no direct boot) + switch to an empty rootfs, so ~10 of them). |
Description of changes
Now that
useBootLoaderproduces a full system image, moving disk images can be slow because they have a full Nix store in them.It does not make sense to keep the 9p mountpoint to shadow the /nix/store of the VM.
We disable it if we have
useBootLoaderand introduce an option for easy overrides.Things done
sandbox = trueset innix.conf? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)