bugfix in attrset merging

This commit is contained in:
Motiejus Jakštys 2023-09-11 17:48:03 +03:00
parent d1a7aebfc9
commit 27d663e63a
1 changed files with 27 additions and 27 deletions

View File

@ -72,33 +72,33 @@ in {
"config.mj.base.unitstatus.enable must be true"; "config.mj.base.unitstatus.enable must be true";
lib.nameValuePair lib.nameValuePair
"${lib.strings.sanitizeDerivationName mountpoint}-${toString i}" "${lib.strings.sanitizeDerivationName mountpoint}-${toString i}"
{ ({
doInit = true; doInit = true;
repo = attrs.repo; repo = attrs.repo;
encryption = { encryption = {
mode = "repokey-blake2"; mode = "repokey-blake2";
passCommand = "cat ${config.mj.base.zfsborg.passwordPath}"; passCommand = "cat ${config.mj.base.zfsborg.passwordPath}";
}; };
paths = attrs.paths; paths = attrs.paths;
extraArgs = "--remote-path=borg1"; extraArgs = "--remote-path=borg1";
compression = "auto,lzma"; compression = "auto,lzma";
startAt = attrs.backup_at; startAt = attrs.backup_at;
readWritePaths = let p = mountpoint + "/.snapshot-latest"; in [p]; readWritePaths = let p = mountpoint + "/.snapshot-latest"; in [p];
preHook = mountLatest mountpoint fs.device; preHook = mountLatest mountpoint fs.device;
postHook = umountLatest mountpoint; postHook = umountLatest mountpoint;
prune.keep = { prune.keep = {
within = "1d"; within = "1d";
daily = 7; daily = 7;
weekly = 4; weekly = 4;
monthly = 3; monthly = 3;
}; };
} }
// lib.optionalAttrs (attrs ? patterns) { // lib.optionalAttrs (attrs ? patterns) {
patterns = attrs.patterns; patterns = attrs.patterns;
} }
// lib.optionalAttrs (sshKeyPath != null) { // lib.optionalAttrs (sshKeyPath != null) {
environment.BORG_RSH = ''ssh -i "${config.mj.base.zfsborg.sshKeyPath}"''; environment.BORG_RSH = ''ssh -i "${config.mj.base.zfsborg.sshKeyPath}"'';
} })
) )
dirs dirs
); );