modules/shared/builder: add gc.gbFree option
This commit is contained in:
parent
149ab64725
commit
38f5a5ac47
1 changed files with 9 additions and 3 deletions
|
@ -1,6 +1,12 @@
|
|||
{ pkgs, ... }:
|
||||
{ config, lib, pkgs, ... }:
|
||||
{
|
||||
nix.gc.options = ''
|
||||
--max-freed "$((50 * 1024**3 - 1024 * $(df -P -k /nix/store | tail -n 1 | ${pkgs.gawk}/bin/awk '{ print $4 }')))"
|
||||
options.nixCommunity.gc.gbFree = lib.mkOption {
|
||||
type = lib.types.int;
|
||||
default = 50;
|
||||
description = "Amount of free space in GB to keep on disk.";
|
||||
};
|
||||
|
||||
config.nix.gc.options = ''
|
||||
--max-freed "$((${toString config.nixCommunity.gc.gbFree} * 1024**3 - 1024 * $(df -P -k /nix/store | tail -n 1 | ${pkgs.gawk}/bin/awk '{ print $4 }')))"
|
||||
'';
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue