summaryrefslogtreecommitdiffstats
path: root/nixos/modules/virtualisation/kubevirt.nix
blob: 5e855d3af06e74ab8ff0413bdee484594d28fc99 (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
{
  config,
  lib,
  pkgs,
  ...
}:

{
  imports = [
    ../profiles/qemu-guest.nix
    ../image/file-options.nix
  ];

  config = {
    fileSystems."/" = {
      device = "/dev/disk/by-label/nixos";
      fsType = "ext4";
      autoResize = true;
    };

    boot.growPartition = true;
    boot.kernelParams = [ "console=ttyS0" ];
    boot.loader.grub.device = "/dev/vda";
    boot.loader.timeout = 0;

    services.qemuGuest.enable = true;
    services.openssh.enable = true;
    services.cloud-init.enable = true;
    systemd.services."serial-getty@ttyS0".enable = true;

    system.nixos.tags = [ "kubevirt" ];
    image.extension = "qcow2";
    system.build.image = config.system.build.kubevirtImage;
    system.build.kubevirtImage = import ../../lib/make-disk-image.nix {
      inherit lib config pkgs;
      inherit (config.image) baseName;
      format = "qcow2";
    };
  };
}