borgbackup: add exclude option

This commit is contained in:
Jörg Thalheim
2024-07-21 19:06:09 +02:00
parent ed5dd02879
commit 00bad3d614

View File

@@ -106,6 +106,16 @@ in
'';
};
options.clan.borgbackup.exclude = lib.mkOption {
type = lib.types.listOf lib.types.str;
example = [ "*.pyc" ];
default = [];
description = ''
Directories/Files to exclude from the backup.
Use * as a wildcard.
'';
};
imports = [
(lib.mkRemovedOptionModule [
"clan"
@@ -129,7 +139,7 @@ in
paths = lib.unique (
lib.flatten (map (state: state.folders) (lib.attrValues config.clan.core.state))
);
exclude = [ "*.pyc" ];
exclude = cfg.exclude;
repo = dest.repo;
environment.BORG_RSH = dest.rsh;
compression = "auto,zstd";