From bdaeffdefa1efa9f76ff83ceb6e78537b21e64e5 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Thu, 3 Aug 2023 22:56:04 +0300 Subject: [PATCH] add basic virtualization module --- modules/.gitkeep | 0 modules/virtualization/default.nix | 5 +++++ modules/virtualization/virt-manager.nix | 20 ++++++++++++++++++++ 3 files changed, 25 insertions(+) delete mode 100644 modules/.gitkeep create mode 100644 modules/virtualization/virt-manager.nix diff --git a/modules/.gitkeep b/modules/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/modules/virtualization/default.nix b/modules/virtualization/default.nix index e69de29b..9c7be83e 100644 --- a/modules/virtualization/default.nix +++ b/modules/virtualization/default.nix @@ -0,0 +1,5 @@ +{ + imports = [ + ./virt-manager.nix + ]; +} diff --git a/modules/virtualization/virt-manager.nix b/modules/virtualization/virt-manager.nix new file mode 100644 index 00000000..5c5cbb91 --- /dev/null +++ b/modules/virtualization/virt-manager.nix @@ -0,0 +1,20 @@ +{ outputs, options, config, lib, pkgs, ...}: +with lib; +let + cfg = config.modules.virtualization.libvirtd; +in +{ + options.modules.virtualization.libvirtd = { + enable = mkEnableOption false; + }; + + config = mkIf cfg.enable { + virtualization.libvirtd.enable = true; + programs.dconf.enable = true; + environtment.systemPackages = with pkgs; [ + virt-manager + ]; + + users.users.sako.extraGroups = [ "libvirtd" ]; + }; +}