From 7dfe959bcc1d310330f92ee53adaaa8320044e1a Mon Sep 17 00:00:00 2001 From: Aditya Date: Thu, 11 Apr 2024 11:23:51 +0530 Subject: [PATCH] add virtualisation option --- modules/nixos/virtualisation/default.nix | 27 ++++++++++++++++-------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/modules/nixos/virtualisation/default.nix b/modules/nixos/virtualisation/default.nix index 582c60a..c55781e 100644 --- a/modules/nixos/virtualisation/default.nix +++ b/modules/nixos/virtualisation/default.nix @@ -1,12 +1,21 @@ -_: { - virtualisation = { - docker.enable = true; - incus.enable = true; - libvirtd.enable = true; - lxc = { - enable = true; - lxcfs.enable = true; +{ + config, + libs, + ... +}: { + options = { + virtualisation.enable = lib.mkEnableOption "enable virtualisation"; + }; + config = lib.mkIf config.virtualisation.enable { + virtualisation = { + docker.enable = true; + incus.enable = true; + libvirtd.enable = true; + lxc = { + enable = true; + lxcfs.enable = true; + }; + waydroid.enable = true; }; - waydroid.enable = true; }; }