Open jezcope opened 1 year ago
Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively.
You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! :wave:
Welcome to the Jupyter community! :tada:
Proposed change
"Flakes" is an upcoming feature of the nix package manager that allows you to declaratively specify the dependencies for a nix environment as "inputs" and automatically handle pinning inputs with a
flake.lock
file in the repository, as well as declaratively specifying the configuration of packages as in traditional nix. The environment and its dependencies are defined inflake.nix
using a documented schema. Flake inputs can be updated all at once usingnix flake update
or individually usingnix flake lock --update-input <input-name>
.I would like repo2docker to detect the presence of a
flake.nix
andflake.lock
, and automatically build a container using the locked dependencies specified. This will make it easier to manage dependencies in a nix-based binder (currently it's necessary to manually pin dependencies to a specific git commit hash per this example).Alternative options
It's already possible to use a
flake.nix
with repo2docker by using the flake-compat library in yourdefault.nix
: see https://codeberg.org/jezcope/binder-nix-flakes. However, this:default.nix
andflake.nix
for full reproducibility; andflake-compat
A dedicated buildpack would allow any nix flake with a
devShell
output to be immediately used as a binder.Who would use this feature?
MyBinder/JupyterHub users who also use nix for reproducibility (there was interest on the Nix Data Science matrix room when I mentioned it). Flakes is described as "experimental" but has been in that state for several years in a stable condition and is increasingly used in production.
How much effort will adding it take?
Not sure about this part! Should be a case of adapting the existing
NixBuildPack
to install a flakes-compatible version of nix and enable the flakes feature.Who can do this work?
Python developer familiar with repo2docker internals and nix flakes. I am currently working on adding this feature, to gain a bit more familiarity with the codebase (and because I want it!).