From 52a5ec395408d89e852dc9a5a852b9521390e151 Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Wed, 5 Aug 2026 08:08:39 -0500 Subject: [PATCH] Simplify back to baseline --- .github/workflows/update.yml | 49 ++++++++++++++++++++++++++++++++++++ flake.lock | 17 ------------- flake.nix | 6 ++--- 3 files changed, 52 insertions(+), 20 deletions(-) create mode 100644 .github/workflows/update.yml diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml new file mode 100644 index 0000000..c00c7e5 --- /dev/null +++ b/.github/workflows/update.yml @@ -0,0 +1,49 @@ +on: + schedule: + - cron: "7 23 * * *" + workflow_dispatch: + +jobs: + update: + runs-on: nix-latest + steps: + - name: Checkout + uses: actions/checkout@v6 + + - name: Update flake.lock + run: nix flake update + + - name: Create PR if changed + env: + GITEA_TOKEN: ${{ secrets.KLAATU_TOKEN }} + GITEA_URL: https://src.thehellings.com + REPO: greg/mingw-sword-build + run: | + if git diff --quiet flake.lock; then + echo "flake.lock unchanged, nothing to do" + exit 0 + fi + + BRANCH="auto/update-flake-lock-$(date +%Y%m%d)" + git config user.email "klaatu@thehellings.com" + git config user.name "klaatu" + git checkout -b "$BRANCH" + git add flake.lock + git commit -m "chore: update flake.lock $(date +%Y-%m-%d)" + + # Push branch using token auth + git remote set-url origin "https://klaatu:${GITEA_TOKEN}@${GITEA_URL#https://}/${REPO}.git" + git push origin "$BRANCH" + + # Create PR via Gitea API + curl -s -X POST \ + -H "Authorization: token ${GITEA_TOKEN}" \ + -H "Content-Type: application/json" \ + "${GITEA_URL}/api/v1/repos/${REPO}/pulls" \ + -d "{ + \"title\": \"chore: update flake.lock $(date +%Y-%m-%d)\", + \"head\": \"$BRANCH\", + \"base\": \"main\", + \"body\": \"Automated weekly flake.lock update.\\n\\nGenerated by Gitea Actions.\", + \"assignees\": [\"greg\"] + }" diff --git a/flake.lock b/flake.lock index 444d489..9af2f89 100644 --- a/flake.lock +++ b/flake.lock @@ -1,21 +1,5 @@ { "nodes": { - "aarch_fix": { - "locked": { - "lastModified": 1753636920, - "narHash": "sha256-BZq0xc6+3OVxUE+re+Rd+5+JqmGUARxa0M1waMkscyk=", - "owner": "greg-hellings", - "repo": "nixpkgs", - "rev": "54692b15811727c1cd367dbd82e6e22abd1bd057", - "type": "github" - }, - "original": { - "owner": "greg-hellings", - "ref": "ucrt/zlib", - "repo": "nixpkgs", - "type": "github" - } - }, "flake-compat": { "flake": false, "locked": { @@ -155,7 +139,6 @@ }, "root": { "inputs": { - "aarch_fix": "aarch_fix", "flake-parts": "flake-parts", "flake-root": "flake-root", "hooks": "hooks", diff --git a/flake.nix b/flake.nix index 99aeec9..07a08b8 100644 --- a/flake.nix +++ b/flake.nix @@ -14,7 +14,7 @@ flake-parts.url = "github:hercules-ci/flake-parts"; flake-root.url = "github:srid/flake-root"; hooks.url = "github:cachix/git-hooks.nix"; - aarch_fix.url = "github:greg-hellings/nixpkgs/ucrt/zlib"; + #aarch_fix.url = "github:greg-hellings/nixpkgs/ucrt/zlib"; }; outputs = @@ -33,7 +33,7 @@ perSystem = { pkgs, self', ... }@inputs': let - arm = (import inputs.aarch_fix { inherit (inputs') system; }); + #arm = (import inputs.aarch_fix { inherit (inputs') system; }); in { _module.args.pkgs = import inputs.nixpkgs { @@ -110,7 +110,7 @@ default = tar mingwW64; x86 = tar mingwW64; ucrt = tar ucrt64; - ucrtAarch = tar arm.pkgsCross.ucrtAarch64; + #ucrtAarch = tar arm.pkgsCross.ucrtAarch64; update = pkgs.callPackage ./update.nix { }; }; };