Skip to content

devenv.yaml

Key Value
allowBroken (deprecated) Allow packages marked as broken. Defaults to false.
allowUnfree (deprecated) Allow unfree packages. Defaults to false.
clean.enabled Clean the environment when entering the shell. Defaults to false.
clean.keep A list of environment variables to keep when cleaning the environment.
imports A list of relative paths or references to inputs to import devenv.nix.
impure Relax the hermeticity of the environment.
inputs Defaults to inputs.nixpkgs.url: github:cachix/devenv-nixpkgs/rolling.
inputs.<name> Identifier name used when passing the input in your devenv.nix function.
inputs.<name>.flake Does the input contain flake.nix or devenv.nix. Defaults to true.
inputs.<name>.overlays A list of overlays to include from the input.
inputs.<name>.url URI specification of the input, see below for possible values.
permittedInsecurePackages (deprecated) A list of insecure permitted packages.
nixpkgs.allowBroken Allow packages marked as broken. Defaults to false.
nixpkgs.allowUnfree Allow unfree packages. Defaults to false.
nixpkgs.cudaCapabilities Select CUDA capabilities for nixpkgs. Defaults to []
nixpkgs.cudaSupport Enable CUDA support for nixpkgs. Defaults to false.
nixpkgs.permittedInsecurePackages A list of insecure permitted packages. Defaults to []
nixpkgs.per-platform.<system>.allowBroken (per-platform) Allow packages marked as broken. Defaults to false.
nixpkgs.per-platform.<system>.allowUnfree (per-platform) Allow unfree packages. Defaults to false.
nixpkgs.per-platform.<system>.cudaCapabilities (per-platform) Select CUDA capabilities for nixpkgs. Defaults to []
nixpkgs.per-platform.<system>.cudaSupport (per-platform) Enable CUDA support for nixpkgs. Defaults to false.
nixpkgs.per-platform.<system>.permittedInsecurePackages (per-platform) Select CUDA capabilities for nixpkgs. Defaults to []

Added in 1.7

  • nixpkgs

Added in 1.0

  • relative file support in imports: ./mymodule.nix
  • clean
  • impure
  • allowBroken

inputs.<name>.url

  • github:NixOS/nixpkgs/master
  • github:NixOS/nixpkgs?rev=238b18d7b2c8239f676358634bfb32693d3706f3
  • github:foo/bar?dir=subdir
  • git+ssh://git@github.com/NixOS/nix?ref=v1.2.3
  • git+https://git.somehost.tld/user/path?ref=branch&rev=fdc8ef970de2b4634e1b3dca296e1ed918459a9e
  • path:/path/to/repo
  • hg+https://...
  • tarball+https://example.com/foobar.tar.gz
  • sourcehut:~misterio/nix-colors/21c1a380a6915d890d408e9f22203436a35bb2de?host=hg.sr.ht
  • file+https://
  • file:///some/absolute/file.tar.gz

An extensive example

allowUnfree: true
allowBroken: true
clean:
  enabled: true
  keep:
    - EDITOR
inputs:
  nixpkgs:
    url: github:cachix/devenv-nixpkgs/rolling
  myproject:
    url: github:owner/myproject
    flake: false
  myproject2:
    url: github:owner/myproject
    overlays:
      - default
imports:
  - ./frontend
  - ./backend
  - ./mymodule.nix
  - myproject
  - myproject/relative/path

Added in 1.0

  • relative file support in imports: ./mymodule.nix

What if a package is out of date?

  • Open nixpkgs repo and press t to search for your package.
  • Try to update/change the package using the nixpkgs contributing guide, optionally contacting the maintainer for help if you get stuck.
  • Make a PR and remember the branch name.
  • Add it to your devenv.yaml using the nixpkgs input in form of 'github:$GH_USERNAME/nixpkgs/master', edit devenv.yaml:
inputs:
  nixpkgs:
    url: 'github:$GH_USERNAME/nixpkgs/MYBRANCH'