nixos/doc: Improve code listings

By adding prompts and replaceables and removing unnecessary indentation.
This commit is contained in:
Jan Tojnar
2020-09-23 01:25:25 +02:00
parent e1af37634b
commit e6ce041cae
21 changed files with 88 additions and 88 deletions
+6 -6
View File
@@ -67,32 +67,32 @@
<literal>nixos-20.03</literal> channel. To see which NixOS channel youre
subscribed to, run the following as root:
<screen>
# nix-channel --list | grep nixos
<prompt># </prompt>nix-channel --list | grep nixos
nixos https://nixos.org/channels/nixos-unstable
</screen>
To switch to a different NixOS channel, do
<screen>
# nix-channel --add https://nixos.org/channels/<replaceable>channel-name</replaceable> nixos
<prompt># </prompt>nix-channel --add https://nixos.org/channels/<replaceable>channel-name</replaceable> nixos
</screen>
(Be sure to include the <literal>nixos</literal> parameter at the end.) For
instance, to use the NixOS 20.03 stable channel:
<screen>
# nix-channel --add https://nixos.org/channels/nixos-20.03 nixos
<prompt># </prompt>nix-channel --add https://nixos.org/channels/nixos-20.03 nixos
</screen>
If you have a server, you may want to use the “small” channel instead:
<screen>
# nix-channel --add https://nixos.org/channels/nixos-20.03-small nixos
<prompt># </prompt>nix-channel --add https://nixos.org/channels/nixos-20.03-small nixos
</screen>
And if you want to live on the bleeding edge:
<screen>
# nix-channel --add https://nixos.org/channels/nixos-unstable nixos
<prompt># </prompt>nix-channel --add https://nixos.org/channels/nixos-unstable nixos
</screen>
</para>
<para>
You can then upgrade NixOS to the latest version in your chosen channel by
running
<screen>
# nixos-rebuild switch --upgrade
<prompt># </prompt>nixos-rebuild switch --upgrade
</screen>
which is equivalent to the more verbose <literal>nix-channel --update nixos;
nixos-rebuild switch</literal>.