commit 0dae140c3c5cdf1b90349ea9660d7957fc3dc922 Author: Josh Palmer Date: Sun Jan 4 13:16:38 2026 +0100 init nix-stepiete-tools with summarize diff --git a/README.md b/README.md new file mode 100644 index 0000000..397c4ca --- /dev/null +++ b/README.md @@ -0,0 +1,25 @@ +# nix-stepiete-tools + +Nix packaging for Peter Steinberger's tools, with per-tool clawdbot plugins. + +Darwin-only for now (aarch64-darwin). + +## Usage (clawdbot plugins) + +Each tool is a subflake under `tools/` and exposes `clawdbotPlugin`. + +Example (summarize): + +```nix +plugins = [ + { source = "github:clawdbot/nix-stepiete-tools?dir=tools/summarize"; } +]; +``` + +## Packages (root flake) + +You can also import packages directly from the root flake: + +```nix +inputs.nix-stepiete-tools.packages.${pkgs.system}.summarize +``` diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..644277d --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1767364772, + "narHash": "sha256-fFUnEYMla8b7UKjijLnMe+oVFOz6HjijGGNS1l7dYaQ=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "16c7794d0a28b5a37904d55bcca36003b9109aaa", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..3acbeff --- /dev/null +++ b/flake.nix @@ -0,0 +1,25 @@ +{ + description = "Nix packaging for steipete tools (clawdbot)"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + }; + + outputs = { self, nixpkgs }: + let + systems = [ "aarch64-darwin" ]; + forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f system); + in { + packages = forAllSystems (system: + let + pkgs = import nixpkgs { inherit system; }; + in { + summarize = pkgs.callPackage ./nix/pkgs/summarize.nix {}; + } + ); + + checks = forAllSystems (system: { + summarize = self.packages.${system}.summarize; + }); + }; +} diff --git a/garnix.yaml b/garnix.yaml new file mode 100644 index 0000000..4773751 --- /dev/null +++ b/garnix.yaml @@ -0,0 +1,3 @@ +builds: + include: + - "checks.aarch64-darwin.*" diff --git a/nix/pkgs/summarize.nix b/nix/pkgs/summarize.nix new file mode 100644 index 0000000..1757167 --- /dev/null +++ b/nix/pkgs/summarize.nix @@ -0,0 +1,34 @@ +{ lib, stdenv, fetchurl }: + +stdenv.mkDerivation { + pname = "summarize"; + version = "0.9.0"; + + src = fetchurl { + url = "https://github.com/steipete/summarize/releases/download/v0.9.0/summarize-macos-arm64-v0.9.0.tar.gz"; + hash = "sha256-B6/eUcbv4K9kgozo1fELFX+NNGa0C64dB6OSydwu6A8="; + }; + + dontConfigure = true; + dontBuild = true; + + unpackPhase = '' + tar -xzf "$src" + ''; + + installPhase = '' + runHook preInstall + mkdir -p "$out/bin" + cp summarize "$out/bin/summarize" + chmod 0755 "$out/bin/summarize" + runHook postInstall + ''; + + meta = with lib; { + description = "Link → clean text → summary"; + homepage = "https://github.com/steipete/summarize"; + license = licenses.mit; + platforms = [ "aarch64-darwin" ]; + mainProgram = "summarize"; + }; +} diff --git a/result b/result new file mode 120000 index 0000000..c3b9740 --- /dev/null +++ b/result @@ -0,0 +1 @@ +/nix/store/j39ry85yas1jgjs5hn7a9mx6v96nx093-summarize-0.9.0 \ No newline at end of file diff --git a/tools/summarize/flake.nix b/tools/summarize/flake.nix new file mode 100644 index 0000000..30ea905 --- /dev/null +++ b/tools/summarize/flake.nix @@ -0,0 +1,27 @@ +{ + description = "clawdbot plugin: summarize"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + root.url = "path:../.."; + }; + + outputs = { self, nixpkgs, root }: + let + system = "aarch64-darwin"; + pkgs = import nixpkgs { inherit system; }; + summarize = root.packages.${system}.summarize; + in { + packages.${system}.summarize = summarize; + + clawdbotPlugin = { + name = "summarize"; + skills = [ ./skills/summarize ]; + packages = [ summarize ]; + needs = { + stateDirs = []; + requiredEnv = []; + }; + }; + }; +} diff --git a/tools/summarize/skills/summarize/SKILL.md b/tools/summarize/skills/summarize/SKILL.md new file mode 100644 index 0000000..42801ef --- /dev/null +++ b/tools/summarize/skills/summarize/SKILL.md @@ -0,0 +1,9 @@ +--- +name: summarize +description: Summarize a URL by extracting clean text. +--- + +Use the `summarize` CLI to fetch a URL and return a summary. + +Example: +- summarize https://example.com/article