From d683509a0f412d080ffddde7e67bdf0ccd1f17f1 Mon Sep 17 00:00:00 2001 From: Jacob Janzen Date: Sat, 28 Sep 2024 01:43:09 -0500 Subject: makefile works for nixos --- Makefile | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..8ee9c11 --- /dev/null +++ b/Makefile @@ -0,0 +1,25 @@ +.PHONY: install update rollback + +SRCDIR = ./nixos +DSTDIR = $(HOME)/quarantine + +SOURCES := $(shell find -L $(SRCDIR)/ -type f) +CONFIGS := $(subst $(SRCDIR)/,$(DSTDIR)/,$(SOURCES:%.org=%)) + +all: update + +update: install + nix flake update $(DSTDIR)/.flake + cp $(DSTDIR)/.flake/flake.lock $(SRCDIR)/.flake + sudo nixos-rebuild switch --flake $(DSTDIR)/.flake + +install: $(CONFIGS) + sudo nixos-rebuild switch --flake $(DSTDIR)/.flake + +$(DSTDIR)/%: $(SRCDIR)/%.org + mkdir -p $(dir $@) + python3 ./extract_src.py $< $@ + +$(DSTDIR)/%: $(SRCDIR)/% + mkdir -p $(dir $@) + cp $< $@ -- cgit v1.2.3