mirror of
https://github.com/nix-community/home-manager.git
synced 2026-10-02 19:49:18 +00:00
Add programs.borgmatic.backups.<name>.settings for native borgmatic YAML and generate each backup file from it. The location, storage, retention, and consistency options and the section extraConfig options become deprecated aliases into settings. Warnings name the affected backup. Legacy configurations without overlapping keys produce the same YAML, and Home Manager symlink exclusions still append to exclude_from. Drop the assertions that rejected backups setting both or neither of sourceDirectories and patterns, so native source patterns and database-only backups work.
22 lines
631 B
Nix
22 lines
631 B
Nix
{ lib }:
|
|
{
|
|
file,
|
|
entries,
|
|
backup ? "main",
|
|
}:
|
|
map (
|
|
entry:
|
|
let
|
|
to = entry.to or "settings";
|
|
files = lib.concatMapStringsSep " and " (path: "`${toString path}'") (
|
|
entry.files or (lib.replicate (entry.definitions or 1) file)
|
|
);
|
|
suffix =
|
|
if entry.changed or false then
|
|
"has been changed to `${to}' that has a different type. Please read `${to}' documentation and update your configuration accordingly."
|
|
else
|
|
"has been renamed to `${to}'.";
|
|
in
|
|
"Borgmatic backup `programs.borgmatic.backups.${backup}`: The option `${entry.from}' defined in ${files} ${suffix}"
|
|
) entries
|