builder: Improve garbage collect

This commit is contained in:
Julian Mutter 2024-12-20 14:05:11 +01:00
parent 22db460211
commit 4590c9fe1f

View File

@ -71,14 +71,16 @@
nix.optimise.dates = [ "03:15" ];
nix.gc.automatic = true;
nix.gc.dates = "weekly";
nix.gc.options = "--delete-older-than 30d";
nix.gc.dates = "daily";
nix.gc.options = "--delete-old";
# Garbage collect up to 30 GiB when only 5 GiB storage left
# nix.settings.keep-derivations = false;
# nix.settings.keep-outputs = true;
# Garbage collect up to 30 GiB when only 6 GiB storage left
nix.extraOptions = ''
min-free = ${toString (5 * 1024 * 1024 * 1024)}
min-free = ${toString (6 * 1024 * 1024 * 1024)}
max-free = ${toString (30 * 1024 * 1024 * 1024)}
min-free-check-interval = 60
'';
environment.systemPackages = with pkgs; [
@ -139,21 +141,21 @@
port = 3000;
notificationSender = "hydra@julian-mutter.de"; # e-mail of hydra service
# a standalone hydra will require you to unset the buildMachinesFiles list to avoid using a nonexistant /etc/nix/machines
buildMachinesFiles = [ ];
# buildMachinesFiles = [ ];
# you will probably also want, otherwise *everything* will be built from scratch
useSubstitutes = true;
minimumDiskFree = 5; # in GB
minimumDiskFreeEvaluator = 2;
minimumDiskFreeEvaluator = 4; # in GB
};
# add builder itself as build machine so system emulation is properly supported
nix.distributedBuilds = true;
# nix.distributedBuilds = true;
nix.buildMachines = [
{
hostName = "localhost";
protocol = null;
# sshUser = "nix";
systems = [
"x86_64-linux"
"aarch64-linux"