Inputs are how devenv manages external Nix dependencies — think of them as dependency management for your developer environment. They let you refer to Nix code outside your project (packages, modules, flakes) while keeping your environment fully reproducible through a lock file.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.
Default inputs
If you omitdevenv.yaml, devenv uses these defaults:
devenv.yaml
- nixpkgs — the curated Nixpkgs snapshot that devenv modules are tested against.
- git-hooks — the
git-hooks.nixlibrary used by devenv’s built-in hooks support.
Adding inputs
Declare inputs indevenv.yaml under the inputs key. Each input needs a url following the Nix Flakes URI format:
devenv.yaml
Adding inputs from the CLI
You can add an input todevenv.yaml without editing the file manually:
Accessing inputs in devenv.nix
Inputs declared indevenv.yaml are passed as arguments to the function in devenv.nix. Use the inputs argument to access them:
devenv.nix
Special built-in arguments
Beyond named inputs, devenv always passes these special arguments intodevenv.nix:
devenv.nix
What do pkgs, lib, and config do?
What do pkgs, lib, and config do?
pkgs— thenixpkgsinput pre-imported for your system, giving you access to all available packages.lib— a collection of helper functions for working with Nix data structures. Search them at noogle.dev.config— the fully resolved configuration for your developer environment. Because Nix uses lazy evaluation, you can reference any option you define in the same file as long as it doesn’t reference itself.
... is a catch-all pattern for any additional inputs, so you can safely omit inputs you’re not using.Supported URI formats
inputs.<name>.url accepts the same URI formats as Nix Flakes. Below are the most common examples.
GitHub
GitLab
Git repositories
Tarballs & local files
hg+https://, hg+ssh://, and sourcehut:~user/repo. For the full URI specification, see the Nix manual.
Following inputs
Inputs can “follow” other inputs by name. This is useful for two scenarios:- Inheriting inputs from another
devenv.yamlor external flake project. - Reducing duplication by sharing one
nixpkgsinstance across multiple inputs.
/ as a separator.
Inherit nixpkgs from another project
devenv.yaml
Reduce repeated downloads
Override a nested input so it reuses your top-levelnixpkgs instead of fetching its own:
devenv.yaml
Locking and updating inputs
When you run any devenv command, inputs likegithub:NixOS/nixpkgs/nixpkgs-unstable are resolved to a specific commit revision and written to devenv.lock. This ensures every team member gets an identical environment.
To update all inputs to their latest revisions:
