Skip to content

Commit

Permalink
Revert "fix #150: enable min-free and max-free GC"
Browse files Browse the repository at this point in the history
This reverts commit e4ae363.
  • Loading branch information
roberth committed Nov 6, 2019
1 parent a620e1a commit 5b59540
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions for-upstream/gc.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,9 @@ in
Amount of free space (GB) to ensure on garbage collection
'';
};
freespaceMinimumGB = mkOption {
type = types.nullOr types.int;
default = 10;
description = ''
Amount of free space (GB) Nix will allow /nix/store to drop to before GC-ing.
'';
};
};

config = mkIf (cfg.enable && cfg.freespaceGB != null) {
nix.extraOptions = ''
min-free = ${toString (1024 * 1024 * 1024 * cfg.freespaceMinimumGB)}
max-free = ${toString (1024 * 1024 * 1024 * cfg.freespaceGB)}
'';
nix.gc.automatic = true;
nix.gc.options = ''--max-freed "$((${toString cfg.freespaceGB} * 1024**3 - 1024 * $(df -P -k /nix/store | tail -n 1 | ${pkgs.gawk}/bin/awk '{ print $4 }')))"'';
};
Expand Down

0 comments on commit 5b59540

Please sign in to comment.