Personal Nix flake
nixos
home-manager
nix
1name: Update
2
3on:
4 workflow_dispatch:
5 schedule:
6 - cron: "0 7 * * SAT"
7
8concurrency:
9 group: ${{ github.workflow }}-${{ github.ref_name }}
10 cancel-in-progress: true
11
12permissions:
13 contents: write
14 pull-requests: write
15
16jobs:
17 update:
18 name: Update flake inputs
19 runs-on: ubuntu-24.04
20 steps:
21 - name: Checkout repository
22 uses: actions/checkout@v4
23 with:
24 ref: develop
25 - uses: ./.github/actions/nix-setup
26 with:
27 cachixAuthToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
28 - name: Update flake inputs
29 id: update
30 run: |
31 set -o pipefail
32 nix flake update --quiet 2>&1 \
33 | tee -a "$GITHUB_STEP_SUMMARY" ./update.out
34 - name: Run flake checks
35 id: check
36 run: |
37 set -o pipefail
38 nix flake check --quiet --all-systems --keep-going 2>&1 \
39 | grep --invert-match 'unknown experimental feature' \
40 | tee -a "$GITHUB_STEP_SUMMARY" ./check.out
41 - name: Build PR body
42 id: vars
43 run: |
44 {
45 echo 'PR_BODY<<EOF'
46 cat <<GHO
47 ### Update output
48 \`\`\`sh
49 $(cat update.out)
50 \`\`\`
51
52 ### Check output
53 \`\`\`sh
54 $(cat check.out)
55 \`\`\`
56 GHO
57 echo EOF
58 } >> "$GITHUB_OUTPUT"
59 rm ./update.out
60 rm ./check.out
61 - name: Create PR
62 uses: peter-evans/create-pull-request@v8
63 with:
64 branch: update-flake-inputs
65 add-paths: |
66 ./flake.lock
67 commit-message: 'chore: Update flake inputs'
68 title: 'chore: Update flake inputs'
69 body: ${{ steps.vars.outputs.PR_BODY }}
70 delete-branch: true