From f79ec7e060465f3a1e9d76ea89f93c4c2bc5333d Mon Sep 17 00:00:00 2001 From: Johannes Rothe Date: Sun, 7 Jul 2024 21:57:17 +0200 Subject: [PATCH] Add Makefile to manage commands --- Makefile | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..22780f0 --- /dev/null +++ b/Makefile @@ -0,0 +1,26 @@ +.PHONY: upgrade update switch home clean gc home history repl + +upgrade: update home switch + +update: + @nix flake update + +switch: + @sudo nixos-rebuild switch --flake . + +home: + @home-manager switch --flake . + +clean: + # remove all generations older than 30 days + @sudo nix profile wipe-history --profile /nix/var/nix/profiles/system --older-than 30d + +gc: + # garbage collect all unused nix store entries + @sudo nix-collect-garbage --delete-old + +history: + @nix profile history --profile /nix/var/nix/profiles/system + +repl: + @nix repl -f flake:nixpkgs