Files

59 lines
1.8 KiB
Nix
Raw Permalink Normal View History

2026-09-29 08:00:58 +02:00
{
lib,
buildGoModule,
fetchFromGitea,
gitMinimal,
nix-update-script,
versionCheckHook,
writableTmpDirAsHomeHook,
}:
buildGoModule (finalAttrs: {
pname = "agent-lib";
2026-11-05 08:58:09 +01:00
version = "0.3.0";
2026-09-29 08:00:58 +02:00
src = fetchFromGitea {
domain = "code.m3ta.dev";
owner = "m3tam3re";
repo = "agent-lib";
tag = "v${finalAttrs.version}";
2026-11-05 08:58:09 +01:00
hash = "sha256-BM2CO2kL6HBTrKqu7DNAF8blV36nkmieDlooUaa0cjU=";
2026-09-29 08:00:58 +02:00
};
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";
};
})