devenv supports monorepo layouts where multiple services share common configuration — a database, linting rules, shared packages — while each service also maintains its own specific settings. Shared configuration lives in a singleDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/cachix/devenv/llms.txt
Use this file to discover all available pages before exploring further.
devenv.nix file, and each service imports it by reference so there is no duplication.
Monorepo support via absolute imports was introduced in devenv v1.10.
Directory Structure
A typical monorepo layout looks like this:Shared Configuration
Create ashared/devenv.nix file that contains settings every service should inherit — common packages, a shared database, and project-wide Git hooks:
shared/devenv.nix
Per-Service Configuration
Each service imports the shared config using an absolute import path. Paths starting with/ are resolved from the repository root (where .git is located), so they work regardless of which subdirectory the import appears in.
API Service
services/api/devenv.yaml
services/api/devenv.nix
Frontend Service
services/frontend/devenv.yaml
services/frontend/devenv.nix
Referencing the Repository Root
When a process needs tocd into a specific subdirectory before running, use config.git.root to get the absolute path to the git repository root. This works correctly regardless of which service directory you run devenv from:
services/api/devenv.nix
Working with Individual Services
Enter a service environment
Navigate to the service directory and open the shell:The API service shell includes everything from
shared/devenv.nix (curl, jq, PostgreSQL, Git hooks) merged with its own settings (Node.js 20, API_PORT, SERVICE_NAME).The frontend service inherits the shared configuration in the same way — you get PostgreSQL and the shared packages automatically, plus the frontend-specific scripts.
