diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 25 |
1 files changed, 25 insertions, 0 deletions
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 $< $@ |