summaryrefslogtreecommitdiffstats
path: root/pkgs/populate
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2018-11-28 08:34:19 +0100
committertv <tv@krebsco.de>2018-11-28 12:45:21 +0100
commit6f49342b2d5973478f1f5eb6f8d6307059e7bcf7 (patch)
tree1407762405a66c4f5a0d363a98d7874f769bccad /pkgs/populate
parentd92cc88a3ccfb378d045b35032ee3c0a4f5f860f (diff)
populate file: add useChecksum
Diffstat (limited to 'pkgs/populate')
-rw-r--r--pkgs/populate/default.nix11
1 files changed, 8 insertions, 3 deletions
diff --git a/pkgs/populate/default.nix b/pkgs/populate/default.nix
index d24cbec..fad6d18 100644
--- a/pkgs/populate/default.nix
+++ b/pkgs/populate/default.nix
@@ -20,7 +20,11 @@ let
fi
'';
- pop.file = target: source: rsync' target (quote source.path);
+ pop.file = target: source: let
+ configAttrs = ["useChecksum"];
+ config = filterAttrs (name: _: elem name configAttrs) source;
+ in
+ rsync' target config (quote source.path);
pop.git = target: source: shell' target /* sh */ ''
if ! test -e ${quote target.path}; then
@@ -78,7 +82,7 @@ let
${coreutils}/bin/touch -d "$pass_date" "$tmp_path"
done
- ${rsync' target /* sh */ "$tmp_dir"}
+ ${rsync' target {} /* sh */ "$tmp_dir"}
'';
pop.pipe = target: source: /* sh */ ''
@@ -100,12 +104,13 @@ let
${pop.${source.type} target' source'}
'';
- rsync' = target: sourcePath: /* sh */ ''
+ rsync' = target: config: sourcePath: /* sh */ ''
source_path=${sourcePath}
if test -d "$source_path"; then
source_path=$source_path/
fi
${rsync}/bin/rsync \
+ ${optionalString (config.useChecksum or false) /* sh */ "--checksum"} \
-e ${quote (ssh' target)} \
-vFrlptD \
--delete-excluded \