From c1e1933eafc18e0243d9e1b3f636e372ba09a246 Mon Sep 17 00:00:00 2001 From: m3ta-chiron Date: Tue, 29 Sep 2026 08:00:58 +0200 Subject: [PATCH] feat(pkgs): add agent-lib 0.1.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Source build (buildGoModule + fetchFromGitea) of code.m3ta.dev/m3tam3re/agent-lib — curator/client CLI for vendoring agent-content sources and syncing them into OpenCode runtime paths. - static binary, upstream ldflags mirrored (internal/version.Version) - offline test suite runs in check phase (gitMinimal for e2e fixtures) - versionCheckHook wired to the 'version' subcommand - nix-update-script for updates --- pkgs/agent-lib/default.nix | 59 ++++++++++++++++++++++++++++++++++++++ pkgs/default.nix | 1 + 2 files changed, 60 insertions(+) create mode 100644 pkgs/agent-lib/default.nix diff --git a/pkgs/agent-lib/default.nix b/pkgs/agent-lib/default.nix new file mode 100644 index 0000000..714c030 --- /dev/null +++ b/pkgs/agent-lib/default.nix @@ -0,0 +1,59 @@ +{ + lib, + buildGoModule, + fetchFromGitea, + gitMinimal, + nix-update-script, + versionCheckHook, + writableTmpDirAsHomeHook, +}: +buildGoModule (finalAttrs: { + pname = "agent-lib"; + version = "0.1.0"; + + src = fetchFromGitea { + domain = "code.m3ta.dev"; + owner = "m3tam3re"; + repo = "agent-lib"; + tag = "v${finalAttrs.version}"; + hash = "sha256-1eqRtgeDicsK6Z92kWfvOUr3qUG6Gyu7094PgSKW6E0="; + }; + + vendorHash = "sha256-92PSYpat2+rbHP9vu58tg7378tyxTGvwi7KtrYn7y+4="; + + # Match upstream goreleaser builds: static binaries, no cgo. + env.CGO_ENABLED = 0; + + # Mirror upstream ldflags (.goreleaser.yaml / Makefile): the version is + # baked into internal/version.Version; goreleaser injects the tag without + # the leading "v", so released binaries report "0.1.0" — we do the same. + ldflags = [ + "-s" + "-w" + "-X github.com/m3tam3re/agent-lib/internal/version.Version=${finalAttrs.version}" + ]; + + # Upstream tests are fully offline (unit + black-box e2e). The e2e + # fixtures shell out to `git init`/`git commit` to build local source + # repos, so git must be on PATH (the binary itself never calls git). + nativeCheckInputs = [ + gitMinimal + writableTmpDirAsHomeHook + ]; + + nativeInstallCheckInputs = [versionCheckHook]; + versionCheckProgramArg = "version"; + doInstallCheck = true; + + passthru.updateScript = nix-update-script {}; + + meta = { + description = "Curator/client CLI that vendors external agent-content git sources and syncs them into OpenCode runtime paths"; + homepage = "https://code.m3ta.dev/m3tam3re/agent-lib"; + changelog = "https://code.m3ta.dev/m3tam3re/agent-lib/releases/tag/v${finalAttrs.version}"; + # upstream ships no LICENSE file yet + license = lib.licenses.unfree; + platforms = lib.platforms.linux ++ lib.platforms.darwin; + mainProgram = "agent-lib"; + }; +}) diff --git a/pkgs/default.nix b/pkgs/default.nix index 346a87d..26a466d 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -32,6 +32,7 @@ in { vibetyper = pkgs.callPackage ./vibetyper {}; talk = pkgs.callPackage ./talk {}; crunch = pkgs.callPackage ./crunch {}; + agent-lib = pkgs.callPackage ./agent-lib {}; # ── Pass-through packages ────────────────────────────────────────── # Imported directly from flake inputs. No local modifications.