summaryrefslogtreecommitdiff
path: root/misc/nixgc.nix
diff options
context:
space:
mode:
Diffstat (limited to 'misc/nixgc.nix')
-rw-r--r--misc/nixgc.nix11
1 files changed, 11 insertions, 0 deletions
diff --git a/misc/nixgc.nix b/misc/nixgc.nix
new file mode 100644
index 0000000..9b2b357
--- /dev/null
+++ b/misc/nixgc.nix
@@ -0,0 +1,11 @@
+# this is a shell script that uses the new nix cli to emulate
+# nix-collect-garbage
+with (import (builtins.getFlake "nixpkgs") {});
+ writeScriptBin "nixgc" ''
+ #!${fish}/bin/fish
+ set -l profiles (find /nix/var/nix/profiles/ -maxdepth 3 -type l -not -name '*-link')
+
+ for profile in $profiles
+ sudo nix profile wipe-history --profile $profile
+ end
+ ''