Skip to content

Getting Started

Installation

1. Install Nix

sh <(curl -L https://nixos.org/nix/install) --daemon
sh <(curl -L https://nixos.org/nix/install)
sh <(curl -L https://nixos.org/nix/install) --no-daemon
docker run -it nixos/nix

Note

We recommended that you use the experimental installer on macOS to avoid issues with Apple Silicon chips:

curl -L https://raw.githubusercontent.com/NixOS/experimental-nix-installer/main/nix-installer.sh | sh -s install

2. Install devenv

nix-env -iA devenv -f https://github.com/NixOS/nixpkgs/tarball/nixpkgs-unstable
nix profile install --accept-flake-config nixpkgs#devenv
configuration.nix
environment.systemPackages = [ 
  pkgs.devenv
];

Updating

Follow the instructions for an installation above.

Initial set up

Given a Git repository, create the initial structure:

$ devenv init
• Creating .envrc
• Creating devenv.nix
• Creating devenv.yaml
• Creating .gitignore

Commands

  • devenv test builds your developer environment and makes sure that all checks pass. Useful to run in your continuous integration environment.
  • devenv shell activates your developer environment.
  • devenv search <NAME> searches packages matching NAME in Nixpkgs input.
  • devenv update updates and pins inputs from devenv.yaml into devenv.lock.
  • devenv gc deletes unused environments to save disk space.
  • devenv up starts processes.

Learn more