From 87aea418434bb1326507054e255ba1017367d617 Mon Sep 17 00:00:00 2001 From: Ari Sosnovsky Date: Tue, 17 Nov 2026 14:10:00 -0500 Subject: [PATCH] less frequent updates --- flake.nix | 9 ++++++++- pkgs/ABOUTME.md | 2 +- pkgs/delta-editor/default.nix | 4 ++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/flake.nix b/flake.nix index 8398a2a..4f21738 100644 --- a/flake.nix +++ b/flake.nix @@ -237,14 +237,21 @@ let pkgs = nixpkgs.legacyPackages.${system}; qtDocs = pkgs.qt6.qtdoc; - # Hook: run skyg pkgs update --all before every commit; fail if it bumped + # Hook: run skyg pkgs update --all at most once a week; fail if it bumped # anything under pkgs/ so bumps get reviewed and staged, never auto-committed. pkgs-update-script = pkgs.writeShellScriptBin "skyg-pkgs-update" '' set -euo pipefail export PATH=${pkgs.bash}/bin:${pkgs.coreutils}/bin:${pkgs.curl}/bin:${pkgs.jq}/bin:${pkgs.git}/bin:${pkgs.gnused}/bin:${pkgs.gawk}/bin:$PATH root=$(${pkgs.git}/bin/git rev-parse --show-toplevel) cd "$root" + stamp=$(${pkgs.git}/bin/git rev-parse --git-path pkgs-update-last-success) + now=$(date +%s) + last_run=$(date -r "$stamp" +%s 2>/dev/null || echo 0) + if (( now - last_run < 604800 )); then + exit 0 + fi ${pkgs.nushell}/bin/nu --commands 'use ./bin/lib/cmds.nu *; skyg pkgs update --all' + touch "$stamp" if ! ${pkgs.git}/bin/git diff --quiet -- pkgs/; then echo "" echo "pkgs-update: version bumps applied under pkgs/ — review 'git diff pkgs/'," diff --git a/pkgs/ABOUTME.md b/pkgs/ABOUTME.md index f371cb1..54e42d1 100644 --- a/pkgs/ABOUTME.md +++ b/pkgs/ABOUTME.md @@ -33,7 +33,7 @@ Each package can have an `update.sh` script that automates version bumps. - **`skyg pkgs update --all`** — auto-detect the latest version for all packages that have `update.sh`. - **`skyg pkgs update `** — auto-detect the latest version for a single package. - **`skyg pkgs update `** — bump a specific package to a specific version. -- **Pre-commit hook** — a `pkgs-update` hook (defined in `flake.nix`) runs `skyg pkgs update --all` before every commit and blocks the commit if it changed anything under `pkgs/` (review + `git add pkgs/`, then commit again). +- **Pre-commit hook** — a `pkgs-update` hook (defined in `flake.nix`) runs `skyg pkgs update --all` on the first commit attempt and then at most once every seven days. It records successful runs in Git's local metadata; failed updates are retried on the next commit. If it changed anything under `pkgs/`, it blocks the commit (review + `git add pkgs/`, then commit again without rerunning the update). Each `update.sh` supports two modes: diff --git a/pkgs/delta-editor/default.nix b/pkgs/delta-editor/default.nix index a6dd74e..f383fd5 100644 --- a/pkgs/delta-editor/default.nix +++ b/pkgs/delta-editor/default.nix @@ -29,7 +29,7 @@ let pname = "delta-editor"; - version = "0.27.1"; + version = "0.27.2"; apiUrl = "https://delta.dev/api/releases/nightly/${version}/asset?asset=delta&os=linux&arch=x86_64"; @@ -38,7 +38,7 @@ let inherit version; outputHashMode = "flat"; - outputHash = "sha256-/kBXce6UVyb9Kxq6CZwOTMc0dNNwXZtBwpYXypuw5AU="; + outputHash = "sha256-s8/5ZZvnXUnWLE7ATzlFMS8z3RDpboCr2BywH/Iss9w="; nativeBuildInputs = [ curl jq cacert ]; SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt";