nixpkgs/doc/functions/shell.xml

27 lines
834 B
XML
Raw Normal View History

2018-10-02 18:16:27 +00:00
<section xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xi="http://www.w3.org/2001/XInclude"
xml:id="sec-pkgs-mkShell">
2018-10-02 19:59:59 +00:00
<title>pkgs.mkShell</title>
2018-10-02 18:16:27 +00:00
2018-10-02 19:59:59 +00:00
<para>
<function>pkgs.mkShell</function> is a special kind of derivation that is
only useful when using it combined with <command>nix-shell</command>. It will
in fact fail to instantiate when invoked with <command>nix-build</command>.
</para>
2018-10-02 18:16:27 +00:00
2018-10-02 19:59:59 +00:00
<section xml:id="sec-pkgs-mkShell-usage">
<title>Usage</title>
2018-10-02 18:16:27 +00:00
2018-10-02 19:59:59 +00:00
<programlisting><![CDATA[
2018-10-02 18:16:27 +00:00
{ pkgs ? import <nixpkgs> {} }:
pkgs.mkShell {
# this will make all the build inputs from hello and gnutar
# available to the shell environment
inputsFrom = with pkgs; [ hello gnutar ];
buildInputs = [ pkgs.gnumake ];
}
]]></programlisting>
2018-10-02 19:59:59 +00:00
</section>
2018-10-02 18:16:27 +00:00
</section>