1 { config, lib, pkgs, ... }:
5 if pkgs.stdenv.hostPlatform.isx86
7 else "ttyAMA0"; # aarch64
10 ./lxc-instance-common.nix
12 ../profiles/qemu-guest.nix
16 system.build.qemuImage = import ../../lib/make-disk-image.nix {
17 inherit pkgs lib config;
19 partitionTableType = "efi";
20 format = "qcow2-compressed";
26 device = "/dev/disk/by-label/nixos";
31 device = "/dev/disk/by-label/ESP";
36 boot.growPartition = true;
37 boot.loader.systemd-boot.enable = true;
39 # image building needs to know what device to install bootloader on
40 boot.loader.grub.device = "/dev/vda";
42 boot.kernelParams = ["console=tty1" "console=${serialDevice}"];
44 services.udev.extraRules = ''
45 SUBSYSTEM=="cpu", CONST{arch}=="x86-64", TEST=="online", ATTR{online}=="0", ATTR{online}="1"
48 virtualisation.lxd.agent.enable = lib.mkDefault true;