Modularize libvirt
This commit is contained in:
parent
22f092e6e9
commit
b236936061
5 changed files with 35 additions and 14 deletions
|
|
@ -11,6 +11,7 @@
|
|||
./fish.nix
|
||||
./fonts.nix
|
||||
./kvm-switch-enable-screen.nix
|
||||
./libvirt.nix
|
||||
./localization.nix
|
||||
./mute-indicator.nix
|
||||
./nix.nix
|
||||
|
|
|
|||
31
modules/libvirt.nix
Normal file
31
modules/libvirt.nix
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
cfg = config.myConfig;
|
||||
in
|
||||
{
|
||||
options.myConfig = {
|
||||
libvirt = {
|
||||
enable = pkgs.lib.mkEnableOption "Enable libvirt";
|
||||
};
|
||||
};
|
||||
config = lib.mkIf cfg.libvirt.enable {
|
||||
environment.systemPackages = with pkgs; [
|
||||
spice-gtk
|
||||
virt-manager
|
||||
];
|
||||
virtualisation = {
|
||||
docker.enable = true;
|
||||
libvirtd = {
|
||||
enable = true;
|
||||
qemu.ovmf.enable = true;
|
||||
|
||||
# start: starts all guests that were running prior to shutdown
|
||||
# ignore: only start guests which are marked as autostart
|
||||
onBoot = "ignore";
|
||||
|
||||
onShutdown = "shutdown";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue