name: Lint Workflow

on:
  push:
    branches:
      - main
  pull_request:

jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Install Nix
        uses: cachix/install-nix-action@v31
        with:
          nix_path: nixpkgs=channel:nixos-unstable

      - name: Use Cachix
        uses: cachix/cachix-action@v16
        with:
          name: trevstack
          authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'

      - name: Run checks
        run: nix flake check