feat: justfile - nix gc

This commit is contained in:
Ryan Yin
2024-08-12 17:44:25 +08:00
parent 930d8322d1
commit 08a6885873

View File

@@ -45,6 +45,7 @@ repl:
nix repl -f flake:nixpkgs
# remove all generations older than 7 days
# on darwin, you may need to switch to root user to run this command
[group('nix')]
clean:
sudo nix profile wipe-history --profile /nix/var/nix/profiles/system --older-than 7d
@@ -53,8 +54,14 @@ clean:
[group('nix')]
gc:
# garbage collect all unused nix store entries
# NOTE: it's a system-wide garbage collection, but it seems won't affect home-manager's gcroot on darwin
sudo nix-collect-garbage --delete-old
[group('nix')]
gc-home:
# garbage collect all unused nix store entries(for the user - home-manager)
nix-collect-garbage --delete-old
# Enter a shell session which has all the necessary tools for this flake
[linux]
[group('nix')]
@@ -72,6 +79,11 @@ fmt:
# format the nix files in this repo
nix fmt
# Show all the auto gc roots in the nix store
[group('nix')]
gcroot:
ls -al /nix/var/nix/gcroots/auto/
############################################################################
#
# NixOS Desktop related commands