2020-12-25 13:55:36 +00:00
|
|
|
# pkgs.mkShell {#sec-pkgs-mkShell}
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
`pkgs.mkShell` is a special kind of derivation that is only useful when using
|
|
|
|
it combined with `nix-shell`. It will in fact fail to instantiate when invoked
|
|
|
|
with `nix-build`.
|
2020-12-25 13:55:36 +00:00
|
|
|
|
|
|
|
## Usage {#sec-pkgs-mkShell-usage}
|
|
|
|
|
|
|
|
```nix
|
|
|
|
{ pkgs ? import <nixpkgs> {} }:
|
|
|
|
pkgs.mkShell {
|
2021-05-20 23:08:51 +00:00
|
|
|
# specify which packages to add to the shell environment
|
|
|
|
packages = [ pkgs.gnumake ];
|
|
|
|
# add all the dependencies, of the given packages, to the shell environment
|
2020-12-25 13:55:36 +00:00
|
|
|
inputsFrom = with pkgs; [ hello gnutar ];
|
|
|
|
}
|
|
|
|
```
|