qemu-vm: add virtualisation.fileSystems to allow extra vm mounts

master
Maciej Krüger 2021-02-11 11:02:45 +01:00
parent 56565e3568
commit 45b8e83128
No known key found for this signature in database
GPG Key ID: 0D948CE19CF49C5F
1 changed files with 4 additions and 1 deletions

View File

@ -7,7 +7,7 @@
# the VM in the host. On the other hand, the root filesystem is a
# read/writable disk image persistent across VM reboots.
{ config, lib, pkgs, ... }:
{ config, lib, pkgs, options, ... }:
with lib;
with import ../../lib/qemu-flags.nix { inherit pkgs; };
@ -266,6 +266,8 @@ in
options = {
virtualisation.fileSystems = options.fileSystems;
virtualisation.memorySize =
mkOption {
default = 384;
@ -659,6 +661,7 @@ in
# attribute should be disregarded for the purpose of building a VM
# test image (since those filesystems don't exist in the VM).
fileSystems = mkVMOverride (
cfg.fileSystems //
{ "/".device = cfg.bootDevice;
${if cfg.writableStore then "/nix/.ro-store" else "/nix/store"} =
{ device = "store";