diff options
Diffstat (limited to 'pkgs/populate/default.nix')
| -rw-r--r-- | pkgs/populate/default.nix | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/pkgs/populate/default.nix b/pkgs/populate/default.nix index c12507b..32909a9 100644 --- a/pkgs/populate/default.nix +++ b/pkgs/populate/default.nix @@ -204,9 +204,17 @@ let ''; pop.pipe = target: source: /* sh */ '' - ${quote source.command} | { - ${runShell target /* sh */ "cat > ${quote target.path}"} + tmp_dir=$(${coreutils}/bin/mktemp -dt populate-pipe.XXXXXXXX) + trap cleanup EXIT + cleanup() { + rm -fR "$tmp_dir" } + out=$tmp_dir/out + + ${quote source.command} > "$out" + ${coreutils}/bin/touch -t 300001010000 "$out" + + ${rsync' target rsyncDefaultConfig /* sh */ "$out"} ''; # TODO rm -fR instead of ln -f? |
