aboutsummaryrefslogtreecommitdiffhomepage
path: root/justfile
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2025-04-27 04:04:26 +0900
committernsfisis <nsfisis@gmail.com>2025-04-27 04:11:01 +0900
commit27487e4bb410dc293faeac203e4055ee301b18ea (patch)
tree75c86be1046df6f5d19177e15b4867dbe6cf0e68 /justfile
parent80dc4c043549c21777d98bf7b76472c478bce3be (diff)
downloaddotfiles-27487e4bb410dc293faeac203e4055ee301b18ea.tar.gz
dotfiles-27487e4bb410dc293faeac203e4055ee301b18ea.tar.zst
dotfiles-27487e4bb410dc293faeac203e4055ee301b18ea.zip
just: add justfile for dotfiles
Diffstat (limited to 'justfile')
-rw-r--r--justfile25
1 files changed, 25 insertions, 0 deletions
diff --git a/justfile b/justfile
new file mode 100644
index 0000000..0c13594
--- /dev/null
+++ b/justfile
@@ -0,0 +1,25 @@
+help:
+ @just --list
+
+update HOST:
+ nix flake update
+ git add -- ./flake.lock
+ git commit -m "nix: update flake"
+ just switch "{{HOST}}"
+
+sync HOST:
+ git fetch --all
+ git stash save
+ git switch -d origin/main
+ git stash pop
+ just switch "{{HOST}}"
+
+switch HOST:
+ home-manager switch --flake ".#{{HOST}}"
+
+gc:
+ # TODO: leave the last 3 generations?
+ # home-manager remove-generations $({ home-manager generations | tail +4 && date -d '-1 month' '+%Y-%m-%d %H:%M : id DELETE ->'; } | sort -r | sed -n '/: id DELETE ->/,$p' | tail +2 | grep -o ': id [0-9]* ->' | awk '{ print $3; }')
+ home-manager expire-generations '-1 month'
+ nix profile wipe-history
+ nix store gc