From 892de67a9f64d0b0cdb023d830a019d8feec0a57 Mon Sep 17 00:00:00 2001 From: Jakub Stachurski Date: Wed, 19 Nov 2025 21:02:52 +0100 Subject: Nix fmt --- modules/virt.nix | 39 ++++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 17 deletions(-) (limited to 'modules/virt.nix') diff --git a/modules/virt.nix b/modules/virt.nix index 597b957..53bd70a 100644 --- a/modules/virt.nix +++ b/modules/virt.nix @@ -1,34 +1,39 @@ -{pkgs, config, lib, ...}: -let - cfg = config.addons.virtualisation; -in +{ + pkgs, + config, + lib, + ... +}: +let + cfg = config.addons.virtualisation; +in { options.addons.virtualisation = { - host = lib.mkEnableOption "Allow to host vm's and containers"; - guest = lib.mkEnableOption "Enable guest agents"; - }; + host = lib.mkEnableOption "Allow to host vm's and containers"; + guest = lib.mkEnableOption "Enable guest agents"; + }; - config = lib.mkMerge([ + config = lib.mkMerge ([ (lib.mkIf cfg.host { - environment.systemPackages = with pkgs; [ - qemu - ]; + environment.systemPackages = with pkgs; [ + qemu + ]; programs.virt-manager.enable = true; virtualisation = { - spiceUSBRedirection.enable = true; + spiceUSBRedirection.enable = true; docker.enable = true; libvirtd = { enable = true; qemu = { - swtpm.enable = true; + swtpm.enable = true; vhostUserPackages = with pkgs; [ virtiofsd ]; }; }; - }; - + }; + }) (lib.mkIf cfg.guest { - services.spice-vdagentd.enable = true; + services.spice-vdagentd.enable = true; }) ]); -} +} -- cgit v1.3.1