diff --git a/modules/programs/borgmatic.nix b/modules/programs/borgmatic.nix index 054ee232..d6980388 100644 --- a/modules/programs/borgmatic.nix +++ b/modules/programs/borgmatic.nix @@ -20,7 +20,7 @@ let }; extraConfigOption = mkOption { - type = with types; attrsOf (oneOf [ str bool path int ]); + type = with types; attrsOf (oneOf [ str bool path int (listOf str) ]); default = { }; description = "Extra settings."; }; diff --git a/tests/modules/programs/borgmatic/basic-configuration.nix b/tests/modules/programs/borgmatic/basic-configuration.nix index 7a7b63d2..b9988d47 100644 --- a/tests/modules/programs/borgmatic/basic-configuration.nix +++ b/tests/modules/programs/borgmatic/basic-configuration.nix @@ -12,7 +12,10 @@ in { location = { sourceDirectories = [ "/my-stuff-to-backup" ]; repositories = [ "/mnt/disk1" "/mnt/disk2" ]; - extraConfig = { one_file_system = true; }; + extraConfig = { + one_file_system = true; + exclude_patterns = [ "*.swp" ]; + }; }; storage = { @@ -64,6 +67,9 @@ in { expectations[location.one_file_system]="${ boolToString backups.main.location.extraConfig.one_file_system }" + expectations[location.exclude_patterns[0]]="${ + builtins.elemAt backups.main.location.extraConfig.exclude_patterns 0 + }" expectations[storage.encryption_passcommand]="${backups.main.storage.encryptionPasscommand}" expectations[storage.checkpoint_interval]="${