mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-14 06:00:33 +03:00
nixos/qemu-vm: optionally disable overriding fileSystems
Allow the user to disable overriding the fileSystems option with virtualisation.fileSystems by setting `virtualisation.fileSystems = lib.mkForce { };`. With this change you can use the qemu-vm module to boot from an external image that was not produced by the qemu-vm module itself. The user can now re-use the modularly set fileSystems option instead of having to reproduce it in virtualisation.fileSystems.
This commit is contained in:
parent
f902cb4989
commit
62e95d095d
4 changed files with 86 additions and 5 deletions
|
@ -1121,11 +1121,12 @@ in
|
|||
}) cfg.emptyDiskImages)
|
||||
];
|
||||
|
||||
# Use mkVMOverride to enable building test VMs (e.g. via `nixos-rebuild
|
||||
# build-vm`) of a system configuration, where the regular value for the
|
||||
# `fileSystems' attribute should be disregarded (since those filesystems
|
||||
# don't necessarily exist in the VM).
|
||||
fileSystems = mkVMOverride cfg.fileSystems;
|
||||
# By default, use mkVMOverride to enable building test VMs (e.g. via
|
||||
# `nixos-rebuild build-vm`) of a system configuration, where the regular
|
||||
# value for the `fileSystems' attribute should be disregarded (since those
|
||||
# filesystems don't necessarily exist in the VM). You can disable this
|
||||
# override by setting `virtualisation.fileSystems = lib.mkForce { };`.
|
||||
fileSystems = lib.mkIf (cfg.fileSystems != { }) (mkVMOverride cfg.fileSystems);
|
||||
|
||||
virtualisation.fileSystems = let
|
||||
mkSharedDir = tag: share:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue