Holochain Forum

How to setup RSM's nix files within a project

Hey all, it is already possible to have default.nix and config.nix files in your projects to lock the holochain version.

  1. Copy the config.nix and default.nix from this example into your project.
  2. Rename them to usual config.nix and default.nix.
  3. Change the "ref" field in config.nix to “love”.
  4. Edit the "hash" by changing any letter of it to bypass cache, and try to do nix-shell in the same folder in which you have created the files.
  5. Executing nix-shell will give an error, so get the hash that was wanted and paste that in the "hash" field in the config.nix file.
  6. Execute nix-shell again, and you should have RSM installed. Try running holochain --version

Voila! Commit, push, and you have environment setup for anyone working with this repository.

Notice that this will be pointing to the love branch of the holonix repository, so whenever a new change is made there, any new clean download of nix-shell will download a new holochain version.

To find out which holochain commit this refers to, you can run this:

nix eval -f https://holochain.love pkgs.holochain.src.rev

Just found out that this can be done already and I know that helps immensely in projects.

Props to @steveeJ for the hard work.

3 Likes