ma backup/server: init backup server repo option
This commit is contained in:
parent
e377be755f
commit
ca37236a53
@ -1,11 +1,19 @@
|
||||
{lib, ... }:
|
||||
{lib,config, ... }:
|
||||
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}";
|
||||
}) ;
|
||||
options = {
|
||||
makefu.backup.server.repo = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "/var/lib/borgbackup";
|
||||
};
|
||||
};
|
||||
config = {
|
||||
services.borgbackup.repos = lib.genAttrs hosts (host: {
|
||||
authorizedKeys = [ (builtins.readFile (./ssh + "/${host}.pub") ) ];
|
||||
path = "${config.makefu.backup.server.repo}/${host}";
|
||||
user = "borg-${host}";
|
||||
}) ;
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user