File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -60,6 +60,7 @@ trap 'rm -rf "$sshKeyDir"' EXIT
60
60
mkdir -p " $sshKeyDir "
61
61
62
62
declare -A diskEncryptionKeys=()
63
+ declare -A extraFilesOwnership=()
63
64
declare -a nixCopyOptions=()
64
65
declare -a sshArgs=()
65
66
@@ -256,6 +257,11 @@ parseArgs() {
256
257
extraFiles=$2
257
258
shift
258
259
;;
260
+ --chown)
261
+ extraFilesOwnership[" $2 " ]=" $3 "
262
+ shift
263
+ shift
264
+ ;;
259
265
--disk-encryption-keys)
260
266
diskEncryptionKeys[" $2 " ]=" $3 "
261
267
shift
@@ -667,9 +673,15 @@ nixosInstall() {
667
673
if [[ -n ${extraFiles} ]]; then
668
674
step Copying extra files
669
675
tar -C " $extraFiles " -cpf- . | runSsh " tar -C /mnt -xf- --no-same-owner"
676
+
670
677
runSsh " chmod 755 /mnt" # tar also changes permissions of /mnt
671
678
fi
672
679
680
+ if [[ ${# extraFilesOwnership[@]} -gt 0 ]]; then
681
+ # shellcheck disable=SC2016
682
+ printf " %s\n" " ${! extraFilesOwnership[@]} " " ${extraFilesOwnership[@]} " | pr -2t | runSsh ' while read file ownership; do chown -R "$ownership" "/mnt/$file"; done'
683
+ fi
684
+
673
685
step Installing NixOS
674
686
runSsh sh << SSH
675
687
set -eu ${enableDebug}
You can’t perform that action at this time.
0 commit comments