nixos/doc: Fix spurious indentation

This commit is contained in:
Jan Tojnar 2019-06-17 12:01:51 +02:00
parent 092c25ac08
commit 11cb382a4c
No known key found for this signature in database
GPG Key ID: 7FAB2A15F7A607A4
17 changed files with 262 additions and 256 deletions

View File

@ -129,7 +129,7 @@ nix-repl> map (x: x.hostName) config.<xref linkend="opt-services.httpd.virtualHo
While abstracting your configuration, you may find it useful to generate
modules using code, instead of writing files. The example below would have
the same effect as importing a file which sets those options.
<screen>
<programlisting>
{ config, pkgs, ... }:
let netConfig = { hostName }: {
@ -140,6 +140,6 @@ nix-repl> map (x: x.hostName) config.<xref linkend="opt-services.httpd.virtualHo
in
{ imports = [ (netConfig "nixos.localdomain") ]; }
</screen>
</programlisting>
</para>
</section>

View File

@ -9,7 +9,8 @@
<link linkend="ch-configuration">changed something</link> in that file, you
should do
<screen>
# nixos-rebuild switch</screen>
<prompt># </prompt>nixos-rebuild switch
</screen>
to build the new configuration, make it the default configuration for
booting, and try to realise the configuration in the running system (e.g., by
restarting system services).
@ -23,7 +24,8 @@
<para>
You can also do
<screen>
# nixos-rebuild test</screen>
<prompt># </prompt>nixos-rebuild test
</screen>
to build the configuration and switch the running system to it, but without
making it the boot default. So if (say) the configuration locks up your
machine, you can just reboot to get back to a working configuration.
@ -31,7 +33,8 @@
<para>
There is also
<screen>
# nixos-rebuild boot</screen>
<prompt># </prompt>nixos-rebuild boot
</screen>
to build the configuration and make it the boot default, but not switch to it
now (so it will only take effect after the next reboot).
</para>
@ -39,7 +42,8 @@
You can make your configuration show up in a different submenu of the GRUB 2
boot screen by giving it a different <emphasis>profile name</emphasis>, e.g.
<screen>
# nixos-rebuild switch -p test </screen>
<prompt># </prompt>nixos-rebuild switch -p test
</screen>
which causes the new configuration (and previous ones created using
<literal>-p test</literal>) to show up in the GRUB submenu “NixOS - Profile
'test'”. This can be useful to separate test configurations from
@ -48,7 +52,8 @@
<para>
Finally, you can do
<screen>
$ nixos-rebuild build</screen>
<prompt>$ </prompt>nixos-rebuild build
</screen>
to build the configuration but nothing more. This is useful to see whether
everything compiles cleanly.
</para>
@ -58,8 +63,8 @@ $ nixos-rebuild build</screen>
<emphasis>virtual machine</emphasis> that contains the desired configuration.
Just do
<screen>
$ nixos-rebuild build-vm
$ ./result/bin/run-*-vm
<prompt>$ </prompt>nixos-rebuild build-vm
<prompt>$ </prompt>./result/bin/run-*-vm
</screen>
The VM does not have any data from your host system, so your existing user
accounts and home directories will not be available unless you have set
@ -74,12 +79,12 @@ $ ./result/bin/run-*-vm
guest. For instance, the following will forward host port 2222 to guest port
22 (SSH):
<screen>
$ QEMU_NET_OPTS="hostfwd=tcp::2222-:22" ./result/bin/run-*-vm
<prompt>$ </prompt>QEMU_NET_OPTS="hostfwd=tcp::2222-:22" ./result/bin/run-*-vm
</screen>
allowing you to log in via SSH (assuming you have set the appropriate
passwords or SSH authorized keys):
<screen>
$ ssh -p 2222 localhost
<prompt>$ </prompt>ssh -p 2222 localhost
</screen>
</para>
</chapter>

View File

@ -47,8 +47,8 @@
Short version:
</para>
<screen>
$ curl https://nixos.org/nix/install | sh
$ . $HOME/.nix-profile/etc/profile.d/nix.sh # …or open a fresh shell</screen>
<prompt>$ </prompt>curl https://nixos.org/nix/install | sh
<prompt>$ </prompt>. $HOME/.nix-profile/etc/profile.d/nix.sh # …or open a fresh shell</screen>
<para>
More details in the
<link
@ -65,14 +65,14 @@ $ . $HOME/.nix-profile/etc/profile.d/nix.sh # …or open a fresh shell</screen>
the <literal>nixpkgs</literal> channel by default.
</para>
<screen>
$ nix-channel --list
<prompt>$ </prompt>nix-channel --list
nixpkgs https://nixos.org/channels/nixpkgs-unstable</screen>
<para>
As that channel gets released without running the NixOS tests, it will be
safer to use the <literal>nixos-*</literal> channels instead:
</para>
<screen>
$ nix-channel --add https://nixos.org/channels/nixos-<replaceable>version</replaceable> nixpkgs</screen>
<prompt>$ </prompt>nix-channel --add https://nixos.org/channels/nixos-<replaceable>version</replaceable> nixpkgs</screen>
<para>
You may want to throw in a <literal>nix-channel --update</literal> for good
measure.
@ -89,7 +89,7 @@ $ nix-channel --add https://nixos.org/channels/nixos-<replaceable>version</repla
NixOS partition. They are installed by default on NixOS, but you don't have
NixOS yet..
</para>
<screen>$ nix-env -iE "_: with import &lt;nixpkgs/nixos&gt; { configuration = {}; }; with config.system.build; [ nixos-generate-config nixos-install nixos-enter manual.manpages ]"</screen>
<screen><prompt>$ </prompt>nix-env -iE "_: with import &lt;nixpkgs/nixos&gt; { configuration = {}; }; with config.system.build; [ nixos-generate-config nixos-install nixos-enter manual.manpages ]"</screen>
</listitem>
<listitem>
<note>
@ -116,7 +116,7 @@ $ nix-channel --add https://nixos.org/channels/nixos-<replaceable>version</repla
<para>
Generate your NixOS configuration:
</para>
<screen>$ sudo `which nixos-generate-config` --root /mnt</screen>
<screen><prompt>$ </prompt>sudo `which nixos-generate-config` --root /mnt</screen>
<para>
You'll probably want to edit the configuration files. Refer to the
<literal>nixos-generate-config</literal> step in
@ -148,8 +148,8 @@ $ nix-channel --add https://nixos.org/channels/nixos-<replaceable>version</repla
distribution:
</para>
<screen>
$ sudo groupadd -g 30000 nixbld
$ sudo useradd -u 30000 -g nixbld -G nixbld nixbld</screen>
<prompt>$ </prompt>sudo groupadd -g 30000 nixbld
<prompt>$ </prompt>sudo useradd -u 30000 -g nixbld -G nixbld nixbld</screen>
</listitem>
<listitem>
<para>
@ -161,7 +161,7 @@ $ sudo useradd -u 30000 -g nixbld -G nixbld nixbld</screen>
existing systems without the help of a rescue USB drive or similar.
</para>
</warning>
<screen>$ sudo PATH="$PATH" NIX_PATH="$NIX_PATH" `which nixos-install` --root /mnt</screen>
<screen><prompt>$ </prompt>sudo PATH="$PATH" NIX_PATH="$NIX_PATH" `which nixos-install` --root /mnt</screen>
<para>
Again, please refer to the <literal>nixos-install</literal> step in
<xref linkend="sec-installation" /> for more information.
@ -175,8 +175,8 @@ $ sudo useradd -u 30000 -g nixbld -G nixbld nixbld</screen>
Optionally, you may want to clean up your non-NixOS distribution:
</para>
<screen>
$ sudo userdel nixbld
$ sudo groupdel nixbld</screen>
<prompt>$ </prompt>sudo userdel nixbld
<prompt>$ </prompt>sudo groupdel nixbld</screen>
<para>
If you do not wish to keep the Nix package manager installed either, run
something like <literal>sudo rm -rv ~/.nix-* /nix</literal> and remove the
@ -193,7 +193,7 @@ $ sudo groupdel nixbld</screen>
<para>
Generate your NixOS configuration:
</para>
<screen>$ sudo `which nixos-generate-config` --root /</screen>
<screen><prompt>$ </prompt>sudo `which nixos-generate-config` --root /</screen>
<para>
Note that this will place the generated configuration files in
<literal>/etc/nixos</literal>. You'll probably want to edit the
@ -219,14 +219,14 @@ $ sudo groupdel nixbld</screen>
Build the NixOS closure and install it in the <literal>system</literal>
profile:
</para>
<screen>$ nix-env -p /nix/var/nix/profiles/system -f '&lt;nixpkgs/nixos&gt;' -I nixos-config=/etc/nixos/configuration.nix -iA system</screen>
<screen><prompt>$ </prompt>nix-env -p /nix/var/nix/profiles/system -f '&lt;nixpkgs/nixos&gt;' -I nixos-config=/etc/nixos/configuration.nix -iA system</screen>
</listitem>
<listitem>
<para>
Change ownership of the <literal>/nix</literal> tree to root (since your
Nix install was probably single user):
</para>
<screen>$ sudo chown -R 0.0 /nix</screen>
<screen><prompt>$ </prompt>sudo chown -R 0.0 /nix</screen>
</listitem>
<listitem>
<para>
@ -284,15 +284,15 @@ $ sudo groupdel nixbld</screen>
Let's create the files:
</para>
<screen>
$ sudo touch /etc/NIXOS
$ sudo touch /etc/NIXOS_LUSTRATE
<prompt>$ </prompt>sudo touch /etc/NIXOS
<prompt>$ </prompt>sudo touch /etc/NIXOS_LUSTRATE
</screen>
<para>
Let's also make sure the NixOS configuration files are kept once we reboot
on NixOS:
</para>
<screen>
$ echo etc/nixos | sudo tee -a /etc/NIXOS_LUSTRATE
<prompt>$ </prompt>echo etc/nixos | sudo tee -a /etc/NIXOS_LUSTRATE
</screen>
</listitem>
<listitem>
@ -312,8 +312,9 @@ $ echo etc/nixos | sudo tee -a /etc/NIXOS_LUSTRATE
</para>
</warning>
<screen>
$ sudo mv -v /boot /boot.bak &amp;&amp;
sudo /nix/var/nix/profiles/system/bin/switch-to-configuration boot</screen>
<prompt>$ </prompt>sudo mv -v /boot /boot.bak &amp;&amp;
sudo /nix/var/nix/profiles/system/bin/switch-to-configuration boot
</screen>
<para>
Cross your fingers, reboot, hopefully you should get a NixOS prompt!
</para>

View File

@ -525,7 +525,7 @@ $ nix-env -i w3m</screen>
<example xml:id='ex-config'>
<title>NixOS Configuration</title>
<screen>
<programlisting>
{ config, pkgs, ... }: {
imports = [
# Include the results of the hardware scan.
@ -543,7 +543,7 @@ $ nix-env -i w3m</screen>
# Enable the OpenSSH server.
services.sshd.enable = true;
}
</screen>
</programlisting>
</example>
</section>
<section xml:id="sec-installation-additional-notes">

View File

@ -36,21 +36,21 @@
Then, you will need to add a repository, for example,
<link xlink:href="https://github.com/flatpak/flatpak/wiki">Flathub</link>,
either using the following commands:
<programlisting>
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak update
</programlisting>
<screen>
<prompt>$ </prompt>flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
<prompt>$ </prompt>flatpak update
</screen>
or by opening the
<link xlink:href="https://flathub.org/repo/flathub.flatpakrepo">repository
file</link> in GNOME Software.
</para>
<para>
Finally, you can search and install programs:
<programlisting>
flatpak search bustle
flatpak install flathub org.freedesktop.Bustle
flatpak run org.freedesktop.Bustle
</programlisting>
<screen>
<prompt>$ </prompt>flatpak search bustle
<prompt>$ </prompt>flatpak install flathub org.freedesktop.Bustle
<prompt>$ </prompt>flatpak run org.freedesktop.Bustle
</screen>
Again, GNOME Software offers graphical interface for these tasks.
</para>
</chapter>