-
Notifications
You must be signed in to change notification settings - Fork 102
Expand file tree
/
Copy pathpackage.nix
More file actions
81 lines (65 loc) · 1.64 KB
/
package.nix
File metadata and controls
81 lines (65 loc) · 1.64 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
77
78
79
80
81
{
lib,
stdenv,
fetchFromGitHub,
fetchPnpmDeps,
makeWrapper,
nodejs,
pnpm,
pnpmConfigHook,
versionCheckHook,
versionCheckHomeHook,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "mcporter";
version = "0.8.1";
src = fetchFromGitHub {
owner = "steipete";
repo = "mcporter";
rev = "v${finalAttrs.version}";
hash = "sha256-I7UqHsi4pw4wQB4bb8XObo4aUOVtYpF17aYzEHzgCrg=";
};
pnpmDeps = fetchPnpmDeps {
inherit (finalAttrs) pname version src;
hash = "sha256-OJhlpKwRCE7IqstwIzj1dBJMbMyPVA/w3RVnYfjz764=";
fetcherVersion = 2;
};
nativeBuildInputs = [
makeWrapper
nodejs
pnpm
pnpmConfigHook
];
buildPhase = ''
runHook preBuild
pnpm build
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p $out/{bin,lib/mcporter}
# Prune dev dependencies to reduce closure size
pnpm prune --prod
cp -r dist $out/lib/mcporter/
cp -r node_modules $out/lib/mcporter/
cp package.json $out/lib/mcporter/
makeWrapper ${nodejs}/bin/node $out/bin/mcporter \
--add-flags "$out/lib/mcporter/dist/cli.js"
runHook postInstall
'';
doInstallCheck = true;
nativeInstallCheckInputs = [
versionCheckHook
versionCheckHomeHook
];
passthru.category = "Utilities";
meta = {
description = "TypeScript runtime and CLI for the Model Context Protocol";
homepage = "https://github.com/steipete/mcporter";
changelog = "https://github.com/steipete/mcporter/releases";
license = lib.licenses.mit;
sourceProvenance = with lib.sourceTypes; [ fromSource ];
platforms = lib.platforms.all;
mainProgram = "mcporter";
};
})