git.iko.soy/typeable/nixpkgs
on master help sign in
nixos/doc: Improve code listings

By adding prompts and replaceables and removing unnecessary indentation.

commite6ce041caef09405283081a8b5c5412153eccc85 authorJan Tojnar <jtojnar@gmail.com> dateWed 23 Sep 2020, 00:38 (6 years ago) parente1af376
21 files changed+88−88
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
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 { ... }: {