Nix Flakes configuration for MacOS, NixOS and WSL
1{
2 flake.nixosModules.garbageCollector = { ... }: {
3 nix.settings.auto-optimise-store = true;
4 nix.gc = {
5 automatic = true;
6 dates = "weekly";
7 options = "--delete-older-than 1w";
8 };
9 };
10
11 flake.darwinModules.garbageCollector = { ... }: {
12 nix.gc = {
13 automatic = true;
14 interval = [{ Weekday = 7; }];
15 options = "--delete-older-than 7d";
16 };
17 nix.optimise.automatic = true;
18 };
19}