Skip to content

Instantly share code, notes, and snippets.

@ciiqr
Created October 17, 2022 02:19
Show Gist options
  • Save ciiqr/bb00a3f34075a71e29b990a1bc88ce34 to your computer and use it in GitHub Desktop.
Save ciiqr/bb00a3f34075a71e29b990a1bc88ce34 to your computer and use it in GitHub Desktop.
nix install on m1 fails inexplicably
  • was failing on sudo chmod -R ugo-w "/nix/store/" (running this command manually it had an exit code of 1 but showed no errors...)
  • I manually edited the multi user install script to ignore failures from this line, and then of course had to fix a bunch of stuff from the first install attempt:
  • roughly following the steps I found here: https://iohk.zendesk.com/hc/en-us/articles/4415830650265-Uninstall-nix-on-MacOS
  • and then doing:
sudo rm /etc/*.backup-before-nix
sudo dscl . -rm /Groups/nixbld
for x in $(dscl . -list /Users|grep nix); do
    sudo dscl . -rm /Users/$x
done
# ~/nix-temp/unpack being path I unpacked the installer to to be able to edit the multi user install script
~/nix-temp/unpack/nix-2.11.1-aarch64-darwin/install
  • which seems to have worked fine

futher notes

  • running one of the commands above (unsure which exactly, but presumably one of the dscl commands) caused macos to prompt me to allow Terminal to administer this machine (which of course I allowed). I do wonder why I never got this prompt running nix install though... (surely when it was creating these users and such I should have seen a similar prompt?)
  • testing afterwards, the chmod still doesn't work, so this dscl isn't related (just slightly suspicious)
@ciiqr
Copy link
Author

ciiqr commented Oct 17, 2022

FIGURED IT OUT! Turns out they had coreutils installed (which overrides chmod). idk why gnu chmod exits 1 without any errors... but hey, DON'T USE COREUTILS ON MACOS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment