Repository navigation
fix: Nix flake - #108
fix: Nix flake#108
Conversation
Enables installing and running mcp via `nix run github:avelino/mcp`. Facilitates integration into NixOS and home-manager configurations. Closes avelino#18
PR Summary by QodoAdd Nix flake to build/run mcp via nix
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
<
8000
/tr>
There was a problem hiding this comment.
Pull request overview
Adds a Nix flake to let Nix/NixOS users build and run mcp via standard flake workflows (e.g., nix run), addressing the packaging gap described in Issue #18.
Changes:
- Introduces
flake.nixwithbuildRustPackagepackaging for the Rust CLI. - Defines a default app entry for
nix runand a Rust-focused development shell.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Code Review by Qodo
1. No flake.lock pinning
|
| inputs = { | ||
| nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; | ||
| utils.url = "github:numtide/flake-utils"; | ||
| }; |
There was a problem hiding this comment.
1. No flake.lock pinning 🐞 Bug ☼ Reliability
The flake declares nixpkgs/flake-utils as floating GitHub references, but there is no committed flake.lock, so different u 8000 sers/CI runs can resolve different nixpkgs revisions over time and get inconsistent builds. This undermines the main reproducibility benefit of introducing a flake.
Agent Prompt
### Issue description
`flake.nix` uses floating GitHub inputs (e.g., `nixos-unstable`) but the repo does not include a committed `flake.lock`, making the flake evaluation non-deterministic across time/machines.
### Issue Context
Nix flakes rely on `flake.lock` to pin exact revisions of each input. Without it, the input versions are resolved at evaluation time and can change without any repo changes.
### Fix Focus Areas
- flake.lock[1-999999]
### Suggested fix
1. Run `nix flake lock` (or `nix flake update` if you intend to refresh inputs).
2. Commit the generated `flake.lock` file.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| cargoLock = { | ||
| lockFile = ./Cargo.lock; | ||
| allowBuiltinFetchGit = true; | ||
| }; |
There was a problem hiding this comment.
2. Unneeded fetchgit fallback 🐞 Bug ⚙ Maintainability
cargoLock.allowBuiltinFetchGit = true enables a fallback mechanism intended for git-based Cargo dependencies, but for registry-sourced dependencies it provides no benefit and adds avoidable configuration surface. Keeping it disabled unless required helps preserve stricter/reproducible fetch behavior.
Agent Prompt
### Issue description
`cargoLock.allowBuiltinFetchGit = true` is enabled in the flake. This setting is generally only needed when your `Cargo.lock` contains git dependencies that you are not pinning via `outputHashes`.
### Issue Context
The current lockfile includes registry-sourced packages (example shown in citations). If you don’t have git dependencies, leaving this enabled is unnecessary.
### Fix Focus Areas
- flake.nix[23-26]
### Suggested fix
- Remove `allowBuiltinFetchGit = true;`.
- If you do have git dependencies that require special handling, prefer adding explicit `outputHashes` (and optionally add a short comment documenting which dependency requires it).
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
Qodo Fixer✅ Merged (0) · ☑ Fixed (0) Process
|
|
Thanks for adding this, and sorry for the slow reply. Happy to have Nix support. A few small things before merging: could you commit the |
Closes #18