summaryrefslogtreecommitdiffstats
path: root/makefu/4lib/default.nix
diff options
context:
space:
mode:
authormakefu <makefu@nixos.dev>2016-05-02 16:08:30 +0200
committermakefu <makefu@nixos.dev>2016-05-02 16:08:30 +0200
commit64aa4f6912fb7425d8063e5d143f59c43fb31b8f (patch)
tree07fe7c386d32bd5e1375a7d01f623cd357a1d09d /makefu/4lib/default.nix
parent3f77b6c89f4a3a28d62e9117712481489ac56fa1 (diff)
parent6f4bc4b34c3cbac56f6a23740dca566980823990 (diff)
Merge branch 'master' of gum:stockholm
Diffstat (limited to 'makefu/4lib/default.nix')
-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;
+ };
+ });
+ };
+}