mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-04-24 17:08:25 +02:00
feat: justfile - nix gc
This commit is contained in:
12
Justfile
12
Justfile
@@ -45,6 +45,7 @@ repl:
|
|||||||
nix repl -f flake:nixpkgs
|
nix repl -f flake:nixpkgs
|
||||||
|
|
||||||
# remove all generations older than 7 days
|
# remove all generations older than 7 days
|
||||||
|
# on darwin, you may need to switch to root user to run this command
|
||||||
[group('nix')]
|
[group('nix')]
|
||||||
clean:
|
clean:
|
||||||
sudo nix profile wipe-history --profile /nix/var/nix/profiles/system --older-than 7d
|
sudo nix profile wipe-history --profile /nix/var/nix/profiles/system --older-than 7d
|
||||||
@@ -53,8 +54,14 @@ clean:
|
|||||||
[group('nix')]
|
[group('nix')]
|
||||||
gc:
|
gc:
|
||||||
# garbage collect all unused nix store entries
|
# 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
|
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
|
# Enter a shell session which has all the necessary tools for this flake
|
||||||
[linux]
|
[linux]
|
||||||
[group('nix')]
|
[group('nix')]
|
||||||
@@ -72,6 +79,11 @@ fmt:
|
|||||||
# format the nix files in this repo
|
# format the nix files in this repo
|
||||||
nix fmt
|
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
|
# NixOS Desktop related commands
|
||||||
|
|||||||
Reference in New Issue
Block a user