aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile47
1 files changed, 47 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..df714bb
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,47 @@
+result_dir = $(wildcard result)
+
+# delete the result directory if it exists
+.PHONY: $(result_dir)
+$(result_dir):
+ rm -rf -- $(result_dir)
+
+.PHONY: all
+all: upgrade
+
+.PHONY: build
+build:
+ nixos-rebuild build --flake .#
+
+.PHONY: build-debug
+build-debug:
+ nixos-rebuild build --show-trace --flake .#
+
+.PHONY: diff
+diff:
+ nvd diff /run/current-system result
+
+.PHONY: deploy
+deploy:
+ nixos-rebuild switch --flake .#
+
+.PHONY: deploy-boot
+deploy-boot:
+ nixos-rebuild boot --flake .#
+
+.PHONY: gc
+gc: | $(result_dir)
+ nix-collect-garbage
+
+.PHONY: gc-old
+gc-old: | $(result_dir)
+ nix-collect-garbage -d
+
+.PHONY: ls-updates
+ls-updates: update build diff
+
+.PHONY: update
+update:
+ nix flake update
+
+.PHONY: upgrade
+upgrade: update deploy