diff --git a/builds/rebuild.nix b/builds/rebuild.nix index 97c2968..5b02f99 100644 --- a/builds/rebuild.nix +++ b/builds/rebuild.nix @@ -19,6 +19,7 @@ stdenv.mkDerivation rec { mkdir -p $out/bin cp $src/rebuild $out/bin cp $src/git-rebuild $out/bin + cp $src/nix-sanitation $out/bin wrapProgram $out/bin/rebuild --prefix PATH : ${lib.makeBinPath [ bash ]} ''; diff --git a/builds/rebuild/nix-sanitation b/builds/rebuild/nix-sanitation new file mode 100755 index 0000000..1f8713e --- /dev/null +++ b/builds/rebuild/nix-sanitation @@ -0,0 +1,7 @@ +#!/bin/sh + +printf "clearing out nix caches\n" + +sudo nix-collect-garbage -d +nix-collect-garbage -d +sudo nix-store --optimize