vno1-oh2: pass ssh key to borg

compress-drv-tests
Motiejus Jakštys 2023-07-26 14:39:34 +03:00
parent e1b1715a48
commit ab11ee31f2
2 changed files with 4 additions and 0 deletions

View File

@ -43,6 +43,7 @@
zfsborg = {
enable = true;
passwordPath = config.age.secrets.borgbackup-password.path;
sshKeyPath = "/etc/ssh/ssh_host_ed25519_key";
mountpoints = {
"/home" = {
repo = "zh2769@zh2769.rsync.net:${config.networking.hostName}.${config.networking.domain}-home-motiejus-annex2";

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;