git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #98503 from jtojnar/doc-prompts
commit6d518ddf7720e55e9a85a4d2ac46a1e65529496e authorJan Tojnar <jtojnar@gmail.com> dateThu 24 Sep 2020, 22:48 (6 years ago) parentf32bc5ce6ce041
34 files changed+267−255
doc/builders/images/dockertools.xml+6−6 doc/builders/images/ocitools.xml+1−2 doc/builders/packages/citrix.xml+4−4 doc/builders/packages/urxvt.xml+32−18 doc/contributing/submitting-changes.xml+6−6 doc/languages-frameworks/beam.xml+3−3 doc/languages-frameworks/perl.xml+99−99 doc/languages-frameworks/qt.xml+1−1 doc/languages-frameworks/ruby.xml+12−13 doc/languages-frameworks/texlive.xml+5−5 doc/stdenv/multiple-output.xml+1−1 doc/using/configuration.xml+4−4 doc/using/overlays.xml+5−5 nixos/doc/manual/administration/imperative-containers.xml+16−16 nixos/doc/manual/administration/maintenance-mode.xml+1−1 nixos/doc/manual/administration/network-problems.xml+2−2 nixos/doc/manual/administration/rebooting.xml+3−3 nixos/doc/manual/administration/rollback.xml+3−3 nixos/doc/manual/administration/service-mgmt.xml+3−3 nixos/doc/manual/administration/user-sessions.xml+1−1 nixos/doc/manual/configuration/adding-custom-packages.xml+1−1 nixos/doc/manual/configuration/linux-kernel.xml+8−8 nixos/doc/manual/configuration/luks-file-systems.xml+10−10 nixos/doc/manual/configuration/user-mgmt.xml+4−4 nixos/doc/manual/configuration/x-windows.xml+1−1 nixos/doc/manual/development/meta-attributes.xml+1−1 nixos/doc/manual/development/writing-documentation.xml+2−2 nixos/doc/manual/installation/installing-behind-a-proxy.xml+7−7 nixos/doc/manual/installation/installing-from-other-distro.xml+8−8 nixos/doc/manual/installation/upgrading.xml+6−6 nixos/doc/manual/man-nixos-enter.xml+2−2 nixos/doc/manual/man-nixos-version.xml+2−2 nixos/modules/services/backup/borgbackup.xml+4−4 nixos/modules/system/activation/top-level.nix+3−3
doc/builders/images/dockertools.xml+6−6
@@ -132,11 +132,11 @@ buildImage {
132132 <para>
133133 By default <function>buildImage</function> will use a static date of one second past the UNIX Epoch. This allows <function>buildImage</function> to produce binary reproducible images. When listing images with <command>docker images</command>, the newly created images will be listed like this:
134134 </para>
135−<screen><![CDATA[
136−$ docker images
135+<screen>
136+<prompt>$ </prompt>docker images
137137REPOSITORY TAG IMAGE ID CREATED SIZE
138138hello latest 08c791c7846e 48 years ago 25.2MB
139−]]></screen>
139+</screen>
140140 <para>
141141 You can break binary reproducibility but have a sorted, meaningful <literal>CREATED</literal> column by setting <literal>created</literal> to <literal>now</literal>.
142142 </para>
@@ -152,11 +152,11 @@ pkgs.dockerTools.buildImage {
152152]]></programlisting>
153153 <para>
154154 and now the Docker CLI will display a reasonable date and sort the images as expected:
155−<screen><![CDATA[
156−$ docker images
155+<screen>
156+<prompt>$ </prompt>docker images
157157REPOSITORY TAG IMAGE ID CREATED SIZE
158158hello latest de2bf4786de6 About a minute ago 25.2MB
159−]]></screen>
159+</screen>
160160 however, the produced images will not be binary reproducible.
161161 </para>
162162 </example>
doc/builders/images/ocitools.xml+1−2
@@ -38,8 +38,7 @@ buildContainer {
3838
3939 readonly = false; <co xml:id='ex-ociTools-buildContainer-3' />
4040}
41−
42− </programlisting>
41+</programlisting>
4342 <calloutlist>
4443 <callout arearefs='ex-ociTools-buildContainer-1'>
4544 <para>
doc/builders/packages/citrix.xml+4−4
@@ -22,10 +22,10 @@
2222 </para>
2323 <para>
2424 In order to set this up, you first have to <link xlink:href="https://its.uiowa.edu/support/article/102186">download the <literal>.cr</literal> file from the Netscaler Gateway</link>. After that you can configure the <command>selfservice</command> like this:
25− <screen>
26− <prompt>$ </prompt>storebrowse -C ~/Downloads/receiverconfig.cr
27− <prompt>$ </prompt>selfservice
28− </screen>
25+<screen>
26+<prompt>$ </prompt>storebrowse -C ~/Downloads/receiverconfig.cr
27+<prompt>$ </prompt>selfservice
28+</screen>
2929 </para>
3030 </section>
3131
doc/builders/packages/urxvt.xml+32−18
@@ -18,10 +18,13 @@
1818 includes all available plugins. To make use of this functionality, use an
1919 overlay or directly install an expression that overrides its configuration,
2020 such as
21− <programlisting>rxvt-unicode.override { configure = { availablePlugins, ... }: {
21+<programlisting>
22+rxvt-unicode.override {
23+ configure = { availablePlugins, ... }: {
2224 plugins = with availablePlugins; [ perls resize-font vtwheel ];
23− }
24−}</programlisting>
25+ };
26+}
27+</programlisting>
2528 If the <literal>configure</literal> function returns an attrset without the
2629 <literal>plugins</literal> attribute, <literal>availablePlugins</literal>
2730 will be used automatically.
@@ -30,18 +33,22 @@
3033 <para>
3134 In order to add plugins but also keep all default plugins installed, it is
3235 possible to use the following method:
33− <programlisting>rxvt-unicode.override { configure = { availablePlugins, ... }: {
34− plugins = (builtins.attrValues availablePlugins) ++ [ custom-plugin ];
35− };
36−}</programlisting>
36+<programlisting>
37+rxvt-unicode.override {
38+ configure = { availablePlugins, ... }: {
39+ plugins = (builtins.attrValues availablePlugins) ++ [ custom-plugin ];
40+ };
41+}
42+</programlisting>
3743 </para>
3844
3945 <para>
4046 To get a list of all the plugins available, open the Nix REPL and run
41− <programlisting>$ nix repl
47+<screen>
48+<prompt>$ </prompt>nix repl
4249:l &lt;nixpkgs&gt;
4350map (p: p.name) pkgs.rxvt-unicode.plugins
44− </programlisting>
51+</screen>
4552 Alternatively, if your shell is bash or zsh and have completion enabled,
4653 simply type <literal>nixpkgs.rxvt-unicode.plugins.&lt;tab&gt;</literal>.
4754 </para>
@@ -53,18 +60,24 @@ map (p: p.name) pkgs.rxvt-unicode.plugins
5360 <literal>extraDeps</literal> can be used, for example, to provide
5461 <literal>xsel</literal> (a clipboard manager) to the clipboard plugin,
5562 without installing it globally:
56− <programlisting>rxvt-unicode.override { configure = { availablePlugins, ... }: {
57− pluginsDeps = [ xsel ];
58− }
59−}</programlisting>
63+<programlisting>
64+rxvt-unicode.override {
65+ configure = { availablePlugins, ... }: {
66+ pluginsDeps = [ xsel ];
67+ };
68+}
69+</programlisting>
6070
6171 <literal>perlDeps</literal> is a handy way to provide Perl packages to
6272 your custom plugins (in <literal>$HOME/.urxvt/ext</literal>). For example,
6373 if you need <literal>AnyEvent</literal> you can do:
64− <programlisting>rxvt-unicode.override { configure = { availablePlugins, ... }: {
65− perlDeps = with perlPackages; [ AnyEvent ];
66− }
67−}</programlisting>
74+<programlisting>
75+rxvt-unicode.override {
76+ configure = { availablePlugins, ... }: {
77+ perlDeps = with perlPackages; [ AnyEvent ];
78+ };
79+}
80+</programlisting>
6881 </para>
6982
7083 </section>
@@ -90,7 +103,8 @@ map (p: p.name) pkgs.rxvt-unicode.plugins
90103 <para>
91104 If the plugin is itself a perl package that needs to be imported from
92105 other plugins or scripts, add the following passthrough:
93− <programlisting>passthru.perlPackages = [ "self" ];
106+<programlisting>
107+passthru.perlPackages = [ "self" ];
94108</programlisting>
95109 This will make the urxvt wrapper pick up the dependency and set up the perl
96110 path accordingly.
doc/contributing/submitting-changes.xml+6−6
@@ -209,12 +209,12 @@ Additional information.
209209 </para>
210210
211211<programlisting>
212− (fetchpatch {
213− name = "CVE-2019-11068.patch";
214− url = "https://gitlab.gnome.org/GNOME/libxslt/commit/e03553605b45c88f0b4b2980adfbbb8f6fca2fd6.patch";
215− sha256 = "0pkpb4837km15zgg6h57bncp66d5lwrlvkr73h0lanywq7zrwhj8";
216− })
217− </programlisting>
212+(fetchpatch {
213+ name = "CVE-2019-11068.patch";
214+ url = "https://gitlab.gnome.org/GNOME/libxslt/commit/e03553605b45c88f0b4b2980adfbbb8f6fca2fd6.patch";
215+ sha256 = "0pkpb4837km15zgg6h57bncp66d5lwrlvkr73h0lanywq7zrwhj8";
216+})
217+</programlisting>
218218
219219 <para>
220220 If a security fix applies to both master and a stable release then, similar to regular changes, they are preferably delivered via master first and cherry-picked to the release branch.
doc/languages-frameworks/beam.xml+3−3
@@ -72,9 +72,9 @@
7272 To install any of those builders into your profile, refer to them by their attribute path <literal>beamPackages.rebar3</literal>:
7373 </para>
7474
75− <screen>
76− <prompt>$ </prompt>nix-env -f &quot;&lt;nixpkgs&gt;&quot; -iA beamPackages.rebar3
77− </screen>
75+<screen>
76+<prompt>$ </prompt>nix-env -f &quot;&lt;nixpkgs&gt;&quot; -iA beamPackages.rebar3
77+</screen>
7878</section>
7979
8080 <section xml:id="packaging-beam-applications">
doc/languages-frameworks/perl.xml+99−99
@@ -8,28 +8,28 @@
88
99 <para>
1010 When executing a Perl script, it is possible you get an error such as <literal>./myscript.pl: bad interpreter: /usr/bin/perl: no such file or directory</literal>. This happens when the script expects Perl to be installed at <filename>/usr/bin/perl</filename>, which is not the case when using Perl from nixpkgs. You can fix the script by changing the first line to:
11− <programlisting>
12− #!/usr/bin/env perl
13− </programlisting>
11+<programlisting>
12+#!/usr/bin/env perl
13+</programlisting>
1414 to take the Perl installation from the <literal>PATH</literal> environment variable, or invoke Perl directly with:
15− <screen>
16− <prompt>$ </prompt>perl ./myscript.pl
17− </screen>
15+<screen>
16+<prompt>$ </prompt>perl ./myscript.pl
17+</screen>
1818 </para>
1919
2020 <para>
2121 When the script is using a Perl library that is not installed globally, you might get an error such as <literal>Can't locate DB_File.pm in @INC (you may need to install the DB_File module)</literal>. In that case, you can use <command>nix-shell</command> to start an ad-hoc shell with that library installed, for instance:
22− <screen>
23− <prompt>$ </prompt>nix-shell -p perl perlPackages.DBFile --run ./myscript.pl
24− </screen>
22+<screen>
23+<prompt>$ </prompt>nix-shell -p perl perlPackages.DBFile --run ./myscript.pl
24+</screen>
2525 </para>
2626
2727 <para>
2828 If you are always using the script in places where <command>nix-shell</command> is available, you can embed the <command>nix-shell</command> invocation in the shebang like this:
29− <programlisting>
30− #!/usr/bin/env nix-shell
31− #! nix-shell -i perl -p perl perlPackages.DBFile
32− </programlisting>
29+<programlisting>
30+#!/usr/bin/env nix-shell
31+#! nix-shell -i perl -p perl perlPackages.DBFile
32+</programlisting>
3333 </para>
3434 </section>
3535
@@ -44,30 +44,30 @@
4444 <para>
4545 Perl packages from CPAN are defined in <link
4646 xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/top-level/perl-packages.nix"><filename>pkgs/top-level/perl-packages.nix</filename></link>, rather than <filename>pkgs/all-packages.nix</filename>. Most Perl packages are so straight-forward to build that they are defined here directly, rather than having a separate function for each package called from <filename>perl-packages.nix</filename>. However, more complicated packages should be put in a separate file, typically in <filename>pkgs/development/perl-modules</filename>. Here is an example of the former:
47− <programlisting>
48− ClassC3 = buildPerlPackage rec {
49− name = "Class-C3-0.21";
50− src = fetchurl {
51− url = "mirror://cpan/authors/id/F/FL/FLORA/${name}.tar.gz";
52− sha256 = "1bl8z095y4js66pwxnm7s853pi9czala4sqc743fdlnk27kq94gz";
53− };
54− };
55− </programlisting>
47+<programlisting>
48+ClassC3 = buildPerlPackage rec {
49+ name = "Class-C3-0.21";
50+ src = fetchurl {
51+ url = "mirror://cpan/authors/id/F/FL/FLORA/${name}.tar.gz";
52+ sha256 = "1bl8z095y4js66pwxnm7s853pi9czala4sqc743fdlnk27kq94gz";
53+ };
54+};
55+</programlisting>
5656 Note the use of <literal>mirror://cpan/</literal>, and the <literal>${name}</literal> in the URL definition to ensure that the name attribute is consistent with the source that we’re actually downloading. Perl packages are made available in <filename>all-packages.nix</filename> through the variable <varname>perlPackages</varname>. For instance, if you have a package that needs <varname>ClassC3</varname>, you would typically write
57− <programlisting>
58− foo = import ../path/to/foo.nix {
59− inherit stdenv fetchurl ...;
60− inherit (perlPackages) ClassC3;
61− };
62− </programlisting>
57+<programlisting>
58+foo = import ../path/to/foo.nix {
59+ inherit stdenv fetchurl ...;
60+ inherit (perlPackages) ClassC3;
61+};
62+</programlisting>
6363 in <filename>all-packages.nix</filename>. You can test building a Perl package as follows:
64− <screen>
65− <prompt>$ </prompt>nix-build -A perlPackages.ClassC3
66− </screen>
64+<screen>
65+<prompt>$ </prompt>nix-build -A perlPackages.ClassC3
66+</screen>
6767 <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:
68− <screen>
69− <prompt>$ </prompt>nix-env -i perl-Class-C3
70− </screen>
68+<screen>
69+<prompt>$ </prompt>nix-env -i perl-Class-C3
70+</screen>
7171 (Of course you can also install using the attribute name: <literal>nix-env -i -A perlPackages.ClassC3</literal>.)
7272 </para>
7373
@@ -94,61 +94,61 @@
9494
9595 <para>
9696 <varname>buildPerlPackage</varname> is built on top of <varname>stdenv</varname>, so everything can be customised in the usual way. For instance, the <literal>BerkeleyDB</literal> module has a <varname>preConfigure</varname> hook to generate a configuration file used by <filename>Makefile.PL</filename>:
97− <programlisting>
98− { buildPerlPackage, fetchurl, db }:
99−
100− buildPerlPackage rec {
101− name = "BerkeleyDB-0.36";
102−
103− src = fetchurl {
104− url = "mirror://cpan/authors/id/P/PM/PMQS/${name}.tar.gz";
105− sha256 = "07xf50riarb60l1h6m2dqmql8q5dij619712fsgw7ach04d8g3z1";
106− };
107−
108− preConfigure = ''
109− echo "LIB = ${db.out}/lib" > config.in
110− echo "INCLUDE = ${db.dev}/include" >> config.in
111− '';
112− }
113− </programlisting>
97+<programlisting>
98+{ buildPerlPackage, fetchurl, db }:
99+
100+buildPerlPackage rec {
101+ name = "BerkeleyDB-0.36";
102+
103+ src = fetchurl {
104+ url = "mirror://cpan/authors/id/P/PM/PMQS/${name}.tar.gz";
105+ sha256 = "07xf50riarb60l1h6m2dqmql8q5dij619712fsgw7ach04d8g3z1";
106+ };
107+
108+ preConfigure = ''
109+ echo "LIB = ${db.out}/lib" > config.in
110+ echo "INCLUDE = ${db.dev}/include" >> config.in
111+ '';
112+}
113+</programlisting>
114114 </para>
115115
116116 <para>
117117 Dependencies on other Perl packages can be specified in the <varname>buildInputs</varname> and <varname>propagatedBuildInputs</varname> attributes. If something is exclusively a build-time dependency, use <varname>buildInputs</varname>; if it’s (also) a runtime dependency, use <varname>propagatedBuildInputs</varname>. For instance, this builds a Perl module that has runtime dependencies on a bunch of other modules:
118− <programlisting>
119− ClassC3Componentised = buildPerlPackage rec {
120− name = "Class-C3-Componentised-1.0004";
121− src = fetchurl {
122− url = "mirror://cpan/authors/id/A/AS/ASH/${name}.tar.gz";
123− sha256 = "0xql73jkcdbq4q9m0b0rnca6nrlvf5hyzy8is0crdk65bynvs8q1";
124− };
125− propagatedBuildInputs = [
126− ClassC3 ClassInspector TestException MROCompat
127− ];
128− };
129− </programlisting>
118+<programlisting>
119+ClassC3Componentised = buildPerlPackage rec {
120+ name = "Class-C3-Componentised-1.0004";
121+ src = fetchurl {
122+ url = "mirror://cpan/authors/id/A/AS/ASH/${name}.tar.gz";
123+ sha256 = "0xql73jkcdbq4q9m0b0rnca6nrlvf5hyzy8is0crdk65bynvs8q1";
124+ };
125+ propagatedBuildInputs = [
126+ ClassC3 ClassInspector TestException MROCompat
127+ ];
128+};
129+</programlisting>
130130 </para>
131131
132132 <para>
133133 On Darwin, if a script has too many <literal>-I<replaceable>dir</replaceable></literal> flags in its first line (its “shebang line”), it will not run. This can be worked around by calling the <literal>shortenPerlShebang</literal> function from the <literal>postInstall</literal> phase:
134− <programlisting>
135− { stdenv, buildPerlPackage, fetchurl, shortenPerlShebang }:
136−
137− ImageExifTool = buildPerlPackage {
138− pname = "Image-ExifTool";
139− version = "11.50";
140−
141− src = fetchurl {
142− url = "https://www.sno.phy.queensu.ca/~phil/exiftool/Image-ExifTool-11.50.tar.gz";
143− sha256 = "0d8v48y94z8maxkmw1rv7v9m0jg2dc8xbp581njb6yhr7abwqdv3";
144− };
145−
146− buildInputs = stdenv.lib.optional stdenv.isDarwin shortenPerlShebang;
147− postInstall = stdenv.lib.optional stdenv.isDarwin ''
148− shortenPerlShebang $out/bin/exiftool
149− '';
150− };
151− </programlisting>
134+<programlisting>
135+{ stdenv, buildPerlPackage, fetchurl, shortenPerlShebang }:
136+
137+ImageExifTool = buildPerlPackage {
138+ pname = "Image-ExifTool";
139+ version = "11.50";
140+
141+ src = fetchurl {
142+ url = "https://www.sno.phy.queensu.ca/~phil/exiftool/Image-ExifTool-11.50.tar.gz";
143+ sha256 = "0d8v48y94z8maxkmw1rv7v9m0jg2dc8xbp581njb6yhr7abwqdv3";
144+ };
145+
146+ buildInputs = stdenv.lib.optional stdenv.isDarwin shortenPerlShebang;
147+ postInstall = stdenv.lib.optional stdenv.isDarwin ''
148+ shortenPerlShebang $out/bin/exiftool
149+ '';
150+};
151+</programlisting>
152152 This will remove the <literal>-I</literal> flags from the shebang line, rewrite them in the <literal>use lib</literal> form, and put them on the next line instead. This function can be given any number of Perl scripts as arguments; it will modify them in-place.
153153 </para>
154154
@@ -159,27 +159,27 @@
159159 Nix expressions for Perl packages can be generated (almost) automatically from CPAN. This is done by the program <command>nix-generate-from-cpan</command>, which can be installed as follows:
160160 </para>
161161
162− <screen>
163− <prompt>$ </prompt>nix-env -i nix-generate-from-cpan
164− </screen>
162+<screen>
163+<prompt>$ </prompt>nix-env -i nix-generate-from-cpan
164+</screen>
165165
166166 <para>
167167 This program takes a Perl module name, looks it up on CPAN, fetches and unpacks the corresponding package, and prints a Nix expression on standard output. For example:
168− <screen>
169− <prompt>$ </prompt>nix-generate-from-cpan XML::Simple
170− XMLSimple = buildPerlPackage rec {
171− name = "XML-Simple-2.22";
172− src = fetchurl {
173− url = "mirror://cpan/authors/id/G/GR/GRANTM/${name}.tar.gz";
174− sha256 = "b9450ef22ea9644ae5d6ada086dc4300fa105be050a2030ebd4efd28c198eb49";
175− };
176− propagatedBuildInputs = [ XMLNamespaceSupport XMLSAX XMLSAXExpat ];
177− meta = {
178− description = "An API for simple XML files";
179− license = with stdenv.lib.licenses; [ artistic1 gpl1Plus ];
180− };
181− };
182− </screen>
168+<screen>
169+<prompt>$ </prompt>nix-generate-from-cpan XML::Simple
170+ XMLSimple = buildPerlPackage rec {
171+ name = "XML-Simple-2.22";
172+ src = fetchurl {
173+ url = "mirror://cpan/authors/id/G/GR/GRANTM/${name}.tar.gz";
174+ sha256 = "b9450ef22ea9644ae5d6ada086dc4300fa105be050a2030ebd4efd28c198eb49";
175+ };
176+ propagatedBuildInputs = [ XMLNamespaceSupport XMLSAX XMLSAXExpat ];
177+ meta = {
178+ description = "An API for simple XML files";
179+ license = with stdenv.lib.licenses; [ artistic1 gpl1Plus ];
180+ };
181+ };
182+</screen>
183183 The output can be pasted into <filename>pkgs/top-level/perl-packages.nix</filename> or wherever else you need it.
184184 </para>
185185 </section>
doc/languages-frameworks/qt.xml+1−1
@@ -18,7 +18,7 @@ mkDerivation { <co xml:id='qt-default-nix-co-2' />
1818
1919 buildInputs = [ qtbase ]; <co xml:id='qt-default-nix-co-3' />
2020}
21− </programlisting>
21+</programlisting>
2222 </example>
2323
2424 <calloutlist>
doc/languages-frameworks/ruby.xml+12−13
@@ -12,14 +12,14 @@
1212 </para>
1313
1414<screen>
15−<![CDATA[$ cd pkgs/servers/monitoring
16−$ mkdir sensu
17−$ cd sensu
18−$ cat > Gemfile
15+<prompt>$ </prompt>cd pkgs/servers/monitoring
16+<prompt>$ </prompt>mkdir sensu
17+<prompt>$ </prompt>cd sensu
18+<prompt>$ </prompt>cat > Gemfile
1919source 'https://rubygems.org'
2020gem 'sensu'
21−$ $(nix-build '<nixpkgs>' -A bundix --no-out-link)/bin/bundix --magic
22−$ cat > default.nix
21+<prompt>$ </prompt>$(nix-build '&lt;nixpkgs>' -A bundix --no-out-link)/bin/bundix --magic
22+<prompt>$ </prompt>cat > default.nix
2323{ lib, bundlerEnv, ruby }:
2424
2525bundlerEnv rec {
@@ -37,7 +37,7 @@ bundlerEnv rec {
3737 maintainers = with maintainers; [ theuni ];
3838 platforms = platforms.unix;
3939 };
40−}]]>
40+}
4141</screen>
4242
4343 <para>
@@ -49,17 +49,16 @@ bundlerEnv rec {
4949 </para>
5050
5151<screen>
52−<![CDATA[$ cd pkgs/servers/monitoring/sensu
53−$ nix-shell -p bundler --run 'bundle lock --update'
54−$ nix-shell -p bundix --run 'bundix'
55−]]>
52+<prompt>$ </prompt>cd pkgs/servers/monitoring/sensu
53+<prompt>$ </prompt>nix-shell -p bundler --run 'bundle lock --update'
54+<prompt>$ </prompt>nix-shell -p bundix --run 'bundix'
5655</screen>
5756
5857 <para>
5958 For tools written in Ruby - i.e. where the desire is to install a package and then execute e.g. <command>rake</command> at the command line, there is an alternative builder called <literal>bundlerApp</literal>. Set up the <filename>gemset.nix</filename> the same way, and then, for example:
6059 </para>
6160
62−<screen>
61+<programlisting>
6362<![CDATA[{ lib, bundlerApp }:
6463
6564bundlerApp {
@@ -75,7 +74,7 @@ bundlerApp {
7574 platforms = platforms.unix;
7675 };
7776}]]>
78−</screen>
77+</programlisting>
7978
8079 <para>
8180 The chief advantage of <literal>bundlerApp</literal> over <literal>bundlerEnv</literal> is the executables introduced in the environment are precisely those selected in the <literal>exes</literal> list, as opposed to <literal>bundlerEnv</literal> which adds all the executables made available by gems in the gemset, which can mean e.g. <command>rspec</command> or <command>rake</command> in unpredictable versions available from various packages.
doc/languages-frameworks/texlive.xml+5−5
@@ -44,11 +44,11 @@ texlive.combine {
4444 <listitem>
4545 <para>
4646 You can list packages e.g. by <command>nix repl</command>.
47−<programlisting><![CDATA[
48−$ nix repl
49−nix-repl> :l <nixpkgs>
50−nix-repl> texlive.collection-<TAB>
51−]]></programlisting>
47+<programlisting>
48+<prompt>$ </prompt>nix repl
49+<prompt>nix-repl> </prompt>:l &lt;nixpkgs>
50+<prompt>nix-repl> </prompt>texlive.collection-<keycap function="tab" />
51+</programlisting>
5252 </para>
5353 </listitem>
5454 <listitem>
doc/stdenv/multiple-output.xml+1−1
@@ -67,7 +67,7 @@
6767 <para>
6868 <command>nix-env</command> silenty disregards the outputs selected by the user, and instead installs the outputs from <varname>meta.outputsToInstall</varname>. For example,
6969 </para>
70−<programlisting>$ nix-env -iA nixpkgs.coreutils.info</programlisting>
70+<screen><prompt>$ </prompt>nix-env -iA nixpkgs.coreutils.info</screen>
7171 <para>
7272 installs the <literal>"out"</literal> output (<varname>coreutils.meta.outputsToInstall</varname> is <literal>[ "out" ]</literal>) instead of the requested <literal>"info"</literal>.
7373 </para>
doc/using/configuration.xml+4−4
@@ -66,7 +66,7 @@
6666 <listitem>
6767 <para>
6868 For allowing the build of a broken package once, you can use an environment variable for a single invocation of the nix tools:
69−<programlisting>$ export NIXPKGS_ALLOW_BROKEN=1</programlisting>
69+<screen><prompt>$ </prompt>export NIXPKGS_ALLOW_BROKEN=1</screen>
7070 </para>
7171 </listitem>
7272 <listitem>
@@ -92,7 +92,7 @@
9292 <listitem>
9393 <para>
9494 For allowing the build of an unsupported package once, you can use an environment variable for a single invocation of the nix tools:
95−<programlisting>$ export NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1</programlisting>
95+<screen><prompt>$ </prompt>export NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1</screen>
9696 </para>
9797 </listitem>
9898 <listitem>
@@ -122,7 +122,7 @@
122122 <listitem>
123123 <para>
124124 To temporarily allow all unfree packages, you can use an environment variable for a single invocation of the nix tools:
125−<programlisting>$ export NIXPKGS_ALLOW_UNFREE=1</programlisting>
125+<screen><prompt>$ </prompt>export NIXPKGS_ALLOW_UNFREE=1</screen>
126126 </para>
127127 </listitem>
128128 <listitem>
@@ -187,7 +187,7 @@
187187 <listitem>
188188 <para>
189189 To temporarily allow all insecure packages, you can use an environment variable for a single invocation of the nix tools:
190−<programlisting>$ export NIXPKGS_ALLOW_INSECURE=1</programlisting>
190+<screen><prompt>$ </prompt>export NIXPKGS_ALLOW_INSECURE=1</screen>
191191 </para>
192192 </listitem>
193193 <listitem>
doc/using/overlays.xml+5−5
@@ -240,7 +240,7 @@ self: super:
240240 lapackProvider = self.mkl;
241241 }
242242}
243− </programlisting>
243+</programlisting>
244244 <para>
245245 This overlay uses Intel’s MKL library for both BLAS and LAPACK
246246 interfaces. Note that the same can be accomplished at runtime
@@ -248,9 +248,9 @@ self: super:
248248 <literal>libblas.so.3</literal> and
249249 <literal>liblapack.so.3</literal>. For instance:
250250 </para>
251− <programlisting>
252−$ LD_LIBRARY_PATH=$(nix-build -A mkl)/lib:$LD_LIBRARY_PATH nix-shell -p octave --run octave
253− </programlisting>
251+<screen>
252+<prompt>$ </prompt>LD_LIBRARY_PATH=$(nix-build -A mkl)/lib:$LD_LIBRARY_PATH nix-shell -p octave --run octave
253+</screen>
254254 <para>
255255 Intel MKL requires an <literal>openmp</literal> implementation
256256 when running with multiple processors. By default,
@@ -288,7 +288,7 @@ assert (!blas.isILP64) &amp;&amp; (!lapack.isILP64);
288288stdenv.mkDerivation {
289289 ...
290290}
291− </programlisting>
291+</programlisting>
292292 </section>
293293 </section>
294294</chapter>
nixos/doc/manual/administration/imperative-containers.xml+16−16
@@ -14,18 +14,18 @@
1414 <para>
1515 You create a container with identifier <literal>foo</literal> as follows:
1616<screen>
17−# nixos-container create foo
17+<prompt># </prompt>nixos-container create <replaceable>foo</replaceable>
1818</screen>
1919 This creates the container’s root directory in
20− <filename>/var/lib/containers/foo</filename> and a small configuration file
21− in <filename>/etc/containers/foo.conf</filename>. It also builds the
20+ <filename>/var/lib/containers/<replaceable>foo</replaceable></filename> and a small configuration file
21+ in <filename>/etc/containers/<replaceable>foo</replaceable>.conf</filename>. It also builds the
2222 container’s initial system configuration and stores it in
23− <filename>/nix/var/nix/profiles/per-container/foo/system</filename>. You can
23+ <filename>/nix/var/nix/profiles/per-container/<replaceable>foo</replaceable>/system</filename>. You can
2424 modify the initial configuration of the container on the command line. For
2525 instance, to create a container that has <command>sshd</command> running,
2626 with the given public key for <literal>root</literal>:
2727<screen>
28−# nixos-container create foo --config '
28+<prompt># </prompt>nixos-container create <replaceable>foo</replaceable> --config '
2929 <xref linkend="opt-services.openssh.enable"/> = true;
3030 <link linkend="opt-users.users._name_.openssh.authorizedKeys.keys">users.users.root.openssh.authorizedKeys.keys</link> = ["ssh-dss AAAAB3N…"];
3131'
@@ -34,7 +34,7 @@
3434 as container IP. This behavior can be altered by setting <literal>--host-address</literal> and
3535 <literal>--local-address</literal>:
3636<screen>
37−# nixos-container create test --config-file test-container.nix \
37+<prompt># </prompt>nixos-container create test --config-file test-container.nix \
3838 --local-address 10.235.1.2 --host-address 10.235.1.1
3939</screen>
4040 </para>
@@ -42,7 +42,7 @@
4242 <para>
4343 Creating a container does not start it. To start the container, run:
4444<screen>
45−# nixos-container start foo
45+<prompt># </prompt>nixos-container start <replaceable>foo</replaceable>
4646</screen>
4747 This command will return as soon as the container has booted and has reached
4848 <literal>multi-user.target</literal>. On the host, the container runs within
@@ -51,7 +51,7 @@
5151 Thus, if something went wrong, you can get status info using
5252 <command>systemctl</command>:
5353<screen>
54−# systemctl status container@foo
54+<prompt># </prompt>systemctl status container@<replaceable>foo</replaceable>
5555</screen>
5656 </para>
5757
@@ -59,22 +59,22 @@
5959 If the container has started successfully, you can log in as root using the
6060 <command>root-login</command> operation:
6161<screen>
62−# nixos-container root-login foo
63−[root@foo:~]#
62+<prompt># </prompt>nixos-container root-login <replaceable>foo</replaceable>
63+<prompt>[root@foo:~]#</prompt>
6464</screen>
6565 Note that only root on the host can do this (since there is no
6666 authentication). You can also get a regular login prompt using the
6767 <command>login</command> operation, which is available to all users on the
6868 host:
6969<screen>
70−# nixos-container login foo
70+<prompt># </prompt>nixos-container login <replaceable>foo</replaceable>
7171foo login: alice
7272Password: ***
7373</screen>
7474 With <command>nixos-container run</command>, you can execute arbitrary
7575 commands in the container:
7676<screen>
77−# nixos-container run foo -- uname -a
77+<prompt># </prompt>nixos-container run <replaceable>foo</replaceable> -- uname -a
7878Linux foo 3.4.82 #1-NixOS SMP Thu Mar 20 14:44:05 UTC 2014 x86_64 GNU/Linux
7979</screen>
8080 </para>
@@ -85,18 +85,18 @@ Linux foo 3.4.82 #1-NixOS SMP Thu Mar 20 14:44:05 UTC 2014 x86_64 GNU/Linux
8585 <literal>/var/lib/container/<replaceable>name</replaceable>/etc/nixos/configuration.nix</literal>,
8686 and run
8787<screen>
88−# nixos-container update foo
88+<prompt># </prompt>nixos-container update <replaceable>foo</replaceable>
8989</screen>
9090 This will build and activate the new configuration. You can also specify a
9191 new configuration on the command line:
9292<screen>
93−# nixos-container update foo --config '
93+<prompt># </prompt>nixos-container update <replaceable>foo</replaceable> --config '
9494 <xref linkend="opt-services.httpd.enable"/> = true;
9595 <xref linkend="opt-services.httpd.adminAddr"/> = "foo@example.org";
9696 <xref linkend="opt-networking.firewall.allowedTCPPorts"/> = [ 80 ];
9797'
9898
99−# curl http://$(nixos-container show-ip foo)/
99+<prompt># </prompt>curl http://$(nixos-container show-ip <replaceable>foo</replaceable>)/
100100&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">…
101101</screen>
102102 However, note that this will overwrite the container’s
@@ -117,7 +117,7 @@ Linux foo 3.4.82 #1-NixOS SMP Thu Mar 20 14:44:05 UTC 2014 x86_64 GNU/Linux
117117 by using <command>systemctl</command> on the container’s service unit. To
118118 destroy a container, including its file system, do
119119<screen>
120−# nixos-container destroy foo
120+<prompt># </prompt>nixos-container destroy <replaceable>foo</replaceable>
121121</screen>
122122 </para>
123123</section>
nixos/doc/manual/administration/maintenance-mode.xml+1−1
@@ -8,7 +8,7 @@
88 <para>
99 You can enter rescue mode by running:
1010<screen>
11−# systemctl rescue</screen>
11+<prompt># </prompt>systemctl rescue</screen>
1212 This will eventually give you a single-user root shell. Systemd will stop
1313 (almost) all system services. To get out of maintenance mode, just exit from
1414 the rescue shell.
nixos/doc/manual/administration/network-problems.xml+2−2
@@ -16,12 +16,12 @@
1616 disable the use of the binary cache by adding <option>--option
1717 use-binary-caches false</option>, e.g.
1818<screen>
19−# nixos-rebuild switch --option use-binary-caches false
19+<prompt># </prompt>nixos-rebuild switch --option use-binary-caches false
2020</screen>
2121 If you have an alternative binary cache at your disposal, you can use it
2222 instead:
2323<screen>
24−# nixos-rebuild switch --option binary-caches http://my-cache.example.org/
24+<prompt># </prompt>nixos-rebuild switch --option binary-caches <replaceable>http://my-cache.example.org/</replaceable>
2525</screen>
2626 </para>
2727</section>
nixos/doc/manual/administration/rebooting.xml+3−3
@@ -7,20 +7,20 @@
77 <para>
88 The system can be shut down (and automatically powered off) by doing:
99<screen>
10−# shutdown
10+<prompt># </prompt>shutdown
1111</screen>
1212 This is equivalent to running <command>systemctl poweroff</command>.
1313 </para>
1414 <para>
1515 To reboot the system, run
1616<screen>
17−# reboot
17+<prompt># </prompt>reboot
1818</screen>
1919 which is equivalent to <command>systemctl reboot</command>. Alternatively,
2020 you can quickly reboot the system using <literal>kexec</literal>, which
2121 bypasses the BIOS by directly loading the new kernel into memory:
2222<screen>
23−# systemctl kexec
23+<prompt># </prompt>systemctl kexec
2424</screen>
2525 </para>
2626 <para>
nixos/doc/manual/administration/rollback.xml+3−3
@@ -20,16 +20,16 @@
2020 has booted, you can make the selected configuration the default for
2121 subsequent boots:
2222<screen>
23−# /run/current-system/bin/switch-to-configuration boot</screen>
23+<prompt># </prompt>/run/current-system/bin/switch-to-configuration boot</screen>
2424 </para>
2525
2626 <para>
2727 Second, you can switch to the previous configuration in a running system:
2828<screen>
29−# nixos-rebuild switch --rollback</screen>
29+<prompt># </prompt>nixos-rebuild switch --rollback</screen>
3030 This is equivalent to running:
3131<screen>
32−# /nix/var/nix/profiles/system-<replaceable>N</replaceable>-link/bin/switch-to-configuration switch</screen>
32+<prompt># </prompt>/nix/var/nix/profiles/system-<replaceable>N</replaceable>-link/bin/switch-to-configuration switch</screen>
3333 where <replaceable>N</replaceable> is the number of the NixOS system
3434 configuration. To get a list of the available configurations, do:
3535<screen>
nixos/doc/manual/administration/service-mgmt.xml+3−3
@@ -58,9 +58,9 @@ Jan 07 15:55:57 hagbard systemd[1]: Started PostgreSQL Server.
5858 <para>
5959 Units can be stopped, started or restarted:
6060<screen>
61−# systemctl stop postgresql.service
62−# systemctl start postgresql.service
63−# systemctl restart postgresql.service
61+<prompt># </prompt>systemctl stop postgresql.service
62+<prompt># </prompt>systemctl start postgresql.service
63+<prompt># </prompt>systemctl restart postgresql.service
6464</screen>
6565 These operations are synchronous: they wait until the service has finished
6666 starting or stopping (or has failed). Starting a unit will cause the
nixos/doc/manual/administration/user-sessions.xml+1−1
@@ -39,7 +39,7 @@ c3 - root (0)
3939 can terminate a session in a way that ensures that all the session’s
4040 processes are gone:
4141<screen>
42−# loginctl terminate-session c3
42+<prompt># </prompt>loginctl terminate-session c3
4343</screen>
4444 </para>
4545</chapter>
nixos/doc/manual/configuration/adding-custom-packages.xml+1−1
@@ -25,7 +25,7 @@ xlink:href="https://nixos.org/nixpkgs/manual">Nixpkgs
2525 and you run <command>nixos-rebuild</command>, specifying your own Nixpkgs
2626 tree:
2727<screen>
28−# nixos-rebuild switch -I nixpkgs=/path/to/my/nixpkgs</screen>
28+<prompt># </prompt>nixos-rebuild switch -I nixpkgs=/path/to/my/nixpkgs</screen>
2929 </para>
3030
3131 <para>
nixos/doc/manual/configuration/linux-kernel.xml+8−8
@@ -126,13 +126,13 @@ nixpkgs.config.packageOverrides = pkgs:
126126 <literal>mellanox</literal> drivers.
127127 </para>
128128
129−<screen><![CDATA[
130−$ nix-build '<nixpkgs>' -A linuxPackages.kernel.dev
131−$ nix-shell '<nixpkgs>' -A linuxPackages.kernel
132−$ unpackPhase
133−$ cd linux-*
134−$ make -C $dev/lib/modules/*/build M=$(pwd)/drivers/net/ethernet/mellanox modules
135−# insmod ./drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.ko
136−]]></screen>
129+<screen>
130+<prompt>$ </prompt>nix-build '&lt;nixpkgs>' -A linuxPackages.kernel.dev
131+<prompt>$ </prompt>nix-shell '&lt;nixpkgs>' -A linuxPackages.kernel
132+<prompt>$ </prompt>unpackPhase
133+<prompt>$ </prompt>cd linux-*
134+<prompt>$ </prompt>make -C $dev/lib/modules/*/build M=$(pwd)/drivers/net/ethernet/mellanox modules
135+<prompt># </prompt>insmod ./drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.ko
136+</screen>
137137 </section>
138138</chapter>
nixos/doc/manual/configuration/luks-file-systems.xml+10−10
@@ -11,7 +11,7 @@
1111 you create an encrypted Ext4 file system on the device
1212 <filename>/dev/disk/by-uuid/3f6b0024-3a44-4fde-a43a-767b872abe5d</filename>:
1313<screen>
14−# cryptsetup luksFormat /dev/disk/by-uuid/3f6b0024-3a44-4fde-a43a-767b872abe5d
14+<prompt># </prompt>cryptsetup luksFormat <replaceable>/dev/disk/by-uuid/3f6b0024-3a44-4fde-a43a-767b872abe5d</replaceable>
1515
1616WARNING!
1717========
@@ -21,17 +21,17 @@ Are you sure? (Type uppercase yes): YES
2121Enter LUKS passphrase: ***
2222Verify passphrase: ***
2323
24−# cryptsetup luksOpen /dev/disk/by-uuid/3f6b0024-3a44-4fde-a43a-767b872abe5d crypted
24+<prompt># </prompt>cryptsetup luksOpen <replaceable>/dev/disk/by-uuid/3f6b0024-3a44-4fde-a43a-767b872abe5d</replaceable> <replaceable>crypted</replaceable>
2525Enter passphrase for /dev/disk/by-uuid/3f6b0024-3a44-4fde-a43a-767b872abe5d: ***
2626
27−# mkfs.ext4 /dev/mapper/crypted
27+<prompt># </prompt>mkfs.ext4 /dev/mapper/<replaceable>crypted</replaceable>
2828</screen>
2929 To ensure that this file system is automatically mounted at boot time as
3030 <filename>/</filename>, add the following to
3131 <filename>configuration.nix</filename>:
3232<programlisting>
33−<link linkend="opt-boot.initrd.luks.devices._name_.device">boot.initrd.luks.devices.crypted.device</link> = "/dev/disk/by-uuid/3f6b0024-3a44-4fde-a43a-767b872abe5d";
34−<xref linkend="opt-fileSystems"/>."/".device = "/dev/mapper/crypted";
33+<link linkend="opt-boot.initrd.luks.devices._name_.device">boot.initrd.luks.devices.crypted.device</link> = "<replaceable>/dev/disk/by-uuid/3f6b0024-3a44-4fde-a43a-767b872abe5d</replaceable>";
34+<xref linkend="opt-fileSystems"/>."/".device = "/dev/mapper/<replaceable>crypted</replaceable>";
3535</programlisting>
3636 Should grub be used as bootloader, and <filename>/boot</filename> is located
3737 on an encrypted partition, it is necessary to add the following grub option:
@@ -45,11 +45,11 @@ Enter passphrase for /dev/disk/by-uuid/3f6b0024-3a44-4fde-a43a-767b872abe5d: ***
4545 and add it as a new key to our existing device <filename>/dev/sda2</filename>:
4646
4747 <screen>
48−# export FIDO2_LABEL="/dev/sda2 @ $HOSTNAME"
49−# fido2luks credential "$FIDO2_LABEL"
48+<prompt># </prompt>export FIDO2_LABEL="<replaceable>/dev/sda2</replaceable> @ $HOSTNAME"
49+<prompt># </prompt>fido2luks credential "$FIDO2_LABEL"
5050f1d00200108b9d6e849a8b388da457688e3dd653b4e53770012d8f28e5d3b269865038c346802f36f3da7278b13ad6a3bb6a1452e24ebeeaa24ba40eef559b1b287d2a2f80b7
5151
52−# fido2luks -i add-key /dev/sda2 f1d00200108b9d6e849a8b388da457688e3dd653b4e53770012d8f28e5d3b269865038c346802f36f3da7278b13ad6a3bb6a1452e24ebeeaa24ba40eef559b1b287d2a2f80b7
52+<prompt># </prompt>fido2luks -i add-key <replaceable>/dev/sda2</replaceable> <replaceable>f1d00200108b9d6e849a8b388da457688e3dd653b4e53770012d8f28e5d3b269865038c346802f36f3da7278b13ad6a3bb6a1452e24ebeeaa24ba40eef559b1b287d2a2f80b7</replaceable>
5353Password:
5454Password (again):
5555Old password:
@@ -60,13 +60,13 @@ Added to key to device /dev/sda2, slot: 2
6060 To ensure that this file system is decrypted using the FIDO2 compatible key, add the following to <filename>configuration.nix</filename>:
6161<programlisting>
6262<link linkend="opt-boot.initrd.luks.fido2Support">boot.initrd.luks.fido2Support</link> = true;
63−<link linkend="opt-boot.initrd.luks.devices._name_.fido2.credential">boot.initrd.luks.devices."/dev/sda2".fido2.credential</link> = "f1d00200108b9d6e849a8b388da457688e3dd653b4e53770012d8f28e5d3b269865038c346802f36f3da7278b13ad6a3bb6a1452e24ebeeaa24ba40eef559b1b287d2a2f80b7";
63+<link linkend="opt-boot.initrd.luks.devices._name_.fido2.credential">boot.initrd.luks.devices."<replaceable>/dev/sda2</replaceable>".fido2.credential</link> = "<replaceable>f1d00200108b9d6e849a8b388da457688e3dd653b4e53770012d8f28e5d3b269865038c346802f36f3da7278b13ad6a3bb6a1452e24ebeeaa24ba40eef559b1b287d2a2f80b7</replaceable>";
6464</programlisting>
6565
6666 You can also use the FIDO2 passwordless setup, but for security reasons, you might want to enable it only when your device is PIN protected, such as <link xlink:href="https://trezor.io/">Trezor</link>.
6767
6868<programlisting>
69−<link linkend="opt-boot.initrd.luks.devices._name_.fido2.passwordLess">boot.initrd.luks.devices."/dev/sda2".fido2.passwordLess</link> = true;
69+<link linkend="opt-boot.initrd.luks.devices._name_.fido2.passwordLess">boot.initrd.luks.devices."<replaceable>/dev/sda2</replaceable>".fido2.passwordLess</link> = true;
7070</programlisting>
7171 </para>
7272 </section>
nixos/doc/manual/configuration/user-mgmt.xml+4−4
@@ -62,24 +62,24 @@ uid = 1000;
6262 <command>useradd</command>, <command>groupmod</command> and so on. For
6363 instance, to create a user account named <literal>alice</literal>:
6464<screen>
65−# useradd -m alice</screen>
65+<prompt># </prompt>useradd -m <replaceable>alice</replaceable></screen>
6666 To make all nix tools available to this new user use `su - USER` which opens
6767 a login shell (==shell that loads the profile) for given user. This will
6868 create the ~/.nix-defexpr symlink. So run:
6969<screen>
70−# su - alice -c "true"</screen>
70+<prompt># </prompt>su - <replaceable>alice</replaceable> -c "true"</screen>
7171 The flag <option>-m</option> causes the creation of a home directory for the
7272 new user, which is generally what you want. The user does not have an initial
7373 password and therefore cannot log in. A password can be set using the
7474 <command>passwd</command> utility:
7575<screen>
76−# passwd alice
76+<prompt># </prompt>passwd <replaceable>alice</replaceable>
7777Enter new UNIX password: ***
7878Retype new UNIX password: ***
7979</screen>
8080 A user can be deleted using <command>userdel</command>:
8181<screen>
82−# userdel -r alice</screen>
82+<prompt># </prompt>userdel -r <replaceable>alice</replaceable></screen>
8383 The flag <option>-r</option> deletes the user’s home directory. Accounts
8484 can be modified using <command>usermod</command>. Unix groups can be managed
8585 using <command>groupadd</command>, <command>groupmod</command> and
nixos/doc/manual/configuration/x-windows.xml+1−1
@@ -58,7 +58,7 @@
5858</programlisting>
5959 The X server can then be started manually:
6060<screen>
61−# systemctl start display-manager.service
61+<prompt># </prompt>systemctl start display-manager.service
6262</screen>
6363 </para>
6464 <para>
nixos/doc/manual/development/meta-attributes.xml+1−1
@@ -57,7 +57,7 @@
5757 linkend="ch-configuration"/>. Changes to a module documentation
5858 have to be checked to not break building the NixOS manual:
5959 </para>
60−<programlisting>$ nix-build nixos/release.nix -A manual</programlisting>
60+<screen><prompt>$ </prompt>nix-build nixos/release.nix -A manual</screen>
6161 </callout>
6262 </calloutlist>
6363</section>
nixos/doc/manual/development/writing-documentation.xml+2−2
@@ -24,8 +24,8 @@
2424 </para>
2525
2626<screen>
27− $ cd /path/to/nixpkgs/nixos/doc/manual
28− $ make
27+<prompt>$ </prompt>cd /path/to/nixpkgs/nixos/doc/manual
28+<prompt>$ </prompt>make
2929</screen>
3030
3131 <para>
nixos/doc/manual/installation/installing-behind-a-proxy.xml+7−7
@@ -27,13 +27,13 @@ networking.proxy.noProxy = &quot;127.0.0.1,localhost,internal.domain&quot;;
2727 Setup the proxy environment variables in the shell where you are running
2828 <literal>nixos-install</literal>.
2929 </para>
30−<programlisting>
31−# proxy_url=&quot;http://user:password@proxy:port/&quot;
32−# export http_proxy=&quot;$proxy_url&quot;
33−# export HTTP_PROXY=&quot;$proxy_url&quot;
34−# export https_proxy=&quot;$proxy_url&quot;
35−# export HTTPS_PROXY=&quot;$proxy_url&quot;
36−</programlisting>
30+<screen>
31+<prompt># </prompt>proxy_url=&quot;http://user:password@proxy:port/&quot;
32+<prompt># </prompt>export http_proxy=&quot;$proxy_url&quot;
33+<prompt># </prompt>export HTTP_PROXY=&quot;$proxy_url&quot;
34+<prompt># </prompt>export https_proxy=&quot;$proxy_url&quot;
35+<prompt># </prompt>export HTTPS_PROXY=&quot;$proxy_url&quot;
36+</screen>
3737 </listitem>
3838 </orderedlist>
3939
nixos/doc/manual/installation/installing-from-other-distro.xml+8−8
@@ -325,14 +325,14 @@ sudo /nix/var/nix/profiles/system/bin/switch-to-configuration boot
325325 to boot on a USB rescue disk and do something along these lines:
326326 </para>
327327<screen>
328−# mkdir root
329−# mount /dev/sdaX root
330−# mkdir root/nixos-root
331−# mv -v root/* root/nixos-root/
332−# mv -v root/nixos-root/old-root/* root/
333−# mv -v root/boot.bak root/boot # We had renamed this by hand earlier
334−# umount root
335−# reboot</screen>
328+<prompt># </prompt>mkdir root
329+<prompt># </prompt>mount /dev/sdaX root
330+<prompt># </prompt>mkdir root/nixos-root
331+<prompt># </prompt>mv -v root/* root/nixos-root/
332+<prompt># </prompt>mv -v root/nixos-root/old-root/* root/
333+<prompt># </prompt>mv -v root/boot.bak root/boot # We had renamed this by hand earlier
334+<prompt># </prompt>umount root
335+<prompt># </prompt>reboot</screen>
336336 <para>
337337 This may work as is or you might also need to reinstall the boot loader
338338 </para>
nixos/doc/manual/installation/upgrading.xml+6−6
@@ -67,32 +67,32 @@
6767 <literal>nixos-20.03</literal> channel. To see which NixOS channel you’re
6868 subscribed to, run the following as root:
6969<screen>
70−# nix-channel --list | grep nixos
70+<prompt># </prompt>nix-channel --list | grep nixos
7171nixos https://nixos.org/channels/nixos-unstable
7272</screen>
7373 To switch to a different NixOS channel, do
7474<screen>
75−# nix-channel --add https://nixos.org/channels/<replaceable>channel-name</replaceable> nixos
75+<prompt># </prompt>nix-channel --add https://nixos.org/channels/<replaceable>channel-name</replaceable> nixos
7676</screen>
7777 (Be sure to include the <literal>nixos</literal> parameter at the end.) For
7878 instance, to use the NixOS 20.03 stable channel:
7979<screen>
80−# nix-channel --add https://nixos.org/channels/nixos-20.03 nixos
80+<prompt># </prompt>nix-channel --add https://nixos.org/channels/nixos-20.03 nixos
8181</screen>
8282 If you have a server, you may want to use the “small” channel instead:
8383<screen>
84−# nix-channel --add https://nixos.org/channels/nixos-20.03-small nixos
84+<prompt># </prompt>nix-channel --add https://nixos.org/channels/nixos-20.03-small nixos
8585</screen>
8686 And if you want to live on the bleeding edge:
8787<screen>
88−# nix-channel --add https://nixos.org/channels/nixos-unstable nixos
88+<prompt># </prompt>nix-channel --add https://nixos.org/channels/nixos-unstable nixos
8989</screen>
9090 </para>
9191 <para>
9292 You can then upgrade NixOS to the latest version in your chosen channel by
9393 running
9494<screen>
95−# nixos-rebuild switch --upgrade
95+<prompt># </prompt>nixos-rebuild switch --upgrade
9696</screen>
9797 which is equivalent to the more verbose <literal>nix-channel --update nixos;
9898 nixos-rebuild switch</literal>.
nixos/doc/manual/man-nixos-enter.xml+2−2
@@ -136,13 +136,13 @@
136136 <filename>/mnt</filename>:
137137 </para>
138138<screen>
139−# nixos-enter --root /mnt
139+<prompt># </prompt>nixos-enter --root /mnt
140140</screen>
141141 <para>
142142 Run a shell command:
143143 </para>
144144<screen>
145−# nixos-enter -c 'ls -l /; cat /proc/mounts'
145+<prompt># </prompt>nixos-enter -c 'ls -l /; cat /proc/mounts'
146146</screen>
147147 <para>
148148 Run a non-shell command:
nixos/doc/manual/man-nixos-version.xml+2−2
@@ -33,7 +33,7 @@
3333 <para>
3434 This command shows the version of the currently active NixOS configuration.
3535 For example:
36−<screen>$ nixos-version
36+<screen><prompt>$ </prompt>nixos-version
373716.03.1011.6317da4 (Emu)
3838</screen>
3939 The version consists of the following elements:
@@ -111,7 +111,7 @@
111111 <para>
112112 Show the full SHA1 hash of the Git commit from which this configuration
113113 was built, e.g.
114−<screen>$ nixos-version --hash
114+<screen><prompt>$ </prompt>nixos-version --hash
1151156317da40006f6bc2480c6781999c52d88dde2acf
116116</screen>
117117 </para>
nixos/modules/services/backup/borgbackup.xml+4−4
@@ -69,10 +69,10 @@
6969 access this single repository. You need the output of the generate pub file.
7070 </para>
7171 <para>
72− <programlisting>
73−# sudo ssh-keygen -N '' -t ed25519 -f /run/keys/id_ed25519_my_borg_repo
74−# cat /run/keys/id_ed25519_my_borg_repo
75−ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAID78zmOyA+5uPG4Ot0hfAy+sLDPU1L4AiIoRYEIVbbQ/ root@nixos</programlisting>
72+<screen>
73+<prompt># </prompt>sudo ssh-keygen -N '' -t ed25519 -f /run/keys/id_ed25519_my_borg_repo
74+<prompt># </prompt>cat /run/keys/id_ed25519_my_borg_repo
75+ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAID78zmOyA+5uPG4Ot0hfAy+sLDPU1L4AiIoRYEIVbbQ/ root@nixos</screen>
7676 </para>
7777 <para>
7878 Add the following snippet to your NixOS configuration:
nixos/modules/system/activation/top-level.nix+3−3
@@ -159,9 +159,9 @@ in
159159 To switch to a specialised configuration
160160 (e.g. <literal>fewJobsManyCores</literal>) at runtime, run:
161161
162− <programlisting>
163− # sudo /run/current-system/specialisation/fewJobsManyCores/bin/switch-to-configuration test
164− </programlisting>
162+ <screen>
163+ <prompt># </prompt>sudo /run/current-system/specialisation/fewJobsManyCores/bin/switch-to-configuration test
164+ </screen>
165165 '';
166166 type = types.attrsOf (types.submodule (
167167 { ... }: {