Nix on MacOS Catalina

Thanks @Connoropolous for the solution. I fumbled through copying your earlier attempts before finding the working solution towards the bottom of the thread. If you are able to mark your own reply as a solution, that may help future readers…

This was still the state of the art when I tried in late December. If that is still the case, I want to point out that it’s a very broken experience for a developer new to holochain… Who may be thinking, I have the latest macOS, I don’t know what this nix thing is, but it clearly doesn’t work on Mac. Even if I go to the nix site directly, the Mac instructions don’t work at all.

I personally am deeply invested in the holichain project and ecosystem, but for someone brand new, this could easily turn them away and not come back.

To this end, if not done already, I would suggest updating the install docs to at minimum link to the solution in this thread, or directly on github. cc @freesig

Thanks everyone for the great work on Holochain, deeply appreciated.

:pray::yellow_heart::sparkles:

3 Likes

To be clear, this worked perfectly for me on Catalina:

I did not have any issues with libsodium.

2 Likes

github issue for docs https://github.com/holochain/holonix/issues/132

thanks for adding your experience Harlan… I’ve just marked your succint post about what worked as the ‘solution’ for newcomers

1 Like

Hi I’ve tried the solution here and it worked perfectly find for me as well until I restarted my mac. First, when I run nix-shell https://holochain.love, the terminal tells me this;

error: cannot connect to daemon at ‘/nix/var/nix/daemon-socket/socket’: Connection refused

So I ran the same command again with sudo and it worked and installed the latest version of holochain but now it is showing me this error message.

Does anyone have any idea how to work around this problem? Thank you!

@tats_sato i left a comment over here Nix-shell https://holochain.love is throwing an error

it looks like nix can’t find the packages it needs so it is falling back to the system bash (which i don’t think we should even try to debug) rather than using the bash from nixpkgs

have a look at my other comment for things to try to get the NIX_PATH working :slight_smile:

1 Like

Thank you!

Replied there!

As a new comer and regretting upgrading to macos catalina, I found this solution and applied it and it work!!!

I also restarted my computer as was still able to run nix-shell without any errors, or having to do the suggested re mounting patch in this solution.

So thank you for paving the way. :slight_smile:

New update…

Nix has handled support for Catalina now, in a smoother manner…

Just use
sh <(curl https://nixos.org/nix/install) --darwin-use-unencrypted-nix-store-volume

5 Likes

woo!

1 Like

@thedavidmeister @guillemcordoba @carolyn I am having trouble on Big Sur

sh <(curl -L https://nixos.org/nix/install) --darwin-use-unencrypted-nix-store-volume

error: refusing to create Nix store volume because the boot volume is
FileVault encrypted, but encryption-at-rest is not available.
Manually create a volume for the store and re-run this script.
See https://nixos.org/nix/manual/#sect-macos-installation

please help! :pray:

I just want to start writing Happs so bad… maybe I should just get Linux?
I’m a new developer and totally lost, I dont want to lose my data, would downloading a different OS screw things up? I don’t have parallels nor want to get it, so should I just go buy a PC?

ready to give up :sleepy: :cry:

don’t give up :slight_smile:

in my experience mac have a long history of breaking linux-ey things with their OS upgrades and nix does not escape

their mantra of ‘Just Works’ only extends as far as native applications and their vetted app store :confused: - after playing around with M1 for a few days i’m already seeing a lot of things crashing or bugging, even through rosetta…

anyway… to be constructive rather than just complaining

yes, if you just want to get stuck into happ development, use linux/docker until the nix scripts catch up

alternatively, you can use rust/cargo directly to install holochain and build your happs if you’re more comfortable with that approach - you can cargo install what you need from the holochain repository, it all uses stable rust for the binaries and wasm builds (not nightly)

cc: @steveeJ

1 Like

thank you! @thedavidmeister where can I find instructions to use the cargo method?

1 Like

install cargo - https://doc.rust-lang.org/cargo/getting-started/installation.html

building holochain and hc with cargo - https://github.com/holochain/holochain#building-with-cargo-if-you-already-have-rust-installed

~ % cargo install --path crates/holochain

error: /Users/ownername/crates/holochain is not a directory. --path must point to a directory containing a Cargo.toml file.

Nix will not install bc of something about read-only (MacOS Big Sur) – but youre saying I dont need Nix right? –

it says in this doc that Mac is not supported… perhaps this is the problem?
my friend got Elemental working on Catalina tho so im so confused :man_facepalming:

@thedavidmeister thank you so much for the help!! :pray: :pray: :pray:

I did alot of code work for engineering classes in University…

also written a bunch of smart contracts. I’m an algo, cryptography, game theory, probability/statistics, data analytics, type of guy. know very little about standard developer stuff :upside_down_face: :blush:

I’ve taken the devcamps, had got redux working fine but now I’m stuck with RSM changes and my OS update

the problem is that you’re not running the command from inside the holochain repo

you need to clone it locally first

holochain % cargo install --path crates/holochain

Installing holochain v0.0.100 (/Users/Zeek/holochain/crates/holochain)

error: failed to compile holochain v0.0.100 (/Users/Zeek/holochain/crates/holochain), intermediate artifacts can be found at /Users/Zeek/holochain/target

Caused by:

failed to parse lock file at: /Users/Zeek/holochain/Cargo.lock

Caused by:

invalid serialized PackageId for key package.dependencies

@thedavidmeister sorry im such noob

very weird, just delete the lock file and try again

that did more, but still:

error : linking with cc failed: exit code: 1

error: Could not compile syn.

warning: build failed, waiting for other jobs to finish…

error : linking with cc failed: exit code: 1

error: failed to compile holochain v0.0.100 (/Users/Zeek/holochain/crates/holochain), intermediate artifacts can be found at /Users/Zeek/holochain/target

Caused by:

Could not compile proc-macro2.

To learn more, run the command again with --verbose.