Skip to content

Commit a38268d

Browse files
fix: allow running using nix run (#102)
1 parent 1683649 commit a38268d

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

nix/apollo-mcp.nix

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,18 @@
3737
# Generate a derivation for just the dependencies of the project so that they
3838
# can be cached across all of the various checks and builders.
3939
cargoArtifacts = craneLib.buildDepsOnly craneCommonArgs;
40+
41+
# Meta information about the packages
42+
packageInfo = with lib; {
43+
meta = {
44+
description = "Apollo MCP Server";
45+
homepage = "https://www.apollographql.com/docs/apollo-mcp-server";
46+
license = licenses.elastic20;
47+
48+
# The main binary that should be run when using `nix run`
49+
mainProgram = "apollo-mcp-server";
50+
};
51+
};
4052
in {
4153
# Expose the list of build dependencies for inheriting in dev shells
4254
nativeDependencies = craneCommonArgs.nativeBuildInputs;
@@ -69,7 +81,7 @@ in {
6981

7082
# List of packages exposed by this project
7183
packages = {
72-
apollo-mcp = craneLib.buildPackage craneCommonArgs;
84+
apollo-mcp = (craneLib.buildPackage craneCommonArgs) // packageInfo;
7385

7486
# Builder for apollo-mcp-server. Takes the rust target triple for specifying
7587
# the cross-compile target. Set the target to the same as the host for native builds.
@@ -97,7 +109,7 @@ in {
97109
"${cargo-zigbuild-patched}/bin/cargo-zigbuild ${cmd}"
98110
]);
99111
in
100-
craneLib.buildPackage (craneCommonArgs
112+
(craneLib.buildPackage (craneCommonArgs
101113
// {
102114
pname = craneCommonArgs.pname + "-${target}";
103115
nativeBuildInputs = [
@@ -126,6 +138,7 @@ in {
126138

127139
# Make sure to compile it for the specified target
128140
CARGO_BUILD_TARGET = target;
129-
});
141+
}))
142+
// packageInfo;
130143
};
131144
}

0 commit comments

Comments
 (0)