9 serialDevice = if pkgs.stdenv.hostPlatform.isx86 then "ttyS0" else "ttyAMA0"; # aarch64
13 ./lxc-instance-common.nix
15 ../profiles/qemu-guest.nix
19 system.build.qemuImage = import ../../lib/make-disk-image.nix {
20 inherit pkgs lib config;
22 partitionTableType = "efi";
23 format = "qcow2-compressed";
29 device = "/dev/disk/by-label/nixos";
34 device = "/dev/disk/by-label/ESP";
39 boot.growPartition = true;
40 boot.loader.systemd-boot.enable = true;
42 # image building needs to know what device to install bootloader on
43 boot.loader.grub.device = "/dev/vda";
47 "console=${serialDevice}"
50 services.udev.extraRules = ''
51 SUBSYSTEM=="cpu", CONST{arch}=="x86-64", TEST=="online", ATTR{online}=="0", ATTR{online}="1"
54 virtualisation.lxd.agent.enable = lib.mkDefault true;