diff --git a/.gitea/workflows/flake-update.yml b/.gitea/workflows/flake-update.yml new file mode 100644 index 0000000..ff0f768 --- /dev/null +++ b/.gitea/workflows/flake-update.yml @@ -0,0 +1,47 @@ +name: Update nix flake inputs + +on: + schedule: + # Every Sunday at 03:00 UTC + - cron: "0 3 * * 0" + + workflow_dispatch: {} + +jobs: + flake-update: + runs-on: ubuntu-latest + + permissions: + contents: write + + steps: + - name: Git Config + run: | + git config --global user.name "gitea-actions" + git config --global user.email "actions@${GITEA_SERVER_HOST:-gitea.local}" + + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Install Nix + uses: DeterminateSystems/nix-installer-action@v12 + with: + nix_path: nixpkgs=channel:nixos-unstable + extra_conf: | + experimental-features = nix-command flakes + + - name: Update flake.lock + run: nix flake update + + - name: Commit flake.lock + run: | + if git diff --quiet flake.lock; then + echo "No changes to flake.lock" + exit 0 + fi + + git add flake.lock + git commit -m "Update flake inputs" + git push