summaryrefslogtreecommitdiff
path: root/hosts/sif/libvirt/default.nix
blob: d0be7dff7c2852ce2a55ab944a26a7647efc978b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
{ flakeInputs, ... }:

with flakeInputs.nixVirt.lib;

{
  config = {
    virtualisation.libvirtd = {
      qemu.swtpm.enable = true;
      allowedBridges = ["virbr0" "rz-0971" "rz-2403"];
    };
    virtualisation.libvirt = {
      enable = true;
      swtpm.enable = true;
      connections."qemu:///system" = {
        networks = [
          { active = null;
            definition = network.writeXML {
              name = "default";
              uuid = "012bfad7-4408-4345-8747-041853ef84c6";
              forward.mode = "nat";
              bridge = {
                name = "virbr0";
                stp = true;
                delay = 0;
              };
              mac.address = "52:54:00:ad:34:af";
              ip = {
                address = "192.168.122.1";
                netmask = "255.255.255.0";
                dhcp.range = {
                  start = "192.168.122.2";
                  end = "192.168.122.254";
                };
              };
            };
          }
        ];
      };
    };
  };
}