name: update flake

on:
  schedule:
    - cron: "0 0 * * *" # daily
  workflow_dispatch:

jobs:
  update:
    runs-on: ubuntu-latest
    permissions:
      contents: write
    steps:
      - uses: actions/checkout@v6
      - uses: DeterminateSystems/nix-installer-action@main
      - run: nix flake update
      - uses: stefanzweifel/git-auto-commit-action@v7
        with:
          commit_message: "chore(flake): update flake.lock"
