-
Notifications
You must be signed in to change notification settings - Fork 362
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for nix flakes #1300
Comments
Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗 |
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!).
The text was updated successfully, but these errors were encountered: