Commit 95e6241eede4

Vincent Demeester <vincent@sbr.pm>
2019-01-23 18:33:28
profiles.virtualization: add listen to TCP for libvirt
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
1 parent ee7eb18
Changed files (2)
machine
modules
machine/hokkaido.nix
@@ -22,7 +22,10 @@ with import ../assets/machines.nix; {
     docker.enable = true;
     ssh.enable = true;
     syncthing.enable = true;
-    virtualization.enable = true;
+    virtualization = {
+      enable = true;
+      listenTCP = true;
+    };
     nix-config.buildCores = 2;
   };
   services = {
modules/profiles/virtualization.nix
@@ -12,11 +12,20 @@ in
         description = "Enable virtualization profile";
         type = types.bool;
       };
+      listenTCP = mkOption {
+        default = false;
+        description = "Make libvirt listen to TCP";
+        type = types.bool;
+      };
     };
   };
   config = mkIf cfg.enable {
     virtualisation.libvirtd = {
       enable = true;
+      extraConfig = mkIf cfg.listenTCP ''
+      listen_tcp = 1
+      tcp_port = "16509"
+      '';
     };
     environment.systemPackages = with pkgs; [
       qemu