summaryrefslogtreecommitdiffstats
path: root/makefu/4lib
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2016-04-07 19:54:23 +0200
committermakefu <github@syntax-fehler.de>2016-04-07 19:54:23 +0200
commit66b7a76a26a40bd4ecca8c83aafe5f2e5fefa461 (patch)
treeacd6f480f66567cec5074f65f3cda000236ec4f5 /makefu/4lib
parent43ea1e5ab36b081c6b4776f2729d100c9f13afcd (diff)
parentcaf6ce12912dd3484081df5640b23342c48ff8ab (diff)
Merge branch 'master' of gum.krebsco.de:stockholm
Diffstat (limited to 'makefu/4lib')
-rw-r--r--makefu/4lib/default.nix30
1 files changed, 30 insertions, 0 deletions
diff --git a/makefu/4lib/default.nix b/makefu/4lib/default.nix
new file mode 100644
index 000000000..5e9ab2087
--- /dev/null
+++ b/makefu/4lib/default.nix
@@ -0,0 +1,30 @@
+{ config, lib, ... }:
+
+with lib;
+let
+ addDefaultTime = bku-entry: recursiveUpdate {
+ snapshots = {
+ daily = { format = "%Y-%m-%d"; retain = 7; };
+ weekly = { format = "%YW%W"; retain = 4; };
+ monthly = { format = "%Y-%m"; retain = 12; };
+ yearly = { format = "%Y"; };
+ };
+ startAt = "5:23";
+ } bku-entry;
+
+ backup-host = config.krebs.hosts.omo;
+ backup-path = "/media/backup";
+in {
+ bku = {
+ inherit addDefaultTime;
+ simplePath = addDefaultTime (path: {
+ method = "pull";
+ src = { host = config.krebs.build.host; inherit path; };
+ dst = {
+ host = backup-host;
+ path = backup-path ++ config.krebs.build.host.name
+ ++ builtins.replaceStrings ["/"] ["-"] path;
+ };
+ });
+ };
+}