CASCADE/profiles/qemu-vm/default.nix

48 lines
1.3 KiB
Nix

{lib, config, ...}:
with lib;
{
imports = [ (toString ../base) ];
config = {
deployment.targetUser = lib.mkDefault "root";
cascade.bridge-interface = mkImageMediaOverride "ens18";
fileSystems."/" = {
device = "/dev/disk/by-label/nixos";
fsType = "ext4";
autoResize = true;
};
fileSystems."/boot" = {
device = "/dev/disk/by-label/ESP";
fsType = "vfat";
};
swapDevices = [
{device = "/swap"; size = 1024;} # make sure we always have enough memory to rebuild nixos.
];
# boot.initrd.network.enable = true;
# networking.useDHCP = true;
networking.useNetworkd = mkForce true;
networking.networkmanager.enable = false;
boot.initrd.availableKernelModules = [ "virtio_net" "virtio_pci" "virtio_mmio" "virtio_blk" "virtio_scsi" "9p" "9pnet_virtio" ];
boot.initrd.kernelModules = [ "virtio_balloon" "virtio_console" "virtio_rng" ];
boot.growPartition = true;
boot.kernelParams = [ "console=ttyS0" ];
boot.loader.grub.device = "/dev/vda";
boot.loader.timeout = mkDefault 3;
boot.consoleLogLevel = 3;
boot.initrd.verbose = true;
services.getty.autologinUser = "root";
services.sshd.enable = true;
networking.firewall.allowedTCPPorts = [ 22 ];
services.qemuGuest.enable = true;
};
}