0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-13 13:40:28 +03:00

Merge pull request #24148 from volth/libvirt-3.1.0

libvirt: 3.0.0 -> 3.1.0
This commit is contained in:
Franz Pletz 2017-03-27 10:02:06 +02:00 committed by GitHub
commit 1b95985b71
5 changed files with 51 additions and 31 deletions

View file

@ -90,14 +90,16 @@ in {
config = mkIf cfg.enable {
environment.systemPackages =
[ pkgs.libvirt pkgs.netcat-openbsd ]
++ optional cfg.enableKVM pkgs.qemu_kvm;
environment.systemPackages = with pkgs;
[ libvirt netcat-openbsd ]
++ optional cfg.enableKVM qemu_kvm;
boot.kernelModules = [ "tun" ];
users.extraGroups.libvirtd.gid = config.ids.gids.libvirtd;
systemd.packages = [ pkgs.libvirt ];
systemd.services.libvirtd = {
description = "Libvirt Virtual Machine Management Daemon";
@ -105,13 +107,17 @@ in {
after = [ "systemd-udev-settle.service" ]
++ optional vswitch.enable "vswitchd.service";
path = [
pkgs.bridge-utils
pkgs.dmidecode
pkgs.dnsmasq
pkgs.ebtables
environment = {
LIBVIRTD_ARGS = ''--config "${configFile}" ${concatStringsSep " " cfg.extraOptions}'';
};
path = with pkgs; [
bridge-utils
dmidecode
dnsmasq
ebtables
]
++ optional cfg.enableKVM pkgs.qemu_kvm
++ optional cfg.enableKVM qemu_kvm
++ optional vswitch.enable vswitch.package;
preStart = ''
@ -153,13 +159,17 @@ in {
''; # */
serviceConfig = {
ExecStart = ''@${pkgs.libvirt}/sbin/libvirtd libvirtd --config "${configFile}" ${concatStringsSep " " cfg.extraOptions}'';
Type = "notify";
KillMode = "process"; # when stopping, leave the VMs alone
Restart = "on-failure";
};
};
systemd.services.libvirt-guests = {
wantedBy = [ "multi-user.target" ];
path = with pkgs; [ coreutils libvirt gawk ];
};
systemd.sockets.virtlogd = {
description = "Virtual machine log manager socket";
wantedBy = [ "sockets.target" ];