vno1-oh2: pass ssh key to borg

This commit is contained in:
2023-07-26 14:39:34 +03:00
parent e1b1715a48
commit ab11ee31f2
2 changed files with 4 additions and 0 deletions

View File

@@ -19,6 +19,7 @@ in {
enable = lib.mkEnableOption "backup zfs snapshots with borg";
passwordPath = lib.mkOption {type = str;};
sshKeyPath = lib.mkOption {type = nullOr path; default = null;};
mountpoints = lib.mkOption {
default = {};
@@ -86,6 +87,8 @@ in {
}
// lib.optionalAttrs (attrs ? patterns) {
patterns = attrs.patterns;
} // lib.optionalAttrs (config.mj.base.zfsborg.sshKeyPath != null) {
environment.BORG_RSH = ''ssh -i "${config.mj.base.zfsborg.sshKeyPath}"'';
};
})
config.mj.base.zfsborg.mountpoints;