{
  config,
  lib,
  ...
}:
let
  cfg = config.khscodes.openstack;
in
{
  options.khscodes.openstack = {
    enable = lib.mkEnableOption "Enables the machine as a openstack machine";
    diskName = lib.mkOption {
      type = lib.types.str;
      default = "nixos";
      description = "Name of the root disk device";
    };
  };
  config = lib.mkIf cfg.enable {
    disko = lib.mkDefault (
      lib.khscodes.disko-root-lvm-bios {
        device = "/dev/sda";
        diskName = cfg.diskName;
      }
    );
    # When this is set as the default, outbound ipv6 doesn't work on the instance.
    networking.tempAddresses = "disabled";
    boot.loader.grub.efiSupport = false;
    boot.loader.timeout = 1;
    khscodes.virtualisation.qemu-guest.enable = true;
  };
}
