Add Nix dev shell for contributors#489
Open
damien wants to merge 1 commit into
Open
Conversation
`nix develop` provides the toolchain needed to contribute: Python 3.13, Node 22, Postgres 16, make, git, the docker CLI, and the native libs Python wheels may build against. Nix supplies the toolchain only; project dependencies are still installed by `make dev` and `npm install`, so requirements*.txt and package-lock.json stay authoritative. Toolchain versions are read at eval time from the files that own them (package.json engines, tox.ini, the Makefile) rather than duplicated, so the flake can't drift from them; a source whose format changes, or a version nixpkgs lacks, fails at eval with a message naming the cause. The resolved Node is also checked against engines.node's full floor, since nixpkgs is selected by major and supplies the patch. The shell hook lives in nix/dev-shell-hook.sh (sourced, with values passed as env vars) so it stays shellcheck-clean and out of nixfmt's string reindentation. flake.lock is committed for reproducibility.
39ba5eb to
7b90b4f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hey folks!
I'm looking to do some work with ACCEESS at an internal hackathon in my organization in a few weeks time and am familiarizing myself with the codebase. I'm personally a fan of Nix and put this together for my own usage, but I figured I'd share it here on the off chance there was any interest or desire to bring it upstream.
This PR grants the ability for folks with
nixinstalled to runnix developand bootstrap a development environment within Nix that sets up all the stuff a contributor needs to operate ACCESS locally. The Nix flake (which defines the development shell) reads from project manifests to derive the correct versions of NodeJS, Python, and leverages the existing Make commands to install all other dependencies. Nix will fail loudly in the event it's unable to determine the appropriate dependency versions from the project source or if the versions specified aren't available as a Nix package.--
Disclaimer: I put this PR together with assistance from an LLM agent. It was not vibe coded and I can assert that I've done several quality passes and tested that
nix developbehaves as described and fails in predictable ways when it can't produce the requested development environment. If this project has policies or guidelines that prohibit LLM-assisted contributions, feel free to close this PR and I'll make a point to avoid LLM usage for future contributions to ACCESS.