-
-
Notifications
You must be signed in to change notification settings - Fork 719
feat: add simple Nix flake for reproducible development environment #242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
svnlto
wants to merge
11
commits into
BeehiveInnovations:main
Choose a base branch
from
svnlto:feat/simple-nix-flake
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+581
−386
Open
Changes from 7 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
088d80c
feat: add simple and idiomatic nix flake
svnlto 8426fd5
docs: add Nix flake development setup to contributions guide
svnlto 88c1d35
fix: add dotenv loading to .envrc for environment variables
svnlto 54ce9b5
fix: complete Nix environment compatibility
svnlto e6ba24b
fix: use hybrid Nix + pip approach for compatibility
svnlto c8fce8c
fix: exclude .nix-venv from code quality checks
svnlto 909f9ff
feat: add Nix lock file and update gitignore
svnlto c604f51
merge: resolve .gitignore conflict between Nix entries and worktrees
svnlto 00eb86d
fix: address PR feedback and improve code quality setup
svnlto 0661c9f
Merge branch 'main' into feat/simple-nix-flake
svnlto 8b92c96
Merge branch 'main' into feat/simple-nix-flake
svnlto File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
use flake | ||
dotenv | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -184,3 +184,8 @@ CLAUDE.local.md | |
logs/ | ||
*.backup | ||
/.desktop_configured | ||
|
||
# Nix development environment | ||
.nix-venv/ | ||
.direnv/ | ||
result |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
{ | ||
description = "Zen MCP Server"; | ||
|
||
inputs = { | ||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; | ||
flake-utils.url = "github:numtide/flake-utils"; | ||
}; | ||
|
||
outputs = { nixpkgs, flake-utils, ... }: | ||
flake-utils.lib.eachDefaultSystem (system: let | ||
pkgs = import nixpkgs { inherit system; }; | ||
python = pkgs.python312; | ||
in { | ||
packages.default = python.pkgs.buildPythonApplication { | ||
pname = "zen-mcp-server"; | ||
version = "1.1.0"; | ||
src = ./.; | ||
format = "pyproject"; | ||
|
||
nativeBuildInputs = with python.pkgs; [ | ||
setuptools | ||
setuptools-scm | ||
wheel | ||
]; | ||
propagatedBuildInputs = with python.pkgs; [ | ||
mcp google-genai openai pydantic python-dotenv | ||
]; | ||
|
||
# If packages aren't in nixpkgs, override here | ||
# postInstall = "ln -s $out/bin/server.py $out/bin/zen-mcp-server"; | ||
}; | ||
|
||
devShells.default = pkgs.mkShell { | ||
packages = [ | ||
python | ||
python.pkgs.pip | ||
python.pkgs.virtualenv | ||
# Basic tools | ||
pkgs.git | ||
] ++ (with python.pkgs; [ | ||
# Only basic packages from nixpkgs | ||
pytest black ruff isort setuptools wheel | ||
svnlto marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
]); | ||
|
||
shellHook = '' | ||
if [ ! -d ".nix-venv" ]; then | ||
echo "Setting up Python environment..." | ||
python -m venv .nix-venv --quiet | ||
source .nix-venv/bin/activate | ||
pip install -q --upgrade pip | ||
pip install -q mcp google-genai openai pydantic python-dotenv pytest-asyncio | ||
svnlto marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
deactivate | ||
fi | ||
source .nix-venv/bin/activate | ||
''; | ||
|
||
# Ensure proper shared library paths | ||
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [ | ||
pkgs.stdenv.cc.cc.lib | ||
]; | ||
}; | ||
}); | ||
} | ||
svnlto marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.