summaryrefslogtreecommitdiffstats
path: root/nixos/modules
diff options
context:
space:
mode:
authorTristan Helmich <tristan.helmich@gmail.com>2017-02-21 13:26:23 +0100
committerRobin Gloster <mail@glob.in>2017-02-21 19:20:22 +0100
commit1d64f5f41b79e7698dfe4bb866a290643b3b60ad (patch)
treef0f476e7f7f074c7e09a9b58db77f20962f49bf3 /nixos/modules
parentba267839d1db8a00366669520f959bdd3f134fc6 (diff)
libvirt: expose libvirt qemu configuration file
fixes #22823
Diffstat (limited to 'nixos/modules')
-rw-r--r--nixos/modules/virtualisation/libvirtd.nix18
1 files changed, 18 insertions, 0 deletions
diff --git a/nixos/modules/virtualisation/libvirtd.nix b/nixos/modules/virtualisation/libvirtd.nix
index 5f669dee7545..101ea9a4f51b 100644
--- a/nixos/modules/virtualisation/libvirtd.nix
+++ b/nixos/modules/virtualisation/libvirtd.nix
@@ -13,6 +13,9 @@ let
auth_unix_rw = "none"
${cfg.extraConfig}
'';
+ qemuConfigFile = pkgs.writeText "qemu.conf" ''
+ ${cfg.qemuVerbatimConfig}
+ '';
in {
@@ -48,6 +51,18 @@ in {
'';
};
+ virtualisation.libvirtd.qemuVerbatimConfig = mkOption {
+ type = types.lines;
+ default = ''
+ namespaces = []
+ '';
+ description = ''
+ Contents written to the qemu configuration file, qemu.conf.
+ Make sure to include a proper namespace configuration when
+ supplying custom configuration.
+ '';
+ };
+
virtualisation.libvirtd.extraOptions = mkOption {
type = types.listOf types.str;
default = [ ];
@@ -119,6 +134,9 @@ in {
cp -npd ${pkgs.libvirt}/var/lib/$i /var/lib/$i
done
+ # Copy generated qemu config to libvirt directory
+ cp -f ${qemuConfigFile} /var/lib/libvirt/qemu.conf
+
# libvirtd puts the full path of the emulator binary in the machine
# config file. But this path can unfortunately be garbage collected
# while still being used by the virtual machine. So update the