Using nix for dev ops, with holochain rsm - example

I figured out how to use holonix to template a configuration for install dna-util and holochain binaries into a nix-shell.

See these two files:
config.nix


default.nix

The trick was using use-stable-rust: true flag.

3 Likes

I was trying to use this nix configuration to also run my tests on circleci, but that wasnā€™t working. I was having compiler/linker errors, when running the cargo install ... steps.

This is my circleci file, which also references the holonix docker image as a base image

I just figured out how to overcome this compiler issueā€¦
that is to use export NIX_ENFORCE_PURITY=0
within the nix shell, before running the cargo step

1 Like

Thanks @Connoropolous! Are you running this on mac successfully btw? Asking because the holochain readme says its currently linux only, no mac, buuuuuut I should think that nix should make it platform independentā€¦

Yep, running fine on mac! not sure why they stated that actually, because they actually even have a CI run for mac on commits/PRs

For others going down this road, I documented my (minor) issues getting acorn-hc (which has these excellent nix configs baked in) up and running on a fresh (no RSM) mac here: https://github.com/h-be/acorn-hc/issues/106 .

Notably, if you hit an issue during a cargo build step which includes:

failed to authenticate when downloading repository
attempted ssh-agent authentication, but none of the usernames `git` succeeded

This is actually a known cargo issue, and the recommended fix is to add (or add to)
~/.cargo/config
the following config:

[net]
git-fetch-with-cli = true

ā€“ from https://github.com/rust-lang/cargo/issues/2078#issuecomment-434388584

Ah yes, Iā€™ve heard this issue.

It will be fixed when this PR gets merged, because it changes the git deps to https instead of ssh