name: Nix Build

on:
  workflow_dispatch:
  pull_request:
    branches:
      - main
      - 0.0.x
    paths:
      - '**/*.rs'
      - '.github/workflows/nix-build.yml'
      - 'nix/**'
  push:
    branches:
      - main
      - 0.0.x
    paths:
      - '**/*.rs'
      - '.github/workflows/nix-build.yml'
      - 'nix/**'

jobs:
  lints:
    name: Build
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: DeterminateSystems/nix-installer-action@main
      - uses: DeterminateSystems/magic-nix-cache-action@main
      - uses: DeterminateSystems/flake-checker-action@main
      - name: Run `nix build`
        run: nix build
