aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorgrm@eyesin.space <grm@eyesin.space>2025-09-02 23:04:24 +0000
committergrm@eyesin.space <grm@eyesin.space>2025-09-02 23:04:24 +0000
commit47ef05ab310bb466300e93d1459370450414fbc4 (patch)
tree808f155d2871f831af743509de982c4c9789357c /Makefile
downloadnixos-config-47ef05ab310bb466300e93d1459370450414fbc4.tar.gz
nixos-config-47ef05ab310bb466300e93d1459370450414fbc4.tar.bz2
nixos-config-47ef05ab310bb466300e93d1459370450414fbc4.zip
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