From 10322f9e9761a3178936eee3aa9c35fb46be9ab2 Mon Sep 17 00:00:00 2001 From: Mel Date: Thu, 14 Nov 2024 20:13:15 +0100 Subject: Automatically reclaim storage space Signed-off-by: Mel --- modules/common.nix | 5 ++++- modules/nix.nix | 11 +++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/modules/common.nix b/modules/common.nix index 7d7f1cc..e7e101b 100644 --- a/modules/common.nix +++ b/modules/common.nix @@ -35,7 +35,10 @@ services.envfs.enable = true; virtualisation = { - docker.enable = true; + docker = { + enable = true; + autoPrune.enable = true; + }; oci-containers.backend = "docker"; }; diff --git a/modules/nix.nix b/modules/nix.nix index d98f64d..cde962a 100644 --- a/modules/nix.nix +++ b/modules/nix.nix @@ -2,6 +2,17 @@ { nix = { + optimise = { + automatic = true; + dates = [ "06:00" ]; + }; + + gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 14d"; + }; + # add compat scripts to the environment, # to allow nixos-option to find the configuration nixPath = [ -- cgit 1.4.1