Inputs
Inputs allow you to refer to Nix code outside of your project, while preserving reproducibility.
Think of inputs as dependency management of your developer environment.
If you omit devenv.yaml, it defaults to:
inputs:
nixpkgs:
url: github:NixOS/nixpkgs/nixpkgs-unstable
pre-commit-hooks:
url: github:cachix/pre-commit-hooks.nix
Input names like nixpkgs and pre-commit-hooks are identifiers for what
is passsed in the first line of the function:
See basics for more about devenv.nix.
There are a few special inputs passed into devenv.nix:
pkgsis anixpkgsinput containing all of the available packages for your system.libis a collection of functions for working with Nix data structures.configis the resolved configuration for your developer environment, which you can use to reference any other options set indevenv.nix.pre-commit-hookscan be used to set up git hooks.
Note
... 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 it to devenv.lock. This ensures that your environment is reproducible.
To update an input to a newer commit, run devenv update or read devenv.yaml reference to learn how to pin down the revision/branch at the input level.