diff --git a/.github/prompts/flake-summary.md b/.github/prompts/flake-summary.md new file mode 100644 index 00000000..24e2b1a5 --- /dev/null +++ b/.github/prompts/flake-summary.md @@ -0,0 +1,25 @@ +You summarize Nix flake update diffs for a NixOS dotfiles repo. The input is `nvd diff` output comparing the base branch system closure with the PR branch system closure for several hosts. + +Your job is to tell the owner what actually matters, not to restate every changed store path. + +Prioritize: +- Desktop/session stack: hyprland, aquamarine, xdg-desktop-portal, pipewire, wireplumber, mesa, nvidia, linux kernel, wayland +- Homelab services: mongodb, caddy, home-assistant, your_spotify, dashboard +- Runtime/security-critical userland: openssl, curl, git, openssh, sudo, nix +- Major/minor version jumps, downgrades, and large closure-size changes +- If aquamarine appears, note whether it is still the locally patched 0.16.0 build or a newer upstream version + +Downplay or omit: +- perl, Python/std library churn, build-time-only tools, docs, fonts +- Generic library bumps with no behavioral signal +- Lines that only show hash/path changes with no version delta + +Format exactly: + +### Heads up +- 3-6 bullets max. Each: `package: old -> new` then one short sentence on why it matters. + +### Noise +- One line naming the categories you ignored. + +If nothing looks noteworthy, say "No notable runtime changes." Do not invent details that are not in the diff. Be concise. diff --git a/.github/workflows/flake-check.yml b/.github/workflows/flake-check.yml index 5bb24dff..9cbfbfb6 100644 --- a/.github/workflows/flake-check.yml +++ b/.github/workflows/flake-check.yml @@ -8,6 +8,9 @@ jobs: check: name: Build & Check NixOS Configuration runs-on: ubuntu-latest + permissions: + id-token: write + contents: read steps: - name: Checkout repository uses: actions/checkout@v7 @@ -15,5 +18,11 @@ jobs: - name: Install Determinate Nix uses: DeterminateSystems/determinate-nix-action@v3 + - name: Set up Nix binary cache + uses: DeterminateSystems/magic-nix-cache-action@main + with: + use-flakehub: false + use-gha-cache: true + - name: Test build NixOS configurations run: nix flake check --all-systems diff --git a/.github/workflows/flake-diff.yml b/.github/workflows/flake-diff.yml new file mode 100644 index 00000000..415d3bde --- /dev/null +++ b/.github/workflows/flake-diff.yml @@ -0,0 +1,150 @@ +name: flake update diff + +on: + pull_request: + branches: [main] + types: [opened, synchronize, reopened] + paths: + - flake.lock + +jobs: + diff: + name: System diff + summary + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write + id-token: write + steps: + - name: Checkout PR head + uses: actions/checkout@v7 + with: + fetch-depth: 0 + + - name: Install Determinate Nix + uses: DeterminateSystems/determinate-nix-action@v3 + + - name: Set up Nix binary cache + uses: DeterminateSystems/magic-nix-cache-action@main + continue-on-error: true + with: + use-flakehub: false + use-gha-cache: true + + - name: Build base and head systems, then diff them + env: + BASE_REF: origin/${{ github.base_ref }} + HOSTS: tms-bso tower-of-power hp-430-g7 homelab + run: | + set -euo pipefail + + git worktree add --detach "$RUNNER_TEMP/base" "$BASE_REF" + trap 'git worktree remove --force "$RUNNER_TEMP/base" 2>/dev/null || true' EXIT + + : > diff-all.txt + + for host in $HOSTS; do + echo "=== $host ===" | tee -a diff-all.txt + + nix build "$RUNNER_TEMP/base#nixosConfigurations.${host}.config.system.build.toplevel" \ + --no-write-lock-file \ + --out-link "$RUNNER_TEMP/base-$host" + + nix build ".#nixosConfigurations.${host}.config.system.build.toplevel" \ + --no-write-lock-file \ + --out-link "$RUNNER_TEMP/head-$host" + + nix shell nixpkgs#nvd -c nvd diff "$RUNNER_TEMP/base-$host" "$RUNNER_TEMP/head-$host" \ + >> diff-all.txt 2>&1 || true + done + + - name: Upload full diff + uses: actions/upload-artifact@v7 + with: + name: flake-update-diff + path: diff-all.txt + + - name: Prepare summary input + run: | + set -euo pipefail + limit=50000 + if [ "$(wc -c < diff-all.txt)" -gt "$limit" ]; then + head -c "$limit" diff-all.txt > report.txt + printf '\n[diff truncated for summary; full diff is in the artifact]\n' >> report.txt + else + cp diff-all.txt report.txt + fi + + - name: Summarize diff with OpenCode Go + id: summary + continue-on-error: true + env: + OPENCODE_API_KEY: ${{ secrets.OPENCODE_API_KEY }} + SUMMARY_MODEL: ${{ vars.SUMMARY_MODEL || 'glm-5.3-flash' }} + SESSION_ID: ses_flake-diff-${{ github.run_id }} + run: | + set -euo pipefail + + if [ -z "${OPENCODE_API_KEY:-}" ]; then + echo "OPENCODE_API_KEY is not configured; skipping summary." + exit 0 + fi + + jq -n \ + --arg model "$SUMMARY_MODEL" \ + --rawfile system .github/prompts/flake-summary.md \ + --rawfile report report.txt \ + '{model: $model, messages: [{role: "system", content: $system}, {role: "user", content: ("Summarize this flake update diff:\n\n" + $report)}]}' \ + > payload.json + + curl -fsS \ + -A "cethien-dotfiles-flake-summary/1.0" \ + -H "Authorization: Bearer $OPENCODE_API_KEY" \ + -H "Content-Type: application/json" \ + -H "x-opencode-session: $SESSION_ID" \ + https://opencode.ai/inference/go/openai/v1/chat/completions \ + --data-binary @payload.json \ + > response.json + + { + echo 'text<> "$GITHUB_OUTPUT" + + - name: Comment summary on PR + if: github.event.pull_request.head.repo.full_name == github.repository + uses: actions/github-script@v9 + env: + SUMMARY: ${{ steps.summary.outputs.text }} + RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + with: + script: | + const marker = ''; + const summary = (process.env.SUMMARY || '').trim() + || '_Summary unavailable. Check the workflow log or paste the diff into AI manually._'; + const body = [ + marker, + '### Flake update summary', + '', + summary, + '', + '
Full nvd diff', + '', + `Download the **flake-update-diff** artifact from [this run](${process.env.RUN_URL}).`, + '', + '
', + ].join('\n'); + + const { owner, repo } = context.repo; + const issue_number = context.issue.number; + const comments = await github.paginate(github.rest.issues.listComments, { + owner, repo, issue_number, per_page: 100, + }); + const existing = comments.find(c => c.body && c.body.includes(marker)); + + if (existing) { + await github.rest.issues.updateComment({ owner, repo, comment_id: existing.id, body }); + } else { + await github.rest.issues.createComment({ owner, repo, issue_number, body }); + } diff --git a/.github/workflows/update-flake-lock.yml b/.github/workflows/update-flake-lock.yml index ecd226e8..3878a324 100644 --- a/.github/workflows/update-flake-lock.yml +++ b/.github/workflows/update-flake-lock.yml @@ -2,6 +2,11 @@ name: update-flake-lock on: workflow_dispatch: + inputs: + update-unstable: + description: "Also update nixpkgs-unstable (and inputs that follow it)" + type: boolean + default: false schedule: - cron: "0 0 * * 5" # Friday at Midnight UTC @@ -38,6 +43,7 @@ jobs: zen-browser nur spicetify-nix + ${{ inputs['update-unstable'] && 'nixpkgs-unstable' || '' }} commit-msg: "chore: weekly inputs update" pr-title: "chore: weekly inputs update" pr-body: "Automated weekly update of flake inputs." diff --git a/flake.lock b/flake.lock index 03d820bd..169b7ec6 100644 --- a/flake.lock +++ b/flake.lock @@ -71,11 +71,11 @@ "bdwgc": { "flake": false, "locked": { - "lastModified": 1792766812, - "narHash": "sha256-ZXxPgcmKohIJv8sYVHJaUV36/OCfTGQh+N7VfrPHVAM=", + "lastModified": 1794480318, + "narHash": "sha256-lFrtIzHVQhP9tKp3MN3PlmKuWyZVdMVbV+StbJ5WHOc=", "owner": "DeterminateSystems", "repo": "bdwgc", - "rev": "8505c09cafce7bd2cffc421fd94b79390f37e428", + "rev": "021d8526504250669958da921b6744da60bdf6b1", "type": "github" }, "original": { @@ -116,12 +116,12 @@ "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1793885443, - "narHash": "sha256-Df2nK3Hzj+DL4xpM5wRkYG/wS6VyUqIgHgxMI3e743o=", - "rev": "558e026d9d3c78351170d8f8a797fa0fac541ccf", - "revCount": 457, + "lastModified": 1795047249, + "narHash": "sha256-cIFgw0dKxzQULB8OSVLsXSrKfPfWzfzJA17rss9dqCg=", + "rev": "49968eb8f0f1a3c9c8790e9ead7ce7b5196f6c0f", + "revCount": 458, "type": "tarball", - "url": "https://api.flakehub.com/f/pinned/DeterminateSystems/determinate/3.24.2/01a1abec-122b-7762-9bf3-b517e8361a53/source.tar.gz" + "url": "https://api.flakehub.com/f/pinned/DeterminateSystems/determinate/3.24.3/01a1f12b-29f0-7623-8ebb-9b32a98f9538/source.tar.gz" }, "original": { "type": "tarball", @@ -131,37 +131,37 @@ "determinate-nixd-aarch64-darwin": { "flake": false, "locked": { - "narHash": "sha256-yp13xmaS0iLaTAxXOktLkPTal4eLO+mljFdobO8F+Vs=", + "narHash": "sha256-Xb/0zrXTXX+0Q5Q+KdfyO9R7Exbn9O0Zh5BETq/rU5U=", "type": "file", - "url": "https://install.determinate.systems/determinate-nixd/tag/v3.24.2/macOS" + "url": "https://install.determinate.systems/determinate-nixd/tag/v3.24.3/macOS" }, "original": { "type": "file", - "url": "https://install.determinate.systems/determinate-nixd/tag/v3.24.2/macOS" + "url": "https://install.determinate.systems/determinate-nixd/tag/v3.24.3/macOS" } }, "determinate-nixd-aarch64-linux": { "flake": false, "locked": { - "narHash": "sha256-/NUuiSqWlvBnb2hYArrLy/ah0IpGwS24dpe36eukE2E=", + "narHash": "sha256-emra+jcQ3EfVxXVq4ySxGTiz8ZP9s+TTuPvIruIMgIQ=", "type": "file", - "url": "https://install.determinate.systems/determinate-nixd/tag/v3.24.2/aarch64-linux" + "url": "https://install.determinate.systems/determinate-nixd/tag/v3.24.3/aarch64-linux" }, "original": { "type": "file", - "url": "https://install.determinate.systems/determinate-nixd/tag/v3.24.2/aarch64-linux" + "url": "https://install.determinate.systems/determinate-nixd/tag/v3.24.3/aarch64-linux" } }, "determinate-nixd-x86_64-linux": { "flake": false, "locked": { - "narHash": "sha256-NxMyglns1ACml2AJ34WF/plypDXc2UCaRB3wnppdE0Q=", + "narHash": "sha256-xy2wQKSfMTYMHy9RSlN78lXr71kDPhaiadeFXd8Hb1U=", "type": "file", - "url": "https://install.determinate.systems/determinate-nixd/tag/v3.24.2/x86_64-linux" + "url": "https://install.determinate.systems/determinate-nixd/tag/v3.24.3/x86_64-linux" }, "original": { "type": "file", - "url": "https://install.determinate.systems/determinate-nixd/tag/v3.24.2/x86_64-linux" + "url": "https://install.determinate.systems/determinate-nixd/tag/v3.24.3/x86_64-linux" } }, "disko": { @@ -461,11 +461,11 @@ ] }, "locked": { - "lastModified": 1793193205, - "narHash": "sha256-X6xa6sGA7RnJQuZGbFMC+K+KToWAlBDCCjJXfTwEPsw=", + "lastModified": 1794715309, + "narHash": "sha256-awkBBs5ctFKgEYjpNGpi3t/VqF589n5EWfdinRb2gNI=", "owner": "nix-community", "repo": "home-manager", - "rev": "095fef2f265c3c0da4fe315efba8f8a04495ab34", + "rev": "a1293da7dd8e497e08d26173f97e2976b36a31ea", "type": "github" }, "original": { @@ -504,12 +504,12 @@ "nixpkgs-regression": "nixpkgs-regression" }, "locked": { - "lastModified": 1793808558, - "narHash": "sha256-QY69Nw0WhXSvT2n2ldI5gt0h4ofbAVoi7EYGJGyNLl0=", - "rev": "f43bee4f45c2d42e7d1f4e37908ec5c7bb0fdba1", - "revCount": 27900, + "lastModified": 1795038288, + "narHash": "sha256-mZiNGyjdUVlfEvllLQKVK0ZbkxWIAC42jjERazi+lfU=", + "rev": "4176767670de8766080d972a97b0cd9411c482d2", + "revCount": 28083, "type": "tarball", - "url": "https://api.flakehub.com/f/pinned/DeterminateSystems/nix-src/3.24.2/01a1a784-2356-7ff3-a013-b47d4fd7ed90/source.tar.gz" + "url": "https://api.flakehub.com/f/pinned/DeterminateSystems/nix-src/3.24.3/01a1f0b9-59c2-76c2-a2fd-23133df9043e/source.tar.gz" }, "original": { "type": "tarball", @@ -611,11 +611,11 @@ "nixpkgs": "nixpkgs_3" }, "locked": { - "lastModified": 1794425805, - "narHash": "sha256-4s5CRvkYX4oAJVZ+zu2bBKFH2gG2GqN6OKHEWgJr1AY=", + "lastModified": 1795018746, + "narHash": "sha256-glQAHvZGgBVjzGIWgIZYSf3X10gvtO2LPR4rtyP/Soc=", "owner": "nixos", "repo": "nixos-hardware", - "rev": "b6ca87f78ec5bafc4b2aef7b29803dcf419266af", + "rev": "33475966110df258f52d05ec4d4cd6394637cbb9", "type": "github" }, "original": { @@ -626,16 +626,16 @@ }, "nixpkgs": { "locked": { - "lastModified": 1792949843, - "narHash": "sha256-kqilDNgied/b97sKLUjXlRzmRvP2nDZKLBJ6SnA3Qz0=", - "rev": "d176bec6d3f7dc613eb18ae8cec9397610ef826f", - "revCount": 1017174, + "lastModified": 1794872590, + "narHash": "sha256-E+XLAfnC7+bdr4qlEgRv6cdGmiqTU5oeFNKCha7epqQ=", + "rev": "f68407657ad294471eb4b2e65d193df26edf729f", + "revCount": 1018921, "type": "tarball", - "url": "https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-2605-mirror-staging-next/0.2605.1017174%2Brev-d176bec6d3f7dc613eb18ae8cec9397610ef826f/01a17516-2348-7af2-a0bb-e270a3fd61b5/source.tar.gz" + "url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.2605.1018921%2Brev-f68407657ad294471eb4b2e65d193df26edf729f/01a1ea95-6db4-7d02-8a1d-753f3849fe0e/source.tar.gz" }, "original": { "type": "tarball", - "url": "https://flakehub.com/f/DeterminateSystems/nixpkgs-2605-mirror-staging-next/%3D0.2605.1017174" + "url": "https://flakehub.com/f/NixOS/nixpkgs/0.2605" } }, "nixpkgs-23-11": { @@ -729,12 +729,12 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1792773339, - "narHash": "sha256-rZLrzrC6i+jnTAlvPZHogKDulY7WWDEv9hJeHieO7Zw=", - "rev": "3ec636362e1816bc2f0888fa0fa2c69f1bc9e504", - "revCount": 1100280, + "lastModified": 1794042290, + "narHash": "sha256-ziZn2PvCJE5JEEpqTdxXwJpPB+L3YqoCpTAMCzyaP3U=", + "rev": "f4a03c008967841f2a0b3cb7c436fc6fc31671f6", + "revCount": 1113206, "type": "tarball", - "url": "https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.1100280%2Brev-3ec636362e1816bc2f0888fa0fa2c69f1bc9e504/01a19fe6-9a46-7d82-a5bd-b6aa9c96b635/source.tar.gz" + "url": "https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.1113206%2Brev-f4a03c008967841f2a0b3cb7c436fc6fc31671f6/01a1e7ff-6305-7ad2-bb1f-9855526cb446/source.tar.gz" }, "original": { "type": "tarball", @@ -756,11 +756,11 @@ }, "nixpkgs_4": { "locked": { - "lastModified": 1794165970, - "narHash": "sha256-XuAV2cUwaod3Bt4XFVqiXz3v1w2ex16W6Sv4S7EWres=", + "lastModified": 1795137884, + "narHash": "sha256-iKXCN36qYfBni+3nH4vAd98/kshoIsPB2S9mYWhma30=", "owner": "nixos", "repo": "nixpkgs", - "rev": "ac588ef1c914865dad517b337ea0eb9694a4021c", + "rev": "ab5c18fdedfc8f9bbc9d773f10a540790e2787a7", "type": "github" }, "original": { @@ -778,11 +778,11 @@ ] }, "locked": { - "lastModified": 1794547967, - "narHash": "sha256-859Epq6BKEzaC8nI3KbMwLFdSkh2AUXGOB3jALwIRPg=", + "lastModified": 1795267700, + "narHash": "sha256-lgM6+fLb06qyi+ggOvDIKmV7GHPstTjXVn/p7TlYtbc=", "owner": "nix-community", "repo": "NUR", - "rev": "47a60ac60fb1654f40ca62bda052c90e95610834", + "rev": "2146d44614ab26d2407f8ea928174fe81c4942d2", "type": "github" }, "original": { @@ -864,11 +864,11 @@ "systems": "systems_2" }, "locked": { - "lastModified": 1793662659, - "narHash": "sha256-a+za5QCDlOe/PsuMlZiBcQ13cyiyOscK17BAJFu1/dE=", + "lastModified": 1794871977, + "narHash": "sha256-An9Qcr31Z+PmF4TlJWY6RkM4yPbBKc2vkyp6NctvMEk=", "owner": "Gerg-L", "repo": "spicetify-nix", - "rev": "13e6fed4eb99f809d390fb50f591bed6cb716dc0", + "rev": "cd7d88aca6db91899373d5574bb252547f4c8c2c", "type": "github" }, "original": { @@ -1067,11 +1067,11 @@ ] }, "locked": { - "lastModified": 1794495687, - "narHash": "sha256-YufvHb7O/52Cp+B9a3HRVO0HluXSEQ75+WMIcU6YPyE=", + "lastModified": 1795154381, + "narHash": "sha256-Q9L3osq3mW1NGCHLESTAsFQKB++50phqtomZE14J0TA=", "owner": "0xc000022070", "repo": "zen-browser-flake", - "rev": "46c4140b55328bc3ee32f22c42185bc534998a1d", + "rev": "1ac6ed0bb28e7e098fa27cf9624b33d74bd4b3bd", "type": "github" }, "original": { diff --git a/modules/home/opencode.nix b/modules/home/opencode.nix index 437eede8..b6926be7 100644 --- a/modules/home/opencode.nix +++ b/modules/home/opencode.nix @@ -8,8 +8,8 @@ cavemanSrc = pkgs.fetchFromGitHub { owner = "JuliusBrussee"; repo = "caveman"; - rev = "main"; - hash = "sha256-1X2DjYa4xqO1ZqwxdFjCmaypp0+HYncEpXaut4i9LkE="; + rev = "a192894723a8f47e7f504c7b5041967ff1f18e55"; + hash = "sha256-qG7njZgc+JCg+AAVNcFmOYjWMIAy73q4BociYG+WsEw="; }; in { config = lib.mkIf config.programs.opencode.enable {