metznet-channel/Makefile

20 lines
703 B
Makefile

NONGUIX_DIR ?= ~/Code/nonguix
GUIX_SUBSTITUTE_FLAG = --substitute-urls='https://ci.guix.gnu.org https://substitutes.nonguix.org'
2023-11-27 23:12:23 -07:00
GUIX_LIB_FLAGS = -L ./ -L $(NONGUIX_DIR)
LIBVIRT_GROUP ?= libvirt
LIBVIRT_USER ?= $(USER)
GUIX_IMAGE_CMD ?= guix system image $(GUIX_SUBSTITUTE_FLAG) --image-type=qcow2 $(GUIX_LIB_FLAGS)
VM_RAM ?= 4000
VM_CPU ?= 4
machines/%.qcow2: machines/%.scm
$(eval RO := $(shell $(GUIX_IMAGE_CMD) $<))
install -C -m 666 -o $(LIBVIRT_USER) -g $(LIBVIRT_GROUP) $(RO) $@
.PHONY: machines/%
machines/%: machines/%.scm
$(eval VM_SCRIPT := $(shell guix system $(GUIX_LIB_FLAGS) $(GUIX_SUBSTITUTE_FLAG) vm $<))
$(VM_SCRIPT) -m $(VM_RAM) -smp $(VM_CPU) -nic user,model=virtio-net-pci