refactor(packages): move in-tree MCP packages to packages/ and standardize callPackage #281
No reviewers
Labels
No labels
area:authentication
area:flake-utilities
area:performance
area:tbd
host:chaos
host:cosmos
host:electra
host:fleet
host:lena
host:lyra
host:mass-storage
host:media1
host:nimmog-de
host:nova
host:pangolin
host:pangolin-vps
host:phone
host:router
host:vega
investigation
phase:cutover
phase:deploy
phase:mcp
phase:module
phase:packaging
phase:prep
phase:validation
priority:high
priority:medium
project:attic-postgres-lyra-rollout
project:auto-update-reliability
project:auto-update-remediation
project:declarative-purity-cleanup
project:external-review
project:fleet-boundary-cleanup
project:host-facts-refactor
project:lyra-nixos-deploy
project:lyra-service-stack-migration
project:nebula-mesh-network
project:nix-idioms-hygiene
project:nixos-build-deployment-pipeline
project:security-hardening
project:service-stack-migration
project:vega-sillytavern-cutover
project:wiki-rebuild
repo:numtide/flake-utils
repo:numtide/nix-auth
repo:numtide/nixos-passthru-cache
repo:numtide/nix-relay
service:auto-update
service:gitlab
service:hermes
service:mem0
service:nix
service:sillytavern
service:slskd
service:synthseek
service:tdarr
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
nimmo/nixos-config!281
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/issue-273-standardize-mcp-packages"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Resolves #273
This PR standardizes in-tree and external MCP package definitions:
nimmo/karakeep-mcp.nix(pinned via flake inputkarakeep-mcp), removing its 25 KiBpnpm-lock.yamland npm dependency churn fromnixos-config.bookstack-mcpandmcp-pangolinare moved to canonical pathspackages/bookstack-mcp/default.nixandpackages/mcp-pangolin/default.nixwith idiomaticcallPackagesignatures ({ lib, buildNpmPackage, ... }:and{ lib, rustPlatform, ... }:).bookstack-mcpandmcp-pangolinare exported as flake packages underpackages.x86_64-linux.bookstack-mcpandmcp-pangolinviapkgs.callPackage.modules/common/trilium-mcp-package.nixand obsoletemodules/common/karakeep-mcp-*files have been removed, leaving zero package derivations or lockfiles inmodules/common/.Validation
nix build --no-link .#bookstack-mcp: succeeded cleanly.nix build --no-link .#mcp-pangolin: succeeded cleanly../tests/nixos-pin-lifecycle-regressions.sh: passed.nix fmt: formatted cleanly.nix flake check: passed across all registered hosts (electra,lena,vega,lyra) and check derivations.nix build --no-link .#nixosConfigurations.electra.config.system.build.toplevel: succeeded for base, igpu, and dgpu specialisations.Automated code review
Reviewed commit:
a1b839a58dd34ef263a8e3c78ede35d0a5673acbVerdict: Requires further work
Resolve the blocking or important findings and investigate failed deterministic checks before merging.
Overall assessment
The PR refactors MCP package management by moving in-tree packages to
packages/, standardizing them viacallPackagesignatures, and extractingkarakeep-mcpinto an external flake input. It updates launchers to consume these packages and registers the new input in the auto-update policy.Blocking findings
Missing default values for arguments in mcp-pangolin package (packages/mcp-pangolin/default.nix:1; high confidence)
The diff shows the function signature
{ lib, rustPlatform, fetchFromGitHub, pkg-config, openssl }without default values. The previous version usedpkgs.rustPlatform,pkgs.fetchFromGitHub, etc., which were resolved from thepkgsargument. The newcallPackageusage inflake.nixpasses{ }, relying on Nix's automatic argument resolution. However, ifpkg-configandopensslare not explicitly provided by the caller or available in the global scope (which they are not in a pure evaluation context without being passed), the build will fail with 'undefined variable' errors.Impact: The
mcp-pangolinpackage will fail to build becausepkg-configandopensslare undefined in the function body when called viacallPackagewithout explicit arguments or defaults.Suggested fix: Add default values for these arguments in the function signature, e.g.,
{ lib, rustPlatform ? pkgs.rustPlatform, fetchFromGitHub ? pkgs.fetchFromGitHub, pkg-config ? pkgs.pkg-config, openssl ? pkgs.openssl }, or ensure they are passed explicitly fromflake.nix.Missing default values for arguments in bookstack-mcp package (packages/bookstack-mcp/default.nix:1; high confidence)
The diff shows the function signature
{ lib, buildNpmPackage, fetchFromGitHub }without default values. The previous version usedpkgs.buildNpmPackageandpkgs.fetchFromGitHub. Similar tomcp-pangolin, these are now expected to be resolved automatically or passed explicitly.Impact: The
bookstack-mcppackage will fail to build ifbuildNpmPackageandfetchFromGitHubare not provided by the caller or available in the global scope.Suggested fix: Add default values for these arguments, e.g.,
{ lib, buildNpmPackage ? pkgs.buildNpmPackage, fetchFromGitHub ? pkgs.fetchFromGitHub }, or ensure they are passed explicitly fromflake.nix.Important findings
The diff shows
packages.x86_64-linux.bookstack-mcpandpackages.x86_64-linux.mcp-pangolin. The rest of the flake uses${pkgs.stdenv.hostPlatform.system}or similar dynamic system resolution. This hardcodes the packages tox86_64-linux.Impact: These packages will not be available on other architectures (e.g.,
aarch64-linux), limiting the flake's portability.Suggested fix: Use
${pkgs.stdenv.hostPlatform.system}for the package attribute path to ensure cross-architecture support, or explicitly document that these are x86_64-only.Suggestions
None.
Tests and validation
Questions
mcp-pangolinandbookstack-mcppackage signatures when switching frompkgs.*to direct arguments?karakeep-mcpintended to be exported as a top-level flake package for reuse, or is it strictly an internal dependency?Review limitations
nix buildornix flake checkto verify the actual build success.flake.nixshows changes topackages.x86_64-linux, but I cannot verify if other systems are handled elsewhere in the file.Diff coverage
flake.lock: reviewed — included in a context-limited batchflake.nix: reviewed — included in a context-limited batchlib/auto-update-policy.nix: reviewed — included in a context-limited batchmodules/common/bookstack-mcp-launcher.nix: reviewed — included in a context-limited batchmodules/common/karakeep-mcp-launcher.nix: reviewed — included in a context-limited batchmodules/common/karakeep-mcp-package.nix: reviewed — included in a context-limited batchmodules/common/karakeep-mcp-pnpm-lock.yaml: reviewed — included in a context-limited batchmodules/common/pangolin-mcp-launcher.nix: reviewed — included in a context-limited batchmodules/common/trilium-mcp-package.nix: reviewed — included in a context-limited batchmodules/mcp/karakeep.nix: reviewed — included in a context-limited batchpackages/bookstack-mcp/default.nix: reviewed — included in a context-limited batchpackages/mcp-pangolin/default.nix: reviewed — included in a context-limited batchReview metadata