File tree Expand file tree Collapse file tree 5 files changed +15
-6
lines changed Expand file tree Collapse file tree 5 files changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -834,8 +834,13 @@ install_from_extracted_nix() {
834
834
(
835
835
cd " $EXTRACTED_NIX_PATH "
836
836
837
- _sudo " to copy the basic Nix files to the new store at $NIX_ROOT /store" \
838
- cp -RPp ./store/* " $NIX_ROOT /store/"
837
+ if is_os_darwin; then
838
+ _sudo " to copy the basic Nix files to the new store at $NIX_ROOT /store" \
839
+ cp -RPp ./store/* " $NIX_ROOT /store/"
840
+ else
841
+ _sudo " to copy the basic Nix files to the new store at $NIX_ROOT /store" \
842
+ cp -RP --preserve=ownership,timestamps ./store/* " $NIX_ROOT /store/"
843
+ fi
839
844
840
845
_sudo " to make the new store non-writable at $NIX_ROOT /store" \
841
846
chmod -R ugo-w " $NIX_ROOT /store/"
Original file line number Diff line number Diff line change @@ -167,7 +167,11 @@ for i in $(cd "$self/store" >/dev/null && echo ./*); do
167
167
rm -rf " $i_tmp "
168
168
fi
169
169
if ! [ -e " $dest /store/$i " ]; then
170
- cp -RPp " $self /store/$i " " $i_tmp "
170
+ if [ " $( uname -s) " = " Darwin" ]; then
171
+ cp -RPp " $self /store/$i " " $i_tmp "
172
+ else
173
+ cp -RP --preserve=ownership,timestamps " $self /store/$i " " $i_tmp "
174
+ fi
171
175
chmod -R a-w " $i_tmp "
172
176
chmod +w " $i_tmp "
173
177
mv " $i_tmp " " $dest /store/$i "
Original file line number Diff line number Diff line change 81
81
mkdir -p $out/archive
82
82
83
83
dir=NixOS-nixpkgs-${ nixpkgs . shortRev }
84
- cp -prd ${ nixpkgs } $dir
84
+ cp -rd --preserve=ownership,timestamps ${ nixpkgs } $dir
85
85
# Set the correct timestamp in the tarball.
86
86
find $dir -print0 | xargs -0 touch -h -t ${ builtins . substring 0 12 nixpkgs . lastModifiedDate } .${
87
87
builtins . substring 12 2 nixpkgs . lastModifiedDate
Original file line number Diff line number Diff line change 48
48
49
49
nixpkgs-repo = pkgs . runCommand "nixpkgs-flake" { } ''
50
50
dir=NixOS-nixpkgs-${ nixpkgs . shortRev }
51
- cp -prd ${ nixpkgs } $dir
51
+ cp -rd --preserve=ownership,timestamps ${ nixpkgs } $dir
52
52
53
53
# Set the correct timestamp in the tarball.
54
54
find $dir -print0 | xargs -0 touch -h -t ${ builtins . substring 0 12 nixpkgs . lastModifiedDate } .${
Original file line number Diff line number Diff line change 13
13
14
14
set -x
15
15
dir=nixpkgs-${ nixpkgs . shortRev }
16
- cp -prd ${ nixpkgs } $dir
16
+ cp -rd --preserve=ownership,timestamps ${ nixpkgs } $dir
17
17
# Set the correct timestamp in the tarball.
18
18
find $dir -print0 | xargs -0 touch -h -t ${ builtins . substring 0 12 nixpkgs . lastModifiedDate } .${
19
19
builtins . substring 12 2 nixpkgs . lastModifiedDate
You can’t perform that action at this time.
0 commit comments