commit 206665a8b84104e28d6241efd3507661a0fd53e6 parent bf7cb2e48c905cfd141529b01748e6f8532c9102 Author: Vincent Demeester <vincent@sbr.pm> Date: Mon, 12 Oct 2020 11:42:54 +0200 systems: format virtualization Signed-off-by: Vincent Demeester <vincent@sbr.pm> Diffstat:
M | systems/modules/profiles/virtualization.nix | | | 50 | ++++++++++++++++++++++---------------------------- |
1 file changed, 22 insertions(+), 28 deletions(-)
diff --git a/systems/modules/profiles/virtualization.nix b/systems/modules/profiles/virtualization.nix @@ -31,34 +31,28 @@ in libosinfo ]; } - ( - mkIf cfg.nested { - boot.kernelParams = [ "kvm_intel.nested=1" ]; - environment.etc."modprobe.d/kvm.conf".text = '' - options kvm_intel nested=1 + (mkIf cfg.nested { + boot.kernelParams = [ "kvm_intel.nested=1" ]; + environment.etc."modprobe.d/kvm.conf".text = '' + options kvm_intel nested=1 + ''; + }) + (mkIf config.profiles.desktop.enable { + environment.systemPackages = with pkgs; [ virtmanager ]; + }) + (mkIf cfg.listenTCP { + boot.kernel.sysctl = { "net.ipv4.ip_forward" = 1; }; + virtualisation.libvirtd = { + allowedBridges = [ "br1" ]; + extraConfig = '' + listen_tls = 0 + listen_tcp = 1 + auth_tcp="none" + tcp_port = "16509" ''; - } - ) - ( - mkIf config.profiles.desktop.enable { - environment.systemPackages = with pkgs; [ virtmanager ]; - } - ) - ( - mkIf cfg.listenTCP { - boot.kernel.sysctl = { "net.ipv4.ip_forward" = 1; }; - virtualisation.libvirtd = { - allowedBridges = [ "br1" ]; - extraConfig = '' - listen_tls = 0 - listen_tcp = 1 - auth_tcp="none" - tcp_port = "16509" - ''; - # extraOptions = [ "--listen" ]; - }; - networking.firewall.allowedTCPPorts = [ 16509 ]; - } - ) + # extraOptions = [ "--listen" ]; + }; + networking.firewall.allowedTCPPorts = [ 16509 ]; + }) ]); }