Skip to content
This repository has been archived by the owner on Feb 3, 2023. It is now read-only.

add default nix for dist builds #1356

Merged
merged 9 commits into from
May 2, 2019
Merged

Conversation

thedavidmeister
Copy link
Contributor

@thedavidmeister thedavidmeister commented Apr 29, 2019

PR summary

Adds a default.nix file that includes only the binaries.

Facilitates pointing nix-env straight at a tarball if all you want is the binaries.

Ignores all of the dependencies!

I'm chasing up a vanity URL from @duffybelfield

The "easy install" for binaries would look like this:

# install nix tooling on mac/linux
curl https://nixos.org/nix/install | sh

# drop holochain and hc binaries into the user's path
nix-env -f https://holochain.love -iA hc holochain

How does this work?

  1. the nix installer 1-liner creates nix-shell and nix-env (and others) on mac/linux
  2. pointing nix-env at a URL will look for a tarball, unpack it and look for default.nix
  3. https://holochain.love (will) points to https://github.com/holochain/holochain-rust/archive/master.tar.gz
  4. the default.nix (added in this PR) exposes the hc and holochain binary derivations from holonix
  5. the -i flag tells nix-env to "install"
  6. the -A flag tells nix-env the names of the derivations to be installed
  7. nix-env copies the output of the hc and holochain derivations into the user's home directory (just the binaries)
  8. hc and holochain end up in ~/.nix-profile/bin

and then later... to upgrade...

# upgrade derivations
nix-env -f https://holochain.love -uA hc holochain

at least i think this works 🤔

i guess we will find out!!!

finally, to uninstall...

# uninstall binaries
nix-env -e hc holochain

to track develop rather than master we have https://holochain.love/nightly as well

testing/benchmarking notes

Example of a round trip (installing and uninstalling):

Currently https://bit.ly/2DG8SW9 points to https://github.com/holochain/holochain-rust/archive/675685ae62392805d95da0a961d8a1d5d32a80de.tar.gz

[thedavidmeister@nixos:~]$ hc -V
hc: command not found

[thedavidmeister@nixos:~]$ holochain -V
holochain: command not found

[thedavidmeister@nixos:~]$ nix-env -f https://bit.ly/2DG8SW9 -iA hc holochain
installing 'hc'
installing 'holochain'

[thedavidmeister@nixos:~]$ hc -V
hc 0.0.13-alpha1

[thedavidmeister@nixos:~]$ holochain -V
holochain 0.0.13-alpha1

[thedavidmeister@nixos:~]$ which hc
/home/thedavidmeister/.nix-profile/bin/hc

[thedavidmeister@nixos:~]$ which holochain
/home/thedavidmeister/.nix-profile/bin/holochain

[thedavidmeister@nixos:~]$ nix-env -f https://bit.ly/2DG8SW9 -e hc holochain
uninstalling 'hc'
uninstalling 'holochain'

[thedavidmeister@nixos:~]$ hc -V
hc: command not found

[thedavidmeister@nixos:~]$ holochain -V
holochain: command not found

[thedavidmeister@nixos:~]$ 

( if any manual testing or benchmarking was/should be done, add notes and/or screenshots here )

followups

( any new tickets/concerns that were discovered or created during this work but aren't in scope for review here )

changelog

Please check one of the following, relating to the CHANGELOG

  • this is a code change that effects some consumer (e.g. zome developers) of holochain core so there is an 'Unreleased' CHANGELOG item, with the format - summary of change [PR#1234](https://github.com/holochain/holochain-rust/pull/1234)
  • this is not a code change, or doesn't effect anyone outside holochain core development

@thedavidmeister thedavidmeister changed the title WIP: add default nix for dist builds add default nix for dist builds May 1, 2019
@dhtnetwork
Copy link

dhtnetwork commented May 1, 2019

Reviewed/Passed with flying colors! Green all the way.
Successful install and uninstall.

Copy link

@dhtnetwork dhtnetwork left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Followed the steps outlined:

  1. Read the instructions.
  2. Steps completed

install nix tooling on mac/linux

  • curl https://nixos.org/nix/install | sh
  • Added To ensure that the necessary environment
    variables are set, please add the line
    . /Users/signal/.nix-profile/etc/profile.d/nix.sh
  • nix-env -f https://bit.ly/2DG8SW9 -iA hc holochain
  • completed the install and uninstall process twice.

@pdaoust
Copy link
Collaborator

pdaoust commented May 1, 2019

Would be good to follow this up with updates to the Quick Start Guide, providing examples for both nix-env and nix-shell and explaining why you would want one or the other.

Copy link
Contributor

@philipbeadle philipbeadle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

love using nix

@thedavidmeister thedavidmeister merged commit 2e10e98 into develop May 2, 2019
@zippy zippy deleted the 2019-04-30-nix-default branch October 4, 2019 18:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants