feat(pkgs): add agent-lib 0.1.0
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
This commit is contained in:
1 parent
da3c589933
commit
c1e1933eaf
2 files changed
+60
No files matched your search
@@ -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";
|
||||
};
|
||||
})
|
||||
Reference in new issue
Block a user