Inputs allow you to refer to Nix code outside of your project while preserving reproducibility.
Think of inputs as dependency management for your developer environment.
If you omit
devenv.yaml, it defaults to:
The dependencies you mention as
inputs are passed as an argument to the function.
For example, if you have a
devenv.yaml file like:
You can access the stable packages via the
See basics for more about
There are a few special inputs passed into
nixpkgsinput containing all of the available packages for your system.
libis a collection of functions for working with Nix data structures. You can use noogle to search for a function.
configis the final resolved configuration for your developer environment, which you can use to reference any other options set in devenv.nix. Since Nix supports 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 the inputs you're not using.
See devenv.yaml reference for all supported inputs.
Locking and updating inputs
When you run any of the commands,
devenv resolves inputs like
github:NixOS/nixpkgs/nixpkgs-unstable into a commit revision and writes them to
devenv.lock. This ensures that your environment is reproducible.
To update an input to a newer commit, run
devenv update or read the devenv.yaml reference to learn how to pin down the revision/branch at the input level.