vno1-oh2: pass ssh key to borg
This commit is contained in:
parent
e1b1715a48
commit
ab11ee31f2
@ -43,6 +43,7 @@
|
|||||||
zfsborg = {
|
zfsborg = {
|
||||||
enable = true;
|
enable = true;
|
||||||
passwordPath = config.age.secrets.borgbackup-password.path;
|
passwordPath = config.age.secrets.borgbackup-password.path;
|
||||||
|
sshKeyPath = "/etc/ssh/ssh_host_ed25519_key";
|
||||||
mountpoints = {
|
mountpoints = {
|
||||||
"/home" = {
|
"/home" = {
|
||||||
repo = "zh2769@zh2769.rsync.net:${config.networking.hostName}.${config.networking.domain}-home-motiejus-annex2";
|
repo = "zh2769@zh2769.rsync.net:${config.networking.hostName}.${config.networking.domain}-home-motiejus-annex2";
|
||||||
|
@ -19,6 +19,7 @@ in {
|
|||||||
enable = lib.mkEnableOption "backup zfs snapshots with borg";
|
enable = lib.mkEnableOption "backup zfs snapshots with borg";
|
||||||
|
|
||||||
passwordPath = lib.mkOption {type = str;};
|
passwordPath = lib.mkOption {type = str;};
|
||||||
|
sshKeyPath = lib.mkOption {type = nullOr path; default = null;};
|
||||||
|
|
||||||
mountpoints = lib.mkOption {
|
mountpoints = lib.mkOption {
|
||||||
default = {};
|
default = {};
|
||||||
@ -86,6 +87,8 @@ in {
|
|||||||
}
|
}
|
||||||
// lib.optionalAttrs (attrs ? patterns) {
|
// lib.optionalAttrs (attrs ? patterns) {
|
||||||
patterns = 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;
|
config.mj.base.zfsborg.mountpoints;
|
||||||
|
Loading…
Reference in New Issue
Block a user