mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-03-19 15:53:46 +01:00
feat: justfile - nix gc
This commit is contained in:
12
Justfile
12
Justfile
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user