From 27487e4bb410dc293faeac203e4055ee301b18ea Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 27 Apr 2025 04:04:26 +0900 Subject: just: add justfile for dotfiles --- justfile | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 justfile (limited to 'justfile') 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 -- cgit v1.2.3-70-g09d2