mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-26 21:33:03 +03:00
* Add an Upstart job for libvirtd.
svn path=/nixos/trunk/; revision=26114
This commit is contained in:
parent
e46fca2185
commit
6fd7f8e0e6
@ -167,5 +167,6 @@
|
||||
./tasks/network-interfaces.nix
|
||||
./tasks/swraid.nix
|
||||
./tasks/tty-backgrounds.nix
|
||||
./virtualisation/libvirtd.nix
|
||||
./virtualisation/xen-dom0.nix
|
||||
]
|
||||
|
64
modules/virtualisation/libvirtd.nix
Normal file
64
modules/virtualisation/libvirtd.nix
Normal file
@ -0,0 +1,64 @@
|
||||
# Upstart jobs for libvirtd.
|
||||
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
with pkgs.lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.virtualisation.libvirtd;
|
||||
|
||||
in
|
||||
|
||||
{
|
||||
###### interface
|
||||
|
||||
options = {
|
||||
|
||||
virtualisation.libvirtd.enable =
|
||||
mkOption {
|
||||
default = false;
|
||||
description =
|
||||
''
|
||||
This option enables libvirtd, a daemon that manages
|
||||
virtual machines. You can interact with the daemon
|
||||
(e.g. to start or stop VMs) using the
|
||||
<command>virsh</command> command line tool, among others.
|
||||
'';
|
||||
};
|
||||
|
||||
virtualisation.libvirtd.enableKVM =
|
||||
mkOption {
|
||||
default = true;
|
||||
description =
|
||||
''
|
||||
This option enables support for QEMU/KVM in libvirtd.
|
||||
'';
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
|
||||
###### implementation
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
environment.systemPackages = [ pkgs.libvirt ];
|
||||
|
||||
jobs.libvirtd =
|
||||
{ description = "Libvirtd virtual machine management daemon";
|
||||
|
||||
startOn = "stopped udevtrigger";
|
||||
|
||||
path =
|
||||
[ pkgs.bridge_utils pkgs.dmidecode
|
||||
] ++ optional cfg.enableKVM pkgs.qemu_kvm;
|
||||
|
||||
exec = "${pkgs.libvirt}/sbin/libvirtd --daemon --verbose";
|
||||
|
||||
daemonType = "daemon";
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user