Go to file
Jez Cope 97fc3f5a41 Add info on using the dev shell from the commandline 2021-06-30 14:20:27 +01:00
.gitignore Initial Commit 2018-11-06 13:53:40 -05:00
LICENSE.md Initial Commit 2018-11-06 13:53:40 -05:00
README.md Add info on using the dev shell from the commandline 2021-06-30 14:20:27 +01:00
default.nix Convert to flake.nix and shim with flake-compat 2021-06-30 13:47:20 +01:00
flake.lock Convert to flake.nix and shim with flake-compat 2021-06-30 13:47:20 +01:00
flake.nix Convert to flake.nix and shim with flake-compat 2021-06-30 13:47:20 +01:00
nix-introduction.ipynb Initial Commit 2018-11-06 13:53:40 -05:00

README.md

nix flakes BinderHub example

Binder

Why Nix?

Nix would be a great addition to reproducible data science. It is a unique package manager. Some notable features:

  • 100% reproducible environments (pin to exact commit in repository)
  • both a source and binary package repository
  • allows customized compilation and version of every package
  • can run identical environment outside of docker (all linux distros + dawin)
  • as of now 45,000+ packages
  • fully declarative environments
  • packages: python, javascript, julia, R, haskell, perl, and many other languages (some better than others).

Assuming that you have nix installed (compatible with all linux distributions and darwin (Mac OS)) you can run this repository locally (no need for binderhub). It will be identical assuming you have pinned repositories. Nix can coexist fine with other package managers.

This derivation installs python38, numpy, and scipy.

For a more detailed example see the detailed binderhub example costrouc/nix-binder-example

Why nix flakes?

"Flakes" is an upcoming feature of the nix package manager that allows you to declaratively specify the dependencies for a nix environment and automatically handle pinning those dependencies with a flake.lock file in the repository, as well as declaratively specifying the configuration of packages described above. The environment and its dependencies are defined in flake.nix.

With flakes enabled in your nix installation, you can start a shell with an identical environment with the following command, without needing to clone the repository yourself:

nix develop 'git+https://tildegit.org/petrichor/binder-nix-flakes.git?ref=main'

This example uses the flake-compat library to take advantage of the flakes feature in default.nix without needing a version of nix with flakes support. The lock file can be updated using the unstable branch of nix by running nix flake update. This means that the existing nix buildpack in repo2docker will use the flake transparently.