Development environment with nix-shell: Difference between revisions

imported>Amanjeev
m Some grammatical fixes and sentence formations
imported>Ilmu
m Added an example of how to load a local expression (not in pkgs namespace)
Line 24: Line 24:


To be sure that the tools installed on your system will not interfere with the dependencies that you've defined in the shell you can use the <code>--pure</code> option.
To be sure that the tools installed on your system will not interfere with the dependencies that you've defined in the shell you can use the <code>--pure</code> option.
If you'd like to load a local nix expression into a shell you can do it by modifying the earlier example a little bit:
<syntaxHighlight lang=nix>
{ pkgs ? import <nixpkgs> {} }:
pkgs.mkShell {
  buildInputs = [
    (import ./my-expression.nix { inherit pkgs; })
  ];
}
</syntaxHighlight>


== Using Direnv ==
== Using Direnv ==