doc: Use prompt more often
This commit is contained in:
@@ -921,7 +921,7 @@ src = fetchFromGitHub {
|
||||
<para>
|
||||
You can convert between formats with nix-hash, for example:
|
||||
<screen>
|
||||
$ nix-hash --type sha256 --to-base32 <replaceable>HASH</replaceable>
|
||||
<prompt>$ </prompt>nix-hash --type sha256 --to-base32 <replaceable>HASH</replaceable>
|
||||
</screen>
|
||||
</para>
|
||||
</listitem>
|
||||
@@ -1038,7 +1038,7 @@ patches = [ ./0001-changes.patch ];
|
||||
<para>
|
||||
Move to the root directory of the source code you're patching.
|
||||
<screen>
|
||||
$ cd the/program/source</screen>
|
||||
<prompt>$ </prompt>cd the/program/source</screen>
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
@@ -1046,8 +1046,8 @@ $ cd the/program/source</screen>
|
||||
If a git repository is not already present, create one and stage all of
|
||||
the source files.
|
||||
<screen>
|
||||
$ git init
|
||||
$ git add .</screen>
|
||||
<prompt>$ </prompt>git init
|
||||
<prompt>$ </prompt>git add .</screen>
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
@@ -1060,7 +1060,7 @@ $ git add .</screen>
|
||||
<para>
|
||||
Use git to create a diff, and pipe the output to a patch file:
|
||||
<screen>
|
||||
$ git diff > nixpkgs/pkgs/the/package/0001-changes.patch</screen>
|
||||
<prompt>$ </prompt>git diff > nixpkgs/pkgs/the/package/0001-changes.patch</screen>
|
||||
</para>
|
||||
</listitem>
|
||||
</orderedlist>
|
||||
|
||||
@@ -480,9 +480,9 @@ pullImage {
|
||||
<literal>nix-prefetch-docker</literal> command can be used to get required
|
||||
image parameters:
|
||||
|
||||
<programlisting>
|
||||
$ nix run nixpkgs.nix-prefetch-docker -c nix-prefetch-docker --image-name mysql --image-tag 5
|
||||
</programlisting>
|
||||
<screen>
|
||||
<prompt>$ </prompt>nix run nixpkgs.nix-prefetch-docker -c nix-prefetch-docker --image-name mysql --image-tag 5
|
||||
</screen>
|
||||
|
||||
Since a given <varname>imageName</varname> may transparently refer to a
|
||||
manifest list of images which support multiple architectures and/or
|
||||
@@ -491,17 +491,17 @@ $ nix run nixpkgs.nix-prefetch-docker -c nix-prefetch-docker --image-name mysql
|
||||
By default it will match the OS and architecture of the host the command is
|
||||
run on.
|
||||
|
||||
<programlisting>
|
||||
$ nix-prefetch-docker --image-name mysql --image-tag 5 --arch x86_64 --os linux
|
||||
</programlisting>
|
||||
<screen>
|
||||
<prompt>$ </prompt>nix-prefetch-docker --image-name mysql --image-tag 5 --arch x86_64 --os linux
|
||||
</screen>
|
||||
|
||||
Desired image name and tag can be set using
|
||||
<option>--final-image-name</option> and <option>--final-image-tag</option>
|
||||
arguments:
|
||||
|
||||
<programlisting>
|
||||
$ nix-prefetch-docker --image-name mysql --image-tag 5 --final-image-name eu.gcr.io/my-project/mysql --final-image-tag prod
|
||||
</programlisting>
|
||||
<screen>
|
||||
<prompt>$ </prompt>nix-prefetch-docker --image-name mysql --image-tag 5 --final-image-name eu.gcr.io/my-project/mysql --final-image-tag prod
|
||||
</screen>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
|
||||
@@ -131,8 +131,8 @@
|
||||
in <literal>beamPackages</literal>, use the following command:
|
||||
</para>
|
||||
|
||||
<programlisting>
|
||||
$ nix-env -f "<nixpkgs>" -qaP -A beamPackages
|
||||
<screen>
|
||||
<prompt>$ </prompt>nix-env -f "<nixpkgs>" -qaP -A beamPackages
|
||||
beamPackages.esqlite esqlite-0.2.1
|
||||
beamPackages.goldrush goldrush-0.1.7
|
||||
beamPackages.ibrowse ibrowse-4.2.2
|
||||
@@ -140,16 +140,16 @@ beamPackages.jiffy jiffy-0.14.5
|
||||
beamPackages.lager lager-3.0.2
|
||||
beamPackages.meck meck-0.8.3
|
||||
beamPackages.rebar3-pc pc-1.1.0
|
||||
</programlisting>
|
||||
</screen>
|
||||
|
||||
<para>
|
||||
To install any of those packages into your profile, refer to them by their
|
||||
attribute path (first column):
|
||||
</para>
|
||||
|
||||
<programlisting>
|
||||
$ nix-env -f "<nixpkgs>" -iA beamPackages.ibrowse
|
||||
</programlisting>
|
||||
<screen>
|
||||
<prompt>$ </prompt>nix-env -f "<nixpkgs>" -iA beamPackages.ibrowse
|
||||
</screen>
|
||||
|
||||
<para>
|
||||
The attribute path of any BEAM package corresponds to the name of that
|
||||
|
||||
@@ -47,13 +47,13 @@ foo = import ../path/to/foo.nix {
|
||||
in <filename>all-packages.nix</filename>. You can test building a Perl
|
||||
package as follows:
|
||||
<screen>
|
||||
$ nix-build -A perlPackages.ClassC3
|
||||
<prompt>$ </prompt>nix-build -A perlPackages.ClassC3
|
||||
</screen>
|
||||
<varname>buildPerlPackage</varname> adds <literal>perl-</literal> to the
|
||||
start of the name attribute, so the package above is actually called
|
||||
<literal>perl-Class-C3-0.21</literal>. So to install it, you can say:
|
||||
<screen>
|
||||
$ nix-env -i perl-Class-C3
|
||||
<prompt>$ </prompt>nix-env -i perl-Class-C3
|
||||
</screen>
|
||||
(Of course you can also install using the attribute name: <literal>nix-env -i
|
||||
-A perlPackages.ClassC3</literal>.)
|
||||
@@ -148,7 +148,7 @@ ClassC3Componentised = buildPerlPackage rec {
|
||||
</para>
|
||||
|
||||
<screen>
|
||||
$ nix-env -i nix-generate-from-cpan
|
||||
<prompt>$ </prompt>nix-env -i nix-generate-from-cpan
|
||||
</screen>
|
||||
|
||||
<para>
|
||||
@@ -156,7 +156,7 @@ $ nix-env -i nix-generate-from-cpan
|
||||
unpacks the corresponding package, and prints a Nix expression on standard
|
||||
output. For example:
|
||||
<screen>
|
||||
$ nix-generate-from-cpan XML::Simple
|
||||
<prompt>$ </prompt>nix-generate-from-cpan XML::Simple
|
||||
XMLSimple = buildPerlPackage rec {
|
||||
name = "XML-Simple-2.22";
|
||||
src = fetchurl {
|
||||
|
||||
+2
-2
@@ -30,7 +30,7 @@ meta = with stdenv.lib; {
|
||||
The meta-attributes of a package can be queried from the command-line using
|
||||
<command>nix-env</command>:
|
||||
<screen>
|
||||
$ nix-env -qa hello --json
|
||||
<prompt>$ </prompt>nix-env -qa hello --json
|
||||
{
|
||||
"hello": {
|
||||
"meta": {
|
||||
@@ -70,7 +70,7 @@ $ nix-env -qa hello --json
|
||||
<command>nix-env</command> knows about the <varname>description</varname>
|
||||
field specifically:
|
||||
<screen>
|
||||
$ nix-env -qa hello --description
|
||||
<prompt>$ </prompt>nix-env -qa hello --description
|
||||
hello-2.3 A program that produces a familiar, friendly greeting
|
||||
</screen>
|
||||
</para>
|
||||
|
||||
@@ -92,9 +92,9 @@ modulesTree = [kernel]
|
||||
<para>
|
||||
If needed you can also run <literal>make menuconfig</literal>:
|
||||
<screen>
|
||||
$ nix-env -i ncurses
|
||||
$ export NIX_CFLAGS_LINK=-lncurses
|
||||
$ make menuconfig ARCH=<replaceable>arch</replaceable></screen>
|
||||
<prompt>$ </prompt>nix-env -i ncurses
|
||||
<prompt>$ </prompt>export NIX_CFLAGS_LINK=-lncurses
|
||||
<prompt>$ </prompt>make menuconfig ARCH=<replaceable>arch</replaceable></screen>
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
@@ -142,8 +142,8 @@ $ make menuconfig ARCH=<replaceable>arch</replaceable></screen>
|
||||
<para>
|
||||
The generator is invoked as follows:
|
||||
<screen>
|
||||
$ cd pkgs/servers/x11/xorg
|
||||
$ cat tarballs-7.5.list extra.list old.list \
|
||||
<prompt>$ </prompt>cd pkgs/servers/x11/xorg
|
||||
<prompt>$ </prompt>cat tarballs-7.5.list extra.list old.list \
|
||||
| perl ./generate-expr-from-tarballs.pl
|
||||
</screen>
|
||||
For each of the tarballs in the <filename>.list</filename> files, the script
|
||||
@@ -160,8 +160,8 @@ $ cat tarballs-7.5.list extra.list old.list \
|
||||
A file like <filename>tarballs-7.5.list</filename> contains all tarballs in
|
||||
a X.org release. It can be generated like this:
|
||||
<screen>
|
||||
$ export i="mirror://xorg/X11R7.4/src/everything/"
|
||||
$ cat $(PRINT_PATH=1 nix-prefetch-url $i | tail -n 1) \
|
||||
<prompt>$ </prompt>export i="mirror://xorg/X11R7.4/src/everything/"
|
||||
<prompt>$ </prompt>cat $(PRINT_PATH=1 nix-prefetch-url $i | tail -n 1) \
|
||||
| perl -e 'while (<>) { if (/(href|HREF)="([^"]*.bz2)"/) { print "$ENV{'i'}$2\n"; }; }' \
|
||||
| sort > tarballs-7.4.list
|
||||
</screen>
|
||||
@@ -210,7 +210,7 @@ $ cat $(PRINT_PATH=1 nix-prefetch-url $i | tail -n 1) \
|
||||
often available. It is possible to list available Eclipse packages by
|
||||
issuing the command:
|
||||
<screen>
|
||||
$ nix-env -f '<nixpkgs>' -qaP -A eclipses --description
|
||||
<prompt>$ </prompt>nix-env -f '<nixpkgs>' -qaP -A eclipses --description
|
||||
</screen>
|
||||
Once an Eclipse variant is installed it can be run using the
|
||||
<command>eclipse</command> command, as expected. From within Eclipse it is
|
||||
@@ -250,7 +250,7 @@ packageOverrides = pkgs: {
|
||||
available for installation using <varname>eclipseWithPlugins</varname> by
|
||||
running
|
||||
<screen>
|
||||
$ nix-env -f '<nixpkgs>' -qaP -A eclipses.plugins --description
|
||||
<prompt>$ </prompt>nix-env -f '<nixpkgs>' -qaP -A eclipses.plugins --description
|
||||
</screen>
|
||||
</para>
|
||||
|
||||
|
||||
+8
-8
@@ -9,8 +9,8 @@
|
||||
<para>
|
||||
Checkout the Nixpkgs source tree:
|
||||
<screen>
|
||||
$ git clone https://github.com/NixOS/nixpkgs
|
||||
$ cd nixpkgs</screen>
|
||||
<prompt>$ </prompt>git clone https://github.com/NixOS/nixpkgs
|
||||
<prompt>$ </prompt>cd nixpkgs</screen>
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
@@ -23,7 +23,7 @@ $ cd nixpkgs</screen>
|
||||
See <xref linkend="sec-organisation" /> for some hints on the tree
|
||||
organisation. Create a directory for your package, e.g.
|
||||
<screen>
|
||||
$ mkdir pkgs/development/libraries/libfoo</screen>
|
||||
<prompt>$ </prompt>mkdir pkgs/development/libraries/libfoo</screen>
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
@@ -34,8 +34,8 @@ $ mkdir pkgs/development/libraries/libfoo</screen>
|
||||
as arguments, and returns a build of the package in the Nix store. The
|
||||
expression should usually be called <filename>default.nix</filename>.
|
||||
<screen>
|
||||
$ emacs pkgs/development/libraries/libfoo/default.nix
|
||||
$ git add pkgs/development/libraries/libfoo/default.nix</screen>
|
||||
<prompt>$ </prompt>emacs pkgs/development/libraries/libfoo/default.nix
|
||||
<prompt>$ </prompt>git add pkgs/development/libraries/libfoo/default.nix</screen>
|
||||
</para>
|
||||
<para>
|
||||
You can have a look at the existing Nix expressions under
|
||||
@@ -180,7 +180,7 @@ $ git add pkgs/development/libraries/libfoo/default.nix</screen>
|
||||
with some descriptive name for the variable, e.g.
|
||||
<varname>libfoo</varname>.
|
||||
<screen>
|
||||
$ emacs pkgs/top-level/all-packages.nix</screen>
|
||||
<prompt>$ </prompt>emacs pkgs/top-level/all-packages.nix</screen>
|
||||
</para>
|
||||
<para>
|
||||
The attributes in that file are sorted by category (like “Development /
|
||||
@@ -193,7 +193,7 @@ $ emacs pkgs/top-level/all-packages.nix</screen>
|
||||
To test whether the package builds, run the following command from the
|
||||
root of the nixpkgs source tree:
|
||||
<screen>
|
||||
$ nix-build -A libfoo</screen>
|
||||
<prompt>$ </prompt>nix-build -A libfoo</screen>
|
||||
where <varname>libfoo</varname> should be the variable name defined in the
|
||||
previous step. You may want to add the flag <option>-K</option> to keep
|
||||
the temporary build directory in case something fails. If the build
|
||||
@@ -205,7 +205,7 @@ $ nix-build -A libfoo</screen>
|
||||
<para>
|
||||
If you want to install the package into your profile (optional), do
|
||||
<screen>
|
||||
$ nix-env -f . -iA libfoo</screen>
|
||||
<prompt>$ </prompt>nix-env -f . -iA libfoo</screen>
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
|
||||
@@ -153,11 +153,11 @@
|
||||
nixpkgs-unstable for easier review by running the following commands
|
||||
from a nixpkgs clone.
|
||||
<screen>
|
||||
$ git remote add channels https://github.com/NixOS/nixpkgs-channels.git <co
|
||||
<prompt>$ </prompt>git remote add channels https://github.com/NixOS/nixpkgs-channels.git <co
|
||||
xml:id='reviewing-rebase-1' />
|
||||
$ git fetch channels nixos-unstable <co xml:id='reviewing-rebase-2' />
|
||||
$ git fetch origin pull/PRNUMBER/head <co xml:id='reviewing-rebase-3' />
|
||||
$ git rebase --onto nixos-unstable BASEBRANCH FETCH_HEAD <co
|
||||
<prompt>$ </prompt>git fetch channels nixos-unstable <co xml:id='reviewing-rebase-2' />
|
||||
<prompt>$ </prompt>git fetch origin pull/PRNUMBER/head <co xml:id='reviewing-rebase-3' />
|
||||
<prompt>$ </prompt>git rebase --onto nixos-unstable BASEBRANCH FETCH_HEAD <co
|
||||
xml:id='reviewing-rebase-4' />
|
||||
</screen>
|
||||
<calloutlist>
|
||||
@@ -197,7 +197,7 @@ $ git rebase --onto nixos-unstable BASEBRANCH FETCH_HEAD <co
|
||||
request url.
|
||||
</para>
|
||||
<screen>
|
||||
$ nix-shell -p nix-review --run "nix-review pr PRNUMBER"
|
||||
<prompt>$ </prompt>nix-shell -p nix-review --run "nix-review pr PRNUMBER"
|
||||
</screen>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
|
||||
@@ -36,8 +36,8 @@
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
<screen>
|
||||
$ git checkout 0998212
|
||||
$ git checkout -b 'fix/pkg-name-update'
|
||||
<prompt>$ </prompt>git checkout 0998212
|
||||
<prompt>$ </prompt>git checkout -b 'fix/pkg-name-update'
|
||||
</screen>
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
Reference in New Issue
Block a user