From 4590c9fe1fb09e21842151d565bade861fbeef92 Mon Sep 17 00:00:00 2001 From: Julian Mutter Date: Fri, 20 Dec 2024 14:05:11 +0100 Subject: [PATCH] builder: Improve garbage collect --- systems/x86_64-linux/builder/default.nix | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/systems/x86_64-linux/builder/default.nix b/systems/x86_64-linux/builder/default.nix index 9098701..fddec65 100644 --- a/systems/x86_64-linux/builder/default.nix +++ b/systems/x86_64-linux/builder/default.nix @@ -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"