-
-
Notifications
You must be signed in to change notification settings - Fork 41
Expand file tree
/
Copy pathflake.nix
More file actions
113 lines (100 loc) · 2.97 KB
/
flake.nix
File metadata and controls
113 lines (100 loc) · 2.97 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
{
description = "Model Context Protocol SDK for Elixir";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05-small";
elixir-overlay.url = "github:zoedsoupe/elixir-overlay";
};
outputs = {
self,
nixpkgs,
elixir-overlay,
}: let
inherit (nixpkgs.lib) genAttrs;
inherit (nixpkgs.lib.systems) flakeExposed;
forAllSystems = f:
genAttrs flakeExposed (
system: let
overlays = [elixir-overlay.overlays.default];
pkgs = import nixpkgs {inherit system overlays;};
in
f pkgs
);
in {
devShells = forAllSystems (pkgs: {
default = pkgs.mkShell {
name = "anubis-mcp-dev";
packages = with pkgs; [
(elixir-with-otp erlang_28).latest
erlang_28
redis
uv
just
go
zig
_7zz
xz
nodejs
k6
];
};
});
packages = forAllSystems (pkgs: {
default = pkgs.stdenv.mkDerivation {
pname = "anubis-mcp";
version = "1.2.0"; # x-release-please-version
src = ./.;
buildInputs = with pkgs; [
elixir-bin.latest
erlang
zig
_7zz
xz
git
];
buildPhase = ''
export MIX_ENV=prod
export ANUBIS_MCP_COMPILE_CLI=true
export HOME=$TMPDIR
mix do deps.get, compile
mix release anubis_mcp --overwrite
'';
installPhase = ''
mkdir -p $out/bin
echo "=== Build output structure ==="
find _build -type f -name "*anubis*" 2>/dev/null || true
if [ -d "_build/prod/rel/anubis_mcp/burrito_out" ]; then
echo "Found burrito_out directory"
cp -r _build/prod/rel/anubis_mcp/burrito_out/* $out/bin/ || true
elif [ -d "_build/prod/rel/anubis_mcp/bin" ]; then
echo "Found standard release bin directory"
cp -r _build/prod/rel/anubis_mcp/bin/* $out/bin/ || true
else
echo "No bin directory found, checking for other release outputs"
find _build/prod/rel -name "*" -type f -executable | head -5
fi
if [ -n "$(ls -A $out/bin 2>/dev/null)" ]; then
chmod +x $out/bin/* || true
echo "=== Installed binaries ==="
ls -la $out/bin/
else
echo "ERROR: No binaries were installed!"
exit 1
fi
'';
meta = with pkgs.lib; {
description = "Model Context Protocol (MCP) implementation in Elixir";
homepage = "https://github.com/zoedsoupe/anubis-mcp";
license = licenses.mit;
maintainers = with maintainers; [zoedsoupe];
platforms = platforms.unix ++ platforms.darwin;
};
};
});
apps = forAllSystems (pkgs: {
default = {
type = "app";
program = "${self.packages.${pkgs.system}.default}/bin/anubis_mcp";
};
});
};
}