2023-07-15 20:37:59 +00:00
|
|
|
.DEFAULT_GOAL := build
|
|
|
|
|
|
|
|
GUIX_MANIFEST := manifest.scm
|
|
|
|
GUIX_MANIFEST_DEV := manifest-dev.scm
|
|
|
|
|
|
|
|
TARBALL ?= guix-tarball-pack.tar.gz
|
2023-12-29 01:55:50 +00:00
|
|
|
LINKS_TARBALL ?= links.tar.gz
|
2023-07-15 20:37:59 +00:00
|
|
|
IMAGE_TAG ?= guix-builder
|
|
|
|
|
2023-12-29 01:55:50 +00:00
|
|
|
$(LINKS_TARBALL):
|
|
|
|
ln -s /guix-builder/bin bin
|
|
|
|
tar -czvf links.tar.gz bin
|
|
|
|
rm bin
|
|
|
|
|
2023-07-15 20:37:59 +00:00
|
|
|
$(TARBALL):
|
|
|
|
@cp $$(guix pack -R -S /bin=bin -S /etc/ssl=etc/ssl -m $(GUIX_MANIFEST)) $@
|
|
|
|
@chmod +w $@
|
|
|
|
|
|
|
|
.PHONY: build
|
2023-12-29 01:55:50 +00:00
|
|
|
build: $(TARBALL) $(LINKS_TARBALL)
|
2023-07-15 20:37:59 +00:00
|
|
|
@docker build -t $(IMAGE_TAG) .
|
|
|
|
|
|
|
|
.PHONY: run
|
|
|
|
run: build
|
|
|
|
@docker run --rm -it \
|
|
|
|
-v /var/guix/daemon-socket/socket:/var/guix/daemon-socket/socket \
|
|
|
|
-v /gnu/store:/gnu/store:ro \
|
|
|
|
-v /etc/ssl:/etc/ssl:ro \
|
|
|
|
-e HOME=/tmp \
|
|
|
|
-w /tmp \
|
|
|
|
$(IMAGE_TAG):latest
|
|
|
|
|
|
|
|
.PHONY: shell
|
|
|
|
shell:
|
|
|
|
@./shell.sh $(GUIX_MANIFEST) $(GUIX_MANIFEST_DEV)
|
|
|
|
|
|
|
|
.PHONY:
|
|
|
|
clean:
|
2023-12-29 01:55:50 +00:00
|
|
|
rm -r $(TARBALL) $(LINKS_TARBALL)
|