summaryrefslogtreecommitdiff
path: root/misc/nixgc.nix
blob: 9b2b35711e256447ffec35fc69bb701d72aa46bd (plain)
1
2
3
4
5
6
7
8
9
10
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
  ''