modules/virtualization: add virtualization module

This commit is contained in:
Infinidoge 2021-12-16 09:30:57 -05:00
parent 2880e2dfd6
commit 9f44debc6e
3 changed files with 18 additions and 7 deletions

View file

@ -7,8 +7,6 @@
(with profiles; [ (with profiles; [
networking.wireless networking.wireless
virtualization
]) ])
./hardware-configuration.nix ./hardware-configuration.nix
@ -40,6 +38,7 @@
desktop = { desktop = {
gaming.enableAll = true; gaming.enableAll = true;
}; };
virtualization.enable = true;
}; };
networking.interfaces = { networking.interfaces = {

View file

@ -0,0 +1,17 @@
{ config, lib, pkgs, ... }:
with lib;
with lib.hlissner;
let
cfg = config.modules.virtualzation;
in
{
options.modules.virtualization = {
enable = mkBoolOpt false;
};
config = mkIf cfg.enable {
virtualisation.libvirtd.enable = true;
programs.dconf.enable = true;
environment.systemPackages = with pkgs; [ virt-manager ];
};
}

View file

@ -1,5 +0,0 @@
{ pkgs, ... }: {
virtualisation.libvirtd.enable = true;
programs.dconf.enable = true;
environment.systemPackages = with pkgs; [ virt-manager ];
}