infra/modules/shared/builder.nix

10 lines
233 B
Nix
Raw Normal View History

2023-09-07 12:47:33 +10:00
{ pkgs, ... }:
let
asGB = size: toString (size * 1024 * 1024 * 1024);
in
{
nix.gc.options = ''
--max-freed "$((${asGB 50} * 1024**3 - 1024 * $(df -P -k /nix/store | tail -n 1 | ${pkgs.gawk}/bin/awk '{ print $4 }')))"
'';
}