# GitHub Action

The [Nixomatic GitHub Action](https://github.com/marketplace/actions/nixomatic-action) provides reproducible CI/CD environments powered by Nix. It helps you:

- Automatically install Nix in your GitHub runners (if needed)
- Set up development environments with exactly the packages you need
- Pin specific package versions for truly reproducible builds
- Run scripts inside a fully configured Nix environment

## Quick Start

Add the following step to your `.github/workflows/your-workflow.yml`:

```yaml
- uses: curriedsoftware/nixomatic-action@main
  with:
    packages: python3 nodejs jq
    run: |
      python --version
      node --version
      jq --version
```

## Package Formats

You have flexibility in how you specify packages:

| Format | Example | Description |
|--------|---------|-------------|
| Basic | `jq` | Latest version from nixos-unstable |
| Versioned | `python3@3.13.11` | Specific version (resolved via [nxv](https://nxv.urandom.io/)) |
| Pinned | `python3:3b93cf5` | Exact nixpkgs commit for full reproducibility |

## Configuration Options

| Input | Required | Default | Description |
|-------|----------|---------|-------------|
| `packages` | Yes | - | Space-separated list of packages to install |
| `install-nix` | No | `true` | Whether to install Nix (skip if already available) |
| `run` | No | - | Script to execute in the Nix environment |

## Example

A complete workflow that tests a Python project with pinned Python and Node.js versions:

```yaml
name: CI
on: [push, pull_request]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: curriedsoftware/nixomatic-action@main
        with:
          packages: python3@3.13.11 nodejs@24.13.0 jq
          run: |
            pip install -r requirements.txt
            python -m pytest
            npm test
```

For more details, see the [Nixomatic Action on GitHub Marketplace](https://github.com/marketplace/actions/nixomatic-action).
