Skip to main content

Documentation 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.

When working across multiple separate repositories you may want one devenv project to consume configuration, packages, or outputs that are defined in another. devenv supports two complementary patterns: composing entire environments via imports and referencing specific config values across inputs without merging everything.
The remote repository must use devenv.nix only. The devenv.yaml of imported projects is not evaluated. See #2205 for details.

Example Remote Repository

Both patterns below reference a shared myorg/my-service repository with the following devenv.nix:
my-service/devenv.nix
{ config, ... }: {
  languages.python.enable = true;

  outputs.my-service = config.languages.python.import ./. {};

  processes.my-service.exec = "${config.outputs.my-service}/bin/my-service";
}

Pattern 1: Composing with Imports

The simplest approach — add the remote repository as a named input and then list it under imports. All of its configuration (packages, services, outputs, env, processes, etc.) merges into your environment.
devenv.yaml
inputs:
  my-service:
    url: github:myorg/my-service
imports:
  - my-service
Because my-service’s outputs and processes are merged into your environment, you can reference them directly in your own devenv.nix:
devenv.nix
{ config, ... }: {
  # my-service's output is now available in config.outputs
  packages = [ config.outputs.my-service ];

  # my-service's process is also merged, so `devenv up` starts it automatically
}
For local cross-project imports within the same repository, see the Monorepo guide.

Pattern 2: Referencing Config Across Inputs

Cross-input config references were introduced in devenv v2.0.
When you only need specific values from another project — such as a built package — and do not want to merge its entire environment, reference the remote project’s evaluated config through inputs.<name>.devenv.config. Set flake: false on the input to treat it as a plain source rather than a flake:
devenv.yaml
inputs:
  my-service:
    url: github:myorg/my-service
    flake: false
Then access the remote project’s outputs directly in your devenv.nix:
devenv.nix
{ inputs, ... }: {
  packages = [
    inputs.my-service.devenv.config.outputs.my-service
  ];

  processes.my-service.exec = "${inputs.my-service.devenv.config.outputs.my-service}/bin/my-service";
}
Profiles do not work with cross-project references. See #2521 for details.

Choosing Between the Two Patterns

Composing with importsReferencing config across inputs
Merges remote environment (packages, services, env)✅ Yes❌ No
Access specific outputs only✅ Possible✅ Designed for this
Remote devenv.yaml evaluated❌ No❌ No
Works with Profiles✅ Yes❌ No
Introduced in versionInitial releasev2.0
Use imports when you want to inherit an entire environment as a base. Use config references when you only need a package or a specific configuration value from the remote project.

Build docs developers (and LLMs) love