summaryrefslogtreecommitdiffstats
path: root/nixos/modules/virtualisation/qemu-vm.nix
diff options
context:
space:
mode:
authorMatthieu Coudron <mattator@gmail.com>2018-04-18 11:29:54 +0900
committerMatthieu Coudron <mattator@gmail.com>2018-04-27 18:32:15 +0900
commitca0604190e4428e1cdf9bb369fbbf73e1679e007 (patch)
tree839f536eedbbc644ef68897b41465c6bf8362bcc /nixos/modules/virtualisation/qemu-vm.nix
parent903f694e34c5ab9169eff2be1fcd48d2c11d3bf6 (diff)
qemu-guest-agent: init module
Allow out of band communication between qemu VMs and the host. Useful to retrieve IPs of VMs from the host (for instance when libvirt can't analyze DHCP requests because VMs are configured with static addresses or when there is connectivity default).
Diffstat (limited to 'nixos/modules/virtualisation/qemu-vm.nix')
-rw-r--r--nixos/modules/virtualisation/qemu-vm.nix11
1 files changed, 11 insertions, 0 deletions
diff --git a/nixos/modules/virtualisation/qemu-vm.nix b/nixos/modules/virtualisation/qemu-vm.nix
index 2b78276fcdea..57e25d808dc3 100644
--- a/nixos/modules/virtualisation/qemu-vm.nix
+++ b/nixos/modules/virtualisation/qemu-vm.nix
@@ -343,6 +343,15 @@ in
(<literal>virtio</literal> or <literal>scsi</literal>).
'';
};
+
+ guestAgent.enable =
+ mkOption {
+ default = true;
+ type = types.bool;
+ description = ''
+ Enable the Qemu guest agent.
+ '';
+ };
};
virtualisation.useBootLoader =
@@ -494,6 +503,8 @@ in
# Don't run ntpd in the guest. It should get the correct time from KVM.
services.timesyncd.enable = false;
+ services.qemuGuest.enable = cfg.qemu.guestAgent.enable;
+
system.build.vm = pkgs.runCommand "nixos-vm" { preferLocalBuild = true; }
''
mkdir -p $out/bin