name: "Nix: validate flake"

on:
  workflow_dispatch:
  push:
    paths:
      - "**.nix"
      - "**.lock"
      - ".github/workflows/validate.yml"

jobs:
  check-flake:
    name: Validate x86_64-linux
    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v4
        with:
          ref: ${{ github.ref_name }}
          persist-credentials: false

      - name: Install Nix
        uses: ./.github/actions/install-lix

      - name: Validate Flake
        run: nix flake check
