mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-04-11 03:36:52 +02:00
feat: add a test k3s cluster running on kubevirt
This commit is contained in:
34
modules/nixos/server/kubevirt-hardware-configuration.nix
Normal file
34
modules/nixos/server/kubevirt-hardware-configuration.nix
Normal file
@@ -0,0 +1,34 @@
|
||||
{modulesPath, ...}:
|
||||
##############################################################################
|
||||
#
|
||||
# Template for KubeVirt's VM, mainly based on:
|
||||
# https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/virtualisation/kubevirt.nix
|
||||
#
|
||||
# We write our hardware-configuration.nix, so that we can do some customization more easily.
|
||||
#
|
||||
# the url above is used by `nixos-generator` to generate the KubeVirt's qcow2 image file.
|
||||
#
|
||||
##############################################################################
|
||||
{
|
||||
imports = [
|
||||
"${toString modulesPath}/profiles/qemu-guest.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;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user