I would like to copy some files out of a nix store into Google Drive. The hitch is that the nix store sets the modification time of every file inside of it to
1970-01-01 00:00:00Z , so that the modification time cannot be used to break reproducible builds. However, I would prefer to have the upload time correctly reflected in Google Drive.
- I could copy the file out of the nix store into another file in the local filesystem, but I would strongly prefer to avoid this step, as it's unnecessary and the files can be quite large.
- I could pass an option to
rcloneto not preserve modification time, not unlike
cpdoesn't preserve timestamps by default) However, I'm not seeing any documentation that this option exists, if it exists at all.
- I tried creating a symlink to the file inside the nix store, hoping that rclone would pick up the modification time of the symlink, but this fails. For example, if I try this to copy the rclone executable to google drive:
$ ls -lh /nix/store/kvrpcbi3ph4m9a8jjp7bd445w690wdqs-rclone-1.48.0/bin total 17M -r-xr-xr-x 1 root root 34M Dec 31 1969 rclone $ ln -s /nix/store/kvrpcbi3ph4m9a8jjp7bd445w690wdqs-rclone-1.48.0/bin/rclone rclone-symlink $ rclone copy --copy-links rclone-symlink remote:
However, this symlink trick doesn't work, as
rclone is still uploading the file with the timestamp
1970-01-01 00:00Z. (Although, as it turns out,
cp --preserve=timestamps exhibits the same behavior)