Storage optimization: Difference between revisions

imported>Odyssey346
m Update auto optimise
imported>Sbh69840
m nix.gc.dates is not supported in nix-darwin and hence included an example to use nix.gc.interval
Line 150: Line 150:
</nowiki>}}
</nowiki>}}


If using nix-darwin, use this to run on 0th day of every week:
{{file|configuration.nix|nix|<nowiki>
nix.gc = {
  automatic = true;
  interval = { Weekday = 0; Hour = 0; Minute = 0; };
  options = "--delete-older-than 30d";
};
</nowiki>}}
This can result in redownloads (tarballs fetched with <code>import (builtins.fetchTarball ...)</code> for example are not referenced anywhere and removed on GC), but it frees you from runnning GC manually.
This can result in redownloads (tarballs fetched with <code>import (builtins.fetchTarball ...)</code> for example are not referenced anywhere and removed on GC), but it frees you from runnning GC manually.