Skip to content

Add a Nix flake for reproducible builds and dev shells#1769

Draft
maziyarpanahi wants to merge 1 commit into
masterfrom
feature/om-196-nix-flake-support
Draft

Add a Nix flake for reproducible builds and dev shells#1769
maziyarpanahi wants to merge 1 commit into
masterfrom
feature/om-196-nix-flake-support

Conversation

@maziyarpanahi

Copy link
Copy Markdown
Owner

Pull Request

Description

Adds a pinned Nix flake that builds the OpenMed Python package and provides a reproducible Python 3.12 development shell with the repository's development and test dependencies. A Linux CI workflow now builds the flake outputs and runs the full suite inside the shell.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Code refactoring
  • Performance improvement
  • Test addition/improvement

Changes Made

  • Add flake.nix and a committed flake.lock pinned to nixpkgs 26.05.
  • Package OpenMed through buildPythonPackage with Hatchling and expose a development shell for all supported Linux and macOS architectures.
  • Add a Linux flake validation workflow and document nix develop, nix build, checks, and intentional lock updates.

Testing

  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have tested this change with different models/inputs

Validated with:

  • nix flake check --print-build-logs
  • nix build --no-link --print-build-logs
  • nix flake show --all-systems
  • nix develop --command python -m pytest tests/ -q (5,180 passed, 61 skipped)
  • .venv/bin/python -m pytest tests/ -q (5,186 passed, 55 skipped)
  • actionlint .github/workflows/nix.yml
  • .venv/bin/python scripts/release/check_github_actions_refs.py
  • uv run --extra docs mkdocs build --strict
  • .venv/bin/pre-commit run --files .github/workflows/nix.yml docs/development.md flake.lock flake.nix mkdocs.yml

Documentation

  • I have updated the documentation accordingly
  • I have added docstrings to new functions/classes
  • I have updated the CHANGELOG.md

Code Quality

  • I ran make format, make lint, and make format-check
  • For Swift/OpenMedKit changes, I ran make format-swift and make lint-swift
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings

Dependencies

  • I have not added any new dependencies
  • OR I have added new dependencies and they are justified because: the flake pins nixpkgs as the reproducible Nix package source and CI installs Nix through a versioned action; Python runtime dependencies are unchanged.

Checklist

  • I have read the contributing guidelines
  • My commits have clear, descriptive messages
  • I have squashed/organized my commits appropriately

Related Issues

Closes #1464

Screenshots/Examples

Not applicable; this change adds build, shell, CI, and documentation surfaces.

@maziyarpanahi maziyarpanahi added roadmap-v2 OpenMed V2 roadmap backlog feature New capability P3 Strategic labels Jul 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New capability P3 Strategic roadmap-v2 OpenMed V2 roadmap backlog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a Nix flake for reproducible builds and dev shells

1 participant