forked from numtide/llm-agents.nix
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpackage.nix
More file actions
76 lines (65 loc) · 1.56 KB
/
Copy pathpackage.nix
File metadata and controls
76 lines (65 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
{
lib,
flake,
buildGoModule,
buildNpmPackage,
fetchFromGitHub,
versionCheckHook,
}:
let
versionData = builtins.fromJSON (builtins.readFile ./hashes.json);
inherit (versionData)
version
hash
npmDepsHash
vendorHash
;
src = fetchFromGitHub {
owner = "wesm";
repo = "agentsview";
rev = "v${version}";
inherit hash;
};
frontend = buildNpmPackage {
pname = "agentsview-frontend";
inherit version src;
sourceRoot = "${src.name}/frontend";
inherit npmDepsHash;
installPhase = ''
runHook preInstall
cp -r dist $out
runHook postInstall
'';
};
in
buildGoModule {
pname = "agentsview";
inherit version src vendorHash;
subPackages = [ "cmd/agentsview" ];
tags = [ "fts5" ];
env.CGO_ENABLED = "1";
preBuild = ''
cp -r ${frontend} internal/web/dist
'';
ldflags = [
"-s"
"-w"
"-X main.version=${version}"
"-X main.commit=v${version}"
"-X main.buildDate=1970-01-01T00:00:00Z"
];
doCheck = false;
doInstallCheck = true;
nativeInstallCheckInputs = [ versionCheckHook ];
passthru.category = "Usage Analytics";
meta = with lib; {
description = "Local-first viewer and analytics for AI coding agent sessions";
homepage = "https://github.com/wesm/agentsview";
changelog = "https://github.com/wesm/agentsview/releases/tag/v${version}";
license = licenses.mit;
sourceProvenance = with sourceTypes; [ fromSource ];
maintainers = with flake.lib.maintainers; [ ak2k ];
mainProgram = "agentsview";
platforms = platforms.unix;
};
}