---
inputs:
  githubAccessToken:
    required: true
  cachixAuthToken:
    required: true

runs:
  using: composite

  steps:
    - name: Install Nix
      uses: cachix/install-nix-action@v23
      with:
        extra_nix_config: |
          ## Access token to avoid triggering GitHub's rate limiting.
          access-tokens = github.com=${{ inputs.githubAccessToken }}
          ## Accept arbitrary substituters from the flake.
          accept-flake-config = true

    - name: Setup Nix caches
      uses: cachix/cachix-action@v12
      with:
        name: morsmall
        ## This auth token will give write access to the cache, meaning that
        ## everything that happens in CI will be pushed at the end of the job.
        authToken: "${{ inputs.cachixAuthToken }}"
