diff options
author | Robin Gloster <mail@glob.in> | 2016-01-15 18:58:40 +0100 |
---|---|---|
committer | Robin Gloster <mail@glob.in> | 2016-01-15 18:58:40 +0100 |
commit | 00b2e1f704a7e17446d8ae88bbd4dd32805c27d9 (patch) | |
tree | 88050d2aeb087eb4247c23f8f72efe1277e34e5e /nixos | |
parent | d4f9220ed202044c645b97b608d0d0b5088922b4 (diff) | |
parent | bce59a1a8bb0430533178df080937ce24efe926a (diff) | |
download | nixlib-00b2e1f704a7e17446d8ae88bbd4dd32805c27d9.tar nixlib-00b2e1f704a7e17446d8ae88bbd4dd32805c27d9.tar.gz nixlib-00b2e1f704a7e17446d8ae88bbd4dd32805c27d9.tar.bz2 nixlib-00b2e1f704a7e17446d8ae88bbd4dd32805c27d9.tar.lz nixlib-00b2e1f704a7e17446d8ae88bbd4dd32805c27d9.tar.xz nixlib-00b2e1f704a7e17446d8ae88bbd4dd32805c27d9.tar.zst nixlib-00b2e1f704a7e17446d8ae88bbd4dd32805c27d9.zip |
Merge pull request #11809 from mayflower/fix/libvirtd_service
libvirtd service: Move mutable configs to /var
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/virtualisation/libvirtd.nix | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/nixos/modules/virtualisation/libvirtd.nix b/nixos/modules/virtualisation/libvirtd.nix index 3668d17ac89b..67fbb8263b05 100644 --- a/nixos/modules/virtualisation/libvirtd.nix +++ b/nixos/modules/virtualisation/libvirtd.nix @@ -122,18 +122,14 @@ in chmod 755 /var/lib/libvirt chmod 755 /var/lib/libvirt/dnsmasq - # Libvirt unfortunately writes mutable state (such as - # runtime changes to VM, network or filter configurations) - # to /etc. So we can't use environment.etc to make the - # default network and filter definitions available, since - # libvirt will then modify the originals in the Nix store. - # So here we copy them instead. Ugly. - for i in $(cd ${pkgs.libvirt}/etc && echo \ + # Copy default libvirt network config .xml files to /var/lib + # Files modified by the user will not be overwritten + for i in $(cd ${pkgs.libvirt}/var/lib && echo \ libvirt/qemu/networks/*.xml libvirt/qemu/networks/autostart/*.xml \ libvirt/nwfilter/*.xml ); do - mkdir -p /etc/$(dirname $i) -m 755 - cp -fpd ${pkgs.libvirt}/etc/$i /etc/$i + mkdir -p /var/lib/$(dirname $i) -m 755 + cp -npd ${pkgs.libvirt}/var/lib/$i /var/lib/$i done # libvirtd puts the full path of the emulator binary in the machine |