about summary refs log tree commit diff
path: root/nix/modules/libvirtnix/config.nix
blob: e1a8d28dec2162c2cee8885ed0c385a610226cb2 (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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
{
  services.emile.libvirtnix = {
    enable = true;
    vm = {
      "alan" = {
        vm_type = "kvm";
        id = "1337";
        name = "blub";
        uuid = "cafebabe-d474-452b-80f4-c951c39bcf74";

        metadata.libosinfo = "https://libosinfo.org/xmlns/libvirt/domain/1.0";
        metadata.libosinfo_os = "https://nixos.org/nixos/unknown";

        memory.unit = "KiB";
        memory.value = 2097152;

        currentMemory.unit = "KiB";
        currentMemory.value = 2097152;

        vcpu.placement = "static";
        vcpu.count = 3;

        resource.partition = "/machine";

        os = {
          type = {
            arch = "x86_64";
            machine = "pc-q35-3.1";
            value = "hvm";
          };

          loader = {
            readonly = "yes";
            type = "pflash";
            value = "/usr/share/OVMF/OVMF_CODE.fd";
          };

          nvram.value = "/var/lib/libvirt/qemu/nvram/fileserver2_VARS.fd";

          boot.dev = "hd";
        };

        features = {
          acpi = true;
          apic = true;
          vmport = {
            state = "off";
          };
        };

        cpu = {
          mode = "host-passthrough";
          check = "none";
          migratable = "on";
        };
      };
    };
  };
}