From ceec1b34124b01b819b462aa2317e7f5339bc7d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Thu, 2 May 2024 17:41:13 +0300 Subject: [PATCH] rsync.net on zfsborg: less snapshots --- hosts/vno1-oh2/configuration.nix | 6 ++++++ modules/base/zfsborg/default.nix | 7 ++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/hosts/vno1-oh2/configuration.nix b/hosts/vno1-oh2/configuration.nix index f38d684..7927db0 100644 --- a/hosts/vno1-oh2/configuration.nix +++ b/hosts/vno1-oh2/configuration.nix @@ -78,6 +78,12 @@ "- gitea/data/repo-archive/" ]; backup_at = "*-*-* 01:00:00 UTC"; + prune.keep = { + within = "1d"; + daily = 1; + weekly = 0; + monthly = 0; + }; } { mountpoint = "/var/lib"; diff --git a/modules/base/zfsborg/default.nix b/modules/base/zfsborg/default.nix index 6c96e74..60b7772 100644 --- a/modules/base/zfsborg/default.nix +++ b/modules/base/zfsborg/default.nix @@ -36,6 +36,10 @@ in { type = listOf str; default = []; }; + prune = lib.mkOption { + type = anything; + default = {}; + }; backup_at = lib.mkOption {type = str;}; }; }); @@ -95,7 +99,8 @@ in { BORG_RSH = ''ssh -i "${config.mj.base.zfsborg.sshKeyPath}"''; }; } - // lib.optionalAttrs (attrs ? patterns) {inherit (attrs) patterns;}) + // lib.optionalAttrs (attrs ? patterns) {inherit (attrs) patterns;} + // lib.optionalAttrs (attrs ? prune) {inherit (attrs) prune;}) ) dirs );