aboutsummaryrefslogtreecommitdiffstats
path: root/pkgs
diff options
context:
space:
mode:
authorMilan Pässler <me@pbb.lc>2020-02-03 16:37:55 +0100
committerMilan Pässler <me@pbb.lc>2020-02-03 16:37:55 +0100
commit56d4dc28b325503c8b0261e2c12bdbaecc6903b9 (patch)
tree377f25c1c987d40f85e466e3f20be40aaaf2aa42 /pkgs
parentf1b7112ac3cbe090e96f2c82c525b6db69b82034 (diff)
support for include filters
- Added a new option for `file` sources, which allows to specify a list of `include` and `exclude` filters - Added a new option for `file` sources, which allows to disable the `--delete-excluded` behaviour.
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/populate/default.nix7
1 files changed, 5 insertions, 2 deletions
diff --git a/pkgs/populate/default.nix b/pkgs/populate/default.nix
index acabc02..eefc632 100644
--- a/pkgs/populate/default.nix
+++ b/pkgs/populate/default.nix
@@ -45,7 +45,7 @@ let
'';
pop.file = target: source: let
- configAttrs = ["useChecksum" "exclude"];
+ configAttrs = ["useChecksum" "exclude" "filters" "deleteExcluded"];
config = filterAttrs (name: _: elem name configAttrs) source;
in
rsync' target config (quote source.path);
@@ -161,9 +161,12 @@ let
${concatMapStringsSep " "
(pattern: /* sh */ "--exclude ${quote pattern}")
(config.exclude or [])} \
+ ${concatMapStringsSep " "
+ (filter: /* sh */ "--${filter.type} ${quote filter.pattern}")
+ (config.filters or [])} \
-e ${quote (ssh' target)} \
-vFrlptD \
- --delete-excluded \
+ ${optionalString (config.deleteExcluded or true) /* sh */ "--delete-excluded"} \
"$source_path" \
${quote (
optionalString (!isLocalTarget target) (