summaryrefslogtreecommitdiffstats
path: root/makefu/2configs/backup/server.nix
blob: f157e715f82ef010f2920a4391a1d4dae77a50e7 (plain)
1
2
3
4
5
6
7
8
9
10
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}";
  }) ;
}