summaryrefslogtreecommitdiffstats
path: root/pkgs/populate
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2020-02-18 14:36:30 +0100
committerGitHub <noreply@github.com>2020-02-18 14:36:30 +0100
commited9fc6658226b1525bc008205d76276f0054c6c5 (patch)
tree1047d711c21c7cf5c0c5026f2159ad0453fc2a0b /pkgs/populate
parent8161ec736759a7f21d9d6ec6e5ff8189df9ebbe7 (diff)
parent56d4dc28b325503c8b0261e2c12bdbaecc6903b9 (diff)
Merge pull request #15 from nyantec/feature/filters
support for include filters
Diffstat (limited to 'pkgs/populate')
-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 736376e..78bf3c8 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) (