Skip to content

Commit

Permalink
borgmatic: Allow top-level extra options
Browse files Browse the repository at this point in the history
Fix #3760.
  • Loading branch information
DamienCassou committed Mar 21, 2023
1 parent e386ec6 commit 34b435a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 4 additions & 2 deletions modules/programs/borgmatic.nix
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ let

extraConfig = extraConfigOption;
};

extraConfig = extraConfigOption;
};
});

Expand All @@ -148,7 +150,7 @@ let
hmExcludeFile = pkgs.writeText "hm-symlinks.txt" hmExcludePatterns;

writeConfig = config:
generators.toYAML { } {
generators.toYAML { } ({
location = removeNullValues {
source_directories = config.location.sourceDirectories;
repositories = config.location.repositories;
Expand All @@ -168,7 +170,7 @@ let
} // config.retention.extraConfig;
consistency = removeNullValues { checks = config.consistency.checks; }
// config.consistency.extraConfig;
};
} // config.extraConfig);
in {
meta.maintainers = [ maintainers.DamienCassou ];

Expand Down
6 changes: 6 additions & 0 deletions tests/modules/programs/borgmatic/basic-configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ in {

extraConfig = { prefix = "hostname"; };
};

extraConfig = {
hooks = { before_actions = [ "echo Starting actions." ]; };
};
};
};
};
Expand Down Expand Up @@ -96,6 +100,8 @@ in {
}"
expectations[consistency.prefix]="${backups.main.consistency.extraConfig.prefix}"
expectations[hooks.before_actions[0]]="echo Starting actions."
yq=${pkgs.yq-go}/bin/yq
for filter in "''${!expectations[@]}"; do
Expand Down

0 comments on commit 34b435a

Please sign in to comment.