# Copyright (C) 2023 Denis 'GNUtoo' Carikli # # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or (at # your option) any later version. # # You should have received a copy of the GNU General Public License # along with this file. If not, see . dist_pkgdata_DATA = mumble-vm.img CLEANFILES = \ first-boot.sh \ guix-commit.txt \ index.html \ mumble-vm.img \ mumble-vm-machine.scm \ mumble-vm-system.scm # We want to only update the image when guix commit changes. The trick # to make that work is to only create or update a file when the revision # changes. guix-commit.txt: Makefile if [ ! -f $@ ] ; then \ guix describe | grep '^ commit:' | awk '{print $$2}' > $@ ; \ elif [ "$(cat $@)" != \ "$(guix describe | \ grep '^ commit:' | awk '{print $$2}')" ] ; then \ guix describe | grep '^ commit:' | awk '{print $$2}' > $@ ; \ fi %.html: %.html.tmpl guix-commit.txt Makefile sed 's#DOMAIN#$(DOMAIN)#g' $< > $@ %.scm: %.scm.tmpl guix-commit.txt Makefile sed 's#DOMAIN#$(DOMAIN)#g' $< > $@ IMAGE_SOURCE = \ guix-commit.txt \ index.html \ mumble-vm-machine.scm \ mumble-vm-system.scm \ id_ed25519.pub \ Makefile \ signing-key.pub mumble-vm.img: $(IMAGE_SOURCE) sudo install \ `guix system image \ --image-type=mbr-raw \ --image-size=6G mumble-vm-system.scm` \ $@ deploy: $(IMAGE_SOURCE) guix deploy -L . mumble-vm-machine.scm