mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-11-27 17:02:31 +01:00
39 lines
1.3 KiB
Nix
39 lines
1.3 KiB
Nix
{
|
|
modulesPath,
|
|
lib,
|
|
...
|
|
}:
|
|
##############################################################################
|
|
#
|
|
# Template for the VM guests (formerly KubeVirt), 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.
|
|
#
|
|
##############################################################################
|
|
{
|
|
imports = [
|
|
"${toString modulesPath}/profiles/qemu-guest.nix"
|
|
];
|
|
|
|
config = {
|
|
# disable backups in the VM
|
|
modules.btrbk.enable = lib.mkForce false;
|
|
|
|
# VM guest: no physical hardware to inspect.
|
|
modules.hardwareTools.enable = lib.mkForce false;
|
|
|
|
boot.growPartition = true;
|
|
boot.kernelParams = [ "console=ttyS0" ];
|
|
boot.loader.grub.device = "/dev/vda";
|
|
|
|
services.qemuGuest.enable = true; # qemu-guest-agent
|
|
services.openssh.enable = true;
|
|
# we configure the host via nixos itself, so we don't need the cloud-init
|
|
services.cloud-init.enable = lib.mkForce false;
|
|
# Default so the NixOS test framework can override it: test-instrumentation
|
|
# disables this getty to keep ttyS0 free for its backdoor console.
|
|
systemd.services."serial-getty@ttyS0".enable = lib.mkDefault true;
|
|
};
|
|
}
|