-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
1142 add nix flake support #1157
base: develop
Are you sure you want to change the base?
1142 add nix flake support #1157
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅ |
@lessuselesss love this PR, but there are some weird problems that will cause a NixOS user to fail when building the codebase with nix flakes enabled. For example, I built this on my NixOS machine and we see this error:
We may think...what?! No Way...But how?? The pkgs specifically lists So I did some digging bc Nix can be a pain in the ass at times with weird dependencies errors. So I checked the So this here is the culprit for why a NixOS user will hit this weird error even though we declaratively chose the right node version. |
Hello, Thank you so much for the valuable feedback. I'm excited to contribute and am happy (and was hoping!!) to have someone from the nix community overseeing contributions here! Nice catch on finding the culprit, I'll investigate some workarounds 🙇 |
I don't like the hardcoded versions, maybe another dev can offer a better suggestions on how to get the latest version like |
Thanks for the feedback! I've updated the implementation to automatically detect versions from package.json instead of hardcoding them. The flake now:
This should make it more maintainable and reduce the risk of version mismatches. Alternatively, @HashWarlock would an overlay for nodejs/pnpm be more appropriate nix'ing here? |
- Add Nix flake for reproducible development environment - Auto-detect Node.js and pnpm versions from package.json - Configure development tools (gcc, python3, vips, etc.) - Add shell hook with helpful development commands
72d22cd
to
b7185b6
Compare
I've reset the branch to resolve the merge conflicts and provide a clean implementation. The core functionality remains the same:
The previous discussion and feedback has been incorporated into this cleaner version. |
Probably best to do an overlay bc whenever I run the current How do the tests work in your nix environment? |
I ended up installing eliza on a fresh VM as per the readme, and found similar results to the below (esp. #4) Let me share what I've found from running the tests in the nix environment:
Regarding your question about an overlay - yes, that sounds like a good approach so I've gone ahead and made an attempt. Let me know if you'd like me to focus on any specific area or if you need more details about the test results. |
4cafe97
to
2c78149
Compare
Relates to:
Issue #1142
Risks
Low - This change:
Background
What does this PR do?
Adds Nix Flake support to provide a reproducible development environment with:
What kind of change is this?
Improvements (adds optional development tooling without changing existing functionality)
Documentation changes needed?
My changes require a change to the project documentation.
I will update the local development guide to include:
Testing
Where should a reviewer start?
git clone https://github.com/ai16z/eliza.git cd eliza nix develop
Detailed testing steps
Prerequisites:
Test environment setup:
git clone https://github.com/ai16z/eliza.git cd eliza nix develop
Test build process:
Test clean process:
Discord username
Adam Turner | lessuseless
ar4s_45979