NONGUIX_DIR ?= ~/Code/nonguix GUIX_SUBSTITUTE_FLAG = --substitute-urls='https://ci.guix.gnu.org https://substitutes.nonguix.org' GUIX_LIB_FLAGS = -L ./ -L $(NONGUIX_DIR) GUIX_IMAGE_CMD ?= guix system image $(GUIX_SUBSTITUTE_FLAG) --image-type=qcow2 $(GUIX_LIB_FLAGS) LIBVIRT_GROUP ?= libvirt machines/%.qcow2: machines/%.scm $(eval RO := $(shell $(GUIX_IMAGE_CMD) $<)) install -C -m 666 -o $(USER) -g $(LIBVIRT_GROUP) $(RO) $@ VM_RAM ?= 4000 VM_CPU ?= 4 .PHONY: machines/% machines/%: machines/%.qcow2 $(eval OVMF := $(shell guix build $(GUIX_SUBSTITUTE_FLAG) ovmf)) qemu-system-x86_64 -nic bridge,br=virbr0 -enable-kvm -hda $< -m $(VM_RAM) -smp $(VM_CPU) -bios $(OVMF)/share/firmware/ovmf_x64.bin