name: Update Flake Lockfile

on:
  schedule:
    # run weekly on sunday
    - cron: "0 0 * * 0"
  workflow_dispatch:

permissions:
  contents: write
  pull-requests: write

jobs:
  update-flake:
    if: github.repository == 'PrismLauncher/PrismLauncher'
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v4
      - uses: cachix/install-nix-action@8887e596b4ee1134dae06b98d573bd674693f47c # v26

      - uses: DeterminateSystems/update-flake-lock@v21
        with:
          commit-msg: "chore(nix): update lockfile"
          pr-title: "chore(nix): update lockfile"
          pr-labels: |
            Linux
            packaging
            simple change
            changelog:omit
