diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2021-08-30 12:46:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-30 12:46:54 +0200 |
commit | 5f8b521d78ee7d3cb5babbc4e73c710fcd969afa (patch) | |
tree | a9a8b11ca979744e46da40f07bea275067311d76 /scripts | |
parent | 0693bdff3f016a7ce46ab13e72974c30d3aad7eb (diff) | |
parent | 079bde2aef6521b55f3e17e4601e878039611ead (diff) |
Merge pull request #5172 from matthewbauer/enableOwnership
Set enableOwnership in macOS install
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/create-darwin-volume.sh | 4 | ||||
-rw-r--r-- | scripts/install-darwin-multi-user.sh | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/scripts/create-darwin-volume.sh b/scripts/create-darwin-volume.sh index 8aff03199..1a17b3439 100755 --- a/scripts/create-darwin-volume.sh +++ b/scripts/create-darwin-volume.sh @@ -759,6 +759,10 @@ setup_volume() { await_volume + if [ "$(/usr/sbin/diskutil info -plist "$NIX_ROOT" | xmllint --xpath "(/plist/dict/key[text()='GlobalPermissionsEnabled'])/following-sibling::*[1]" -)" = "<false/>" ]; then + sudo /usr/sbin/diskutil enableOwnership "$NIX_ROOT" + fi + # TODO: below is a vague kludge for now; I just don't know # what if any safe action there is to take here. Also, the # reminder isn't very helpful. diff --git a/scripts/install-darwin-multi-user.sh b/scripts/install-darwin-multi-user.sh index f8d6c5e8f..a5166de64 100644 --- a/scripts/install-darwin-multi-user.sh +++ b/scripts/install-darwin-multi-user.sh @@ -206,4 +206,8 @@ poly_prepare_to_install() { EOF setup_darwin_volume fi + + if [ "$(diskutil info -plist /nix | xmllint --xpath "(/plist/dict/key[text()='GlobalPermissionsEnabled'])/following-sibling::*[1]" -)" = "<false/>" ]; then + failure "This script needs a /nix volume with global permissions! This may require running sudo diskutil enableOwnership /nix." + fi } |