{ 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"; }; })