aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJacob Janzen <jacob.a.s.janzen@gmail.com>2024-09-28 01:43:09 -0500
committerJacob Janzen <jacob.a.s.janzen@gmail.com>2024-09-28 01:43:09 -0500
commitd683509a0f412d080ffddde7e67bdf0ccd1f17f1 (patch)
treec97ffb024e5abdd1f57fac8b9acf27c7f1f0575f /Makefile
parentb7e84fa6048007cda7e6c8226e28bc2db90f792a (diff)
makefile works for nixos
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile25
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 $< $@