nixos/qemu-vm: make networking options configurable
This commit is contained in:
parent
a8c726da56
commit
6cdacdd4a2
@ -57,8 +57,7 @@ let
|
|||||||
-name ${vmName} \
|
-name ${vmName} \
|
||||||
-m ${toString config.virtualisation.memorySize} \
|
-m ${toString config.virtualisation.memorySize} \
|
||||||
${optionalString (pkgs.stdenv.system == "x86_64-linux") "-cpu kvm64"} \
|
${optionalString (pkgs.stdenv.system == "x86_64-linux") "-cpu kvm64"} \
|
||||||
-net nic,vlan=0,model=virtio \
|
${concatStringsSep " " config.virtualisation.qemuNetworkingOptions} \
|
||||||
-net user,vlan=0''${QEMU_NET_OPTS:+,$QEMU_NET_OPTS} \
|
|
||||||
-virtfs local,path=/nix/store,security_model=none,mount_tag=store \
|
-virtfs local,path=/nix/store,security_model=none,mount_tag=store \
|
||||||
-virtfs local,path=$TMPDIR/xchg,security_model=none,mount_tag=xchg \
|
-virtfs local,path=$TMPDIR/xchg,security_model=none,mount_tag=xchg \
|
||||||
-virtfs local,path=''${SHARED_DIR:-$TMPDIR/xchg},security_model=none,mount_tag=shared \
|
-virtfs local,path=''${SHARED_DIR:-$TMPDIR/xchg},security_model=none,mount_tag=shared \
|
||||||
@ -180,6 +179,23 @@ in
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
virtualisation.qemuNetworkingOptions =
|
||||||
|
mkOption {
|
||||||
|
default = [
|
||||||
|
"-net nic,vlan=0,model=virtio"
|
||||||
|
"-net user,vlan=0\${QEMU_NET_OPTS:+,$QEMU_NET_OPTS}"
|
||||||
|
];
|
||||||
|
type = types.listOf types.str;
|
||||||
|
description = ''
|
||||||
|
Networking-related command-line options that should be passed to qemu.
|
||||||
|
The default is to use userspace networking (slirp).
|
||||||
|
|
||||||
|
If you override this option, be adviced to keep
|
||||||
|
''${QEMU_NET_OPTS:+,$QEMU_NET_OPTS} (as seen in the default)
|
||||||
|
to keep the default runtime behaviour.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
virtualisation.graphics =
|
virtualisation.graphics =
|
||||||
mkOption {
|
mkOption {
|
||||||
default = true;
|
default = true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user