Skip to content

chore: add a nix flake develop environment setup#1417

Open
sunng87 wants to merge 7 commits intogeoarrow:mainfrom
sunng87:chore/flake-setup
Open

chore: add a nix flake develop environment setup#1417
sunng87 wants to merge 7 commits intogeoarrow:mainfrom
sunng87:chore/flake-setup

Conversation

@sunng87
Copy link
Copy Markdown
Contributor

@sunng87 sunng87 commented Dec 22, 2025

We have a lot of dependencies and tools required in this project, and some of them are hidden ones. this nix flake setup will help developers to setup a full environment with just one call.

I'm also happy to include an instruction about setup this in top level README.md or DEVELOP.md. But users who familiar with nix flake should know about this once they saw the flake files.

I also got an deprecation warnings with uv.tools.dev-dependencies so I update it to latest recommended form. Will check CI to see if it works.

For js module, wasm-pack and the headless test on firefox should work.

@github-actions github-actions bot added the chore label Dec 22, 2025
@kylebarron
Copy link
Copy Markdown
Member

kylebarron commented Jan 7, 2026

Thanks for the PR.

I don't know anything about nix and I'm a little wary of adding another development setup that I don't understand. What if dependencies change and the nix recipe becomes outdated? Do we have to keep versions in sync with rust versions, etc.

I don't know whether it should be the concern of this repo to ensure that users can install rustc. The JS bindings are very outdated, and rather than complicate the development environment here, I'd be more receptive to moving the JS WASM code to a new repo (maybe called geoarrow-wasm).

Then I feel like the only native dependencies that we have are GEOS and rustc? And can't GEOS build during the Rust build process?

@sunng87
Copy link
Copy Markdown
Contributor Author

sunng87 commented Jan 7, 2026

This nix flake module is totally optional: it's only for user who has nix/direnv installed and activate via direnv allow. It won't affect non-nix users.

For native dependencies, yes, we need geos development files installed. In the build.rs of geos-sys library, it also requires cmake. And environment variable CMAKE_POLICY_VERSION_MINIMUM = "3.5" is required for cmake 4.x to work in 3.5 mode.

In order to keep the nix setup validated, I can include additional github CI tasks to 1. run build commands in nix environment; 2. run scheduled tasks to update flake.lock (something like npm's package-lock.json).

For updating rustc, because we don't have a rust-toolchain file in the repo, stable rustc is used by default. Anytime a new version of rustc is released in nix repo, we can update flake.lock to include it.

Anyway, no pressure for this. I use this flake to setup my dev environment when working on geoarrow-rs, just guess it can be helpful for other nix users who is also working on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants