name: ci-flake-update-lock

on:
  schedule:
    - cron: '0 0 * * 0'
  workflow_dispatch: # allow manual trigger

jobs:
  update-flake-lock:
    runs-on: ubuntu-latest
    permissions:
      contents: write
      id-token: write
      issues: write
      pull-requests: write

    steps:
      - name: Checkout repository
        uses: actions/checkout@v7

      - name: Set up Nix
        uses: cachix/install-nix-action@v31

      - name: Update flake.lock
        uses: DeterminateSystems/update-flake-lock@v28
        with:
          commit-msg: "ci(nix): update flake.lock"
          pr-title: "ci(nix): update flake.lock"
