aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--README13
-rw-r--r--justfile25
2 files changed, 31 insertions, 7 deletions
diff --git a/README b/README
index 0ed3673..a74d355 100644
--- a/README
+++ b/README
@@ -58,13 +58,12 @@ $ tic -xe tmux-256color /var/tmp/tmux-256color.info
# Update
-1. `nix flake update`
-2. `home-manager switch --flake ".#<host>"`
+```
+$ just update
+```
# Garbage Collection
-// 1. `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; }')`
-
-1. `home-manager expire-generations '-1 month'`
-2. `nix profile wipe-history`
-3. `nix store gc`
+```
+$ just gc
+```
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