-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdevenv.nix
More file actions
78 lines (66 loc) · 1.54 KB
/
devenv.nix
File metadata and controls
78 lines (66 loc) · 1.54 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
{ pkgs, lib, config, inputs, ... }:
{
name = "ai-usage-log";
env = {
GREET = "AI Usage Log MCP Server Development Environment";
POETRY_VIRTUALENVS_IN_PROJECT = "true";
POETRY_VIRTUALENVS_CREATE = "true";
};
packages = with pkgs; [
git
openssh
];
languages.python = {
enable = true;
version = "3.12";
poetry = {
enable = true;
activate.enable = true;
install = {
enable = true;
installRootPackage = true;
compile = false;
groups = [ ];
verbosity = "more";
};
};
};
scripts = {
serve.exec = ''
echo "Starting AI Usage Log MCP Server (stdio)..."
ai-usage-log
'';
check.exec = ''
echo "Checking Python compilation..."
python -m py_compile src/ai_usage_log/server.py
echo "OK"
'';
test-startup.exec = ''
echo "Testing server startup (5s timeout)..."
timeout 5s ai-usage-log || true
'';
};
enterTest = ''
echo "Running verification tests..."
python --version
poetry --version
'';
git-hooks.hooks = {
nixpkgs-fmt.enable = true;
ruff.enable = true;
};
dotenv.enable = true;
enterShell = ''
echo ""
echo "$GREET"
echo ""
echo "Available commands:"
echo " serve - Run MCP server (stdio transport)"
echo " check - Verify Python compilation"
echo " test-startup - Test server startup with timeout"
echo ""
echo "Python: $(python --version)"
echo "Poetry: $(poetry --version)"
echo ""
'';
}