infra/modules/shared/builder.nix

13 lines
389 B
Nix
Raw Normal View History

{ config, lib, pkgs, ... }:
2023-09-07 12:47:33 +10:00
{
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 }')))"
2023-09-07 12:47:33 +10:00
'';
}