summaryrefslogtreecommitdiffstats
path: root/makefu/2configs/backup/server.nix
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2018-10-21 23:04:27 +0200
committermakefu <github@syntax-fehler.de>2018-10-21 23:04:27 +0200
commit489d3924307171751b174d62f64ce29a5c2550cf (patch)
tree6ece4bd4baa029dddefd8f496096f68fcee1b22f /makefu/2configs/backup/server.nix
parentcea8403dc5eb48792c9ccd4c4fc9584a84ba4238 (diff)
ma backup: init
Diffstat (limited to 'makefu/2configs/backup/server.nix')
-rw-r--r--makefu/2configs/backup/server.nix11
1 files changed, 11 insertions, 0 deletions
diff --git a/makefu/2configs/backup/server.nix b/makefu/2configs/backup/server.nix
new file mode 100644
index 000000000..f157e715f
--- /dev/null
+++ b/makefu/2configs/backup/server.nix
@@ -0,0 +1,11 @@
+{lib, ... }:
+let
+ hosts = lib.mapAttrsToList (f: _: lib.removeSuffix ".pub" f) (builtins.readDir ./ssh );
+in {
+ # TODO: for all enabled machines
+ services.borgbackup.repos = lib.genAttrs hosts (host: {
+ authorizedKeys = [ (builtins.readFile (./ssh + "/${host}.pub") ) ];
+ path = "/var/lib/borgbackup/${host}";
+ user = "borg-${host}";
+ }) ;
+}