From e3f83ad608007f2cb532a1bf16111c482b890e84 Mon Sep 17 00:00:00 2001 From: Luke Granger-Brown Date: Sun, 18 Oct 2020 01:17:35 +0000 Subject: [PATCH] ops/nixos: run nix-collect-garbage daily, except on clients --- ops/nixos/lib/client.nix | 2 ++ ops/nixos/lib/common.nix | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/ops/nixos/lib/client.nix b/ops/nixos/lib/client.nix index 4e44db8d8d..c917f25e25 100644 --- a/ops/nixos/lib/client.nix +++ b/ops/nixos/lib/client.nix @@ -7,6 +7,8 @@ let inherit (lib) mkBefore; in { + nix.gc.automatic = false; + users.users.lukegb.packages = mkBefore (with pkgs; [ depot.nix.pkgs.copybara direnv diff --git a/ops/nixos/lib/common.nix b/ops/nixos/lib/common.nix index ae02d99e67..f3520bd91d 100644 --- a/ops/nixos/lib/common.nix +++ b/ops/nixos/lib/common.nix @@ -82,4 +82,10 @@ in system.activationScripts.lukegb-hgrc = lib.stringAfter [ "users" "groups" ] '' ln -sfn ${./hgrc} /home/lukegb/.hgrc ''; + + # Clean up daily. + nix.gc = { + automatic = true; + dates = "*-*-* 05:00:00"; + }; }