From f6cd0e205968826a03db6a819022e06c78f37c22 Mon Sep 17 00:00:00 2001 From: Guy Chronister Date: Sun, 22 Feb 2026 16:36:05 -0600 Subject: [PATCH] _010editor: add updatescript Co-authored-by: Fedi Jamoussi --- pkgs/by-name/_0/_010editor/package.nix | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/pkgs/by-name/_0/_010editor/package.nix b/pkgs/by-name/_0/_010editor/package.nix index 3884de5b4c22..d80ff2082fce 100644 --- a/pkgs/by-name/_0/_010editor/package.nix +++ b/pkgs/by-name/_0/_010editor/package.nix @@ -10,6 +10,7 @@ qt6, undmg, xkeyboard-config, + writeScript, }: stdenv.mkDerivation (finalAttrs: { @@ -105,6 +106,21 @@ stdenv.mkDerivation (finalAttrs: { }; }; + passthru = { + updateScript = writeScript "update-010editor" '' + #!/usr/bin/env nix-shell + #!nix-shell -i bash -p curl pcre2 common-updater-scripts + + set -eu -o pipefail + + # Expect the text in format of "Version: major.minor.patchlevel + newVersion="$(curl -s https://sweetscape.com/download/010editor/ | pcre2grep -o1 'Version: ([0-9]+\.[0-9]+\.[0-9]+)' | sort -u)" + for platform in ${toString finalAttrs.meta.platforms}; do + update-source-version _010editor "$newVersion" --source-key=passthru.srcs.$platform --ignore-same-version + done + ''; + }; + meta = { description = "Text and hex editor"; homepage = "https://www.sweetscape.com/010editor/";