Manual: Explicitly mark commands that require to be run as root (#15589)

* manual: Mark commands that require root

Mark every command that requires to be run as root by prefixing them
with '#' instead of '$'.

* manual: Add note about commands that require root

authored by

Wilhelm Schuster and committed by
Domen Kožar
5f8d1454 f5471374

+101 -98
+2 -2
nixos/doc/manual/administration/cleaning-store.xml
··· 21 background: 22 23 <screen> 24 - $ systemctl start nix-gc.service 25 </screen> 26 27 You can tell NixOS in <filename>configuration.nix</filename> to run ··· 59 Since this command needs to read the entire Nix store, it can take 60 quite a while to finish.</para> 61 62 - </chapter>
··· 21 background: 22 23 <screen> 24 + # systemctl start nix-gc.service 25 </screen> 26 27 You can tell NixOS in <filename>configuration.nix</filename> to run ··· 59 Since this command needs to read the entire Nix store, it can take 60 quite a while to finish.</para> 61 62 + </chapter>
+2 -2
nixos/doc/manual/administration/container-networking.xml
··· 13 address as follows: 14 15 <screen> 16 - $ nixos-container show-ip foo 17 10.233.4.2 18 19 $ ping -c1 10.233.4.2 ··· 47 external interface. Note that <literal>ve-+</literal> is a wildcard 48 that matches all container interfaces.</para> 49 50 - </section>
··· 13 address as follows: 14 15 <screen> 16 + # nixos-container show-ip foo 17 10.233.4.2 18 19 $ ping -c1 10.233.4.2 ··· 47 external interface. Note that <literal>ve-+</literal> is a wildcard 48 that matches all container interfaces.</para> 49 50 + </section>
+12 -12
nixos/doc/manual/administration/imperative-containers.xml
··· 11 identifier <literal>foo</literal> as follows: 12 13 <screen> 14 - $ nixos-container create foo 15 </screen> 16 17 This creates the container’s root directory in ··· 25 <literal>root</literal>: 26 27 <screen> 28 - $ nixos-container create foo --config 'services.openssh.enable = true; \ 29 users.extraUsers.root.openssh.authorizedKeys.keys = ["ssh-dss AAAAB3N…"];' 30 </screen> 31 ··· 35 run: 36 37 <screen> 38 - $ nixos-container start foo 39 </screen> 40 41 This command will return as soon as the container has booted and has ··· 46 <command>systemctl</command>: 47 48 <screen> 49 - $ systemctl status container@foo 50 </screen> 51 52 </para> ··· 55 root using the <command>root-login</command> operation: 56 57 <screen> 58 - $ nixos-container root-login foo 59 [root@foo:~]# 60 </screen> 61 ··· 65 the host: 66 67 <screen> 68 - $ nixos-container login foo 69 foo login: alice 70 Password: *** 71 </screen> ··· 74 commands in the container: 75 76 <screen> 77 - $ nixos-container run foo -- uname -a 78 Linux foo 3.4.82 #1-NixOS SMP Thu Mar 20 14:44:05 UTC 2014 x86_64 GNU/Linux 79 </screen> 80 ··· 86 and run 87 88 <screen> 89 - $ nixos-container update foo 90 </screen> 91 92 This will build and activate the new configuration. You can also 93 specify a new configuration on the command line: 94 95 <screen> 96 - $ nixos-container update foo --config 'services.httpd.enable = true; \ 97 services.httpd.adminAddr = "foo@example.org";' 98 99 - $ curl http://$(nixos-container show-ip foo)/ 100 &lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">… 101 </screen> 102 ··· 116 destroy a container, including its file system, do 117 118 <screen> 119 - $ nixos-container destroy foo 120 </screen> 121 122 </para> 123 124 - </section>
··· 11 identifier <literal>foo</literal> as follows: 12 13 <screen> 14 + # nixos-container create foo 15 </screen> 16 17 This creates the container’s root directory in ··· 25 <literal>root</literal>: 26 27 <screen> 28 + # nixos-container create foo --config 'services.openssh.enable = true; \ 29 users.extraUsers.root.openssh.authorizedKeys.keys = ["ssh-dss AAAAB3N…"];' 30 </screen> 31 ··· 35 run: 36 37 <screen> 38 + # nixos-container start foo 39 </screen> 40 41 This command will return as soon as the container has booted and has ··· 46 <command>systemctl</command>: 47 48 <screen> 49 + # systemctl status container@foo 50 </screen> 51 52 </para> ··· 55 root using the <command>root-login</command> operation: 56 57 <screen> 58 + # nixos-container root-login foo 59 [root@foo:~]# 60 </screen> 61 ··· 65 the host: 66 67 <screen> 68 + # nixos-container login foo 69 foo login: alice 70 Password: *** 71 </screen> ··· 74 commands in the container: 75 76 <screen> 77 + # nixos-container run foo -- uname -a 78 Linux foo 3.4.82 #1-NixOS SMP Thu Mar 20 14:44:05 UTC 2014 x86_64 GNU/Linux 79 </screen> 80 ··· 86 and run 87 88 <screen> 89 + # nixos-container update foo 90 </screen> 91 92 This will build and activate the new configuration. You can also 93 specify a new configuration on the command line: 94 95 <screen> 96 + # nixos-container update foo --config 'services.httpd.enable = true; \ 97 services.httpd.adminAddr = "foo@example.org";' 98 99 + # curl http://$(nixos-container show-ip foo)/ 100 &lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">… 101 </screen> 102 ··· 116 destroy a container, including its file system, do 117 118 <screen> 119 + # nixos-container destroy foo 120 </screen> 121 122 </para> 123 124 + </section>
+2 -2
nixos/doc/manual/administration/maintenance-mode.xml
··· 9 <para>You can enter rescue mode by running: 10 11 <screen> 12 - $ systemctl rescue</screen> 13 14 This will eventually give you a single-user root shell. Systemd will 15 stop (almost) all system services. To get out of maintenance mode, 16 just exit from the rescue shell.</para> 17 18 - </section>
··· 9 <para>You can enter rescue mode by running: 10 11 <screen> 12 + # systemctl rescue</screen> 13 14 This will eventually give you a single-user root shell. Systemd will 15 stop (almost) all system services. To get out of maintenance mode, 16 just exit from the rescue shell.</para> 17 18 + </section>
+2 -2
nixos/doc/manual/administration/network-problems.xml
··· 18 use-binary-caches false</option>, e.g. 19 20 <screen> 21 - $ nixos-rebuild switch --option use-binary-caches false 22 </screen> 23 24 If you have an alternative binary cache at your disposal, you can use 25 it instead: 26 27 <screen> 28 - $ nixos-rebuild switch --option binary-caches http://my-cache.example.org/ 29 </screen> 30 31 </para>
··· 18 use-binary-caches false</option>, e.g. 19 20 <screen> 21 + # nixos-rebuild switch --option use-binary-caches false 22 </screen> 23 24 If you have an alternative binary cache at your disposal, you can use 25 it instead: 26 27 <screen> 28 + # nixos-rebuild switch --option binary-caches http://my-cache.example.org/ 29 </screen> 30 31 </para>
+4 -4
nixos/doc/manual/administration/rebooting.xml
··· 10 doing: 11 12 <screen> 13 - $ shutdown 14 </screen> 15 16 This is equivalent to running <command>systemctl ··· 19 <para>To reboot the system, run 20 21 <screen> 22 - $ reboot 23 </screen> 24 25 which is equivalent to <command>systemctl reboot</command>. ··· 28 the new kernel into memory: 29 30 <screen> 31 - $ systemctl kexec 32 </screen> 33 34 </para> ··· 41 i.e. on a virtual console or in X11; otherwise, the user is asked for 42 authentication.</para> 43 44 - </chapter>
··· 10 doing: 11 12 <screen> 13 + # shutdown 14 </screen> 15 16 This is equivalent to running <command>systemctl ··· 19 <para>To reboot the system, run 20 21 <screen> 22 + # reboot 23 </screen> 24 25 which is equivalent to <command>systemctl reboot</command>. ··· 28 the new kernel into memory: 29 30 <screen> 31 + # systemctl kexec 32 </screen> 33 34 </para> ··· 41 i.e. on a virtual console or in X11; otherwise, the user is asked for 42 authentication.</para> 43 44 + </chapter>
+4 -4
nixos/doc/manual/administration/rollback.xml
··· 19 configuration the default for subsequent boots: 20 21 <screen> 22 - $ /run/current-system/bin/switch-to-configuration boot</screen> 23 24 </para> 25 ··· 27 system: 28 29 <screen> 30 - $ nixos-rebuild switch --rollback</screen> 31 32 This is equivalent to running: 33 34 <screen> 35 - $ /nix/var/nix/profiles/system-<replaceable>N</replaceable>-link/bin/switch-to-configuration switch</screen> 36 37 where <replaceable>N</replaceable> is the number of the NixOS system 38 configuration. To get a list of the available configurations, do: ··· 45 46 </para> 47 48 - </section>
··· 19 configuration the default for subsequent boots: 20 21 <screen> 22 + # /run/current-system/bin/switch-to-configuration boot</screen> 23 24 </para> 25 ··· 27 system: 28 29 <screen> 30 + # nixos-rebuild switch --rollback</screen> 31 32 This is equivalent to running: 33 34 <screen> 35 + # /nix/var/nix/profiles/system-<replaceable>N</replaceable>-link/bin/switch-to-configuration switch</screen> 36 37 where <replaceable>N</replaceable> is the number of the NixOS system 38 configuration. To get a list of the available configurations, do: ··· 45 46 </para> 47 48 + </section>
+3 -3
nixos/doc/manual/administration/service-mgmt.xml
··· 66 <para>Units can be stopped, started or restarted: 67 68 <screen> 69 - $ systemctl stop postgresql.service 70 - $ systemctl start postgresql.service 71 - $ systemctl restart postgresql.service 72 </screen> 73 74 These operations are synchronous: they wait until the service has
··· 66 <para>Units can be stopped, started or restarted: 67 68 <screen> 69 + # systemctl stop postgresql.service 70 + # systemctl start postgresql.service 71 + # systemctl restart postgresql.service 72 </screen> 73 74 These operations are synchronous: they wait until the service has
+3 -3
nixos/doc/manual/administration/store-corruption.xml
··· 18 system configuration, you can fix it by doing 19 20 <screen> 21 - $ nixos-rebuild switch --repair 22 </screen> 23 24 This will cause Nix to check every path in the closure, and if its ··· 28 <para>You can also scan the entire Nix store for corrupt paths: 29 30 <screen> 31 - $ nix-store --verify --check-contents --repair 32 </screen> 33 34 Any corrupt paths will be redownloaded if they’re available in a 35 binary cache; otherwise, they cannot be repaired.</para> 36 37 - </section>
··· 18 system configuration, you can fix it by doing 19 20 <screen> 21 + # nixos-rebuild switch --repair 22 </screen> 23 24 This will cause Nix to check every path in the closure, and if its ··· 28 <para>You can also scan the entire Nix store for corrupt paths: 29 30 <screen> 31 + # nix-store --verify --check-contents --repair 32 </screen> 33 34 Any corrupt paths will be redownloaded if they’re available in a 35 binary cache; otherwise, they cannot be repaired.</para> 36 37 + </section>
+2 -2
nixos/doc/manual/administration/user-sessions.xml
··· 45 all the session’s processes are gone: 46 47 <screen> 48 - $ loginctl terminate-session c3 49 </screen> 50 51 </para> 52 53 - </chapter>
··· 45 all the session’s processes are gone: 46 47 <screen> 48 + # loginctl terminate-session c3 49 </screen> 50 51 </para> 52 53 + </chapter>
+1 -1
nixos/doc/manual/configuration/adding-custom-packages.xml
··· 31 Nixpkgs tree: 32 33 <screen> 34 - $ nixos-rebuild switch -I nixpkgs=/path/to/my/nixpkgs</screen> 35 36 </para> 37
··· 31 Nixpkgs tree: 32 33 <screen> 34 + # nixos-rebuild switch -I nixpkgs=/path/to/my/nixpkgs</screen> 35 36 </para> 37
+1 -1
nixos/doc/manual/configuration/linux-kernel.xml
··· 82 $ unpackPhase 83 $ cd linux-* 84 $ make -C $dev/lib/modules/*/build M=$(pwd)/drivers/net/ethernet/mellanox modules 85 - $ sudo insmod ./drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.ko 86 ]]></screen> 87 88 </section>
··· 82 $ unpackPhase 83 $ cd linux-* 84 $ make -C $dev/lib/modules/*/build M=$(pwd)/drivers/net/ethernet/mellanox modules 85 + # insmod ./drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.ko 86 ]]></screen> 87 88 </section>
+3 -3
nixos/doc/manual/configuration/luks-file-systems.xml
··· 12 <filename>/dev/disk/by-uuid/3f6b0024-3a44-4fde-a43a-767b872abe5d</filename>: 13 14 <screen> 15 - $ cryptsetup luksFormat /dev/disk/by-uuid/3f6b0024-3a44-4fde-a43a-767b872abe5d 16 17 WARNING! 18 ======== ··· 22 Enter LUKS passphrase: *** 23 Verify passphrase: *** 24 25 - $ cryptsetup luksOpen /dev/disk/by-uuid/3f6b0024-3a44-4fde-a43a-767b872abe5d crypted 26 Enter passphrase for /dev/disk/by-uuid/3f6b0024-3a44-4fde-a43a-767b872abe5d: *** 27 28 - $ mkfs.ext4 /dev/mapper/crypted 29 </screen> 30 31 To ensure that this file system is automatically mounted at boot time
··· 12 <filename>/dev/disk/by-uuid/3f6b0024-3a44-4fde-a43a-767b872abe5d</filename>: 13 14 <screen> 15 + # cryptsetup luksFormat /dev/disk/by-uuid/3f6b0024-3a44-4fde-a43a-767b872abe5d 16 17 WARNING! 18 ======== ··· 22 Enter LUKS passphrase: *** 23 Verify passphrase: *** 24 25 + # cryptsetup luksOpen /dev/disk/by-uuid/3f6b0024-3a44-4fde-a43a-767b872abe5d crypted 26 Enter passphrase for /dev/disk/by-uuid/3f6b0024-3a44-4fde-a43a-767b872abe5d: *** 27 28 + # mkfs.ext4 /dev/mapper/crypted 29 </screen> 30 31 To ensure that this file system is automatically mounted at boot time
+4 -4
nixos/doc/manual/configuration/user-mgmt.xml
··· 63 account named <literal>alice</literal>: 64 65 <screen> 66 - $ useradd -m alice</screen> 67 68 To make all nix tools available to this new user use `su - USER` which 69 opens a login shell (==shell that loads the profile) for given user. 70 This will create the ~/.nix-defexpr symlink. So run: 71 72 <screen> 73 - $ su - alice -c "true"</screen> 74 75 76 The flag <option>-m</option> causes the creation of a home directory ··· 79 be set using the <command>passwd</command> utility: 80 81 <screen> 82 - $ passwd alice 83 Enter new UNIX password: *** 84 Retype new UNIX password: *** 85 </screen> ··· 87 A user can be deleted using <command>userdel</command>: 88 89 <screen> 90 - $ userdel -r alice</screen> 91 92 The flag <option>-r</option> deletes the user’s home directory. 93 Accounts can be modified using <command>usermod</command>. Unix
··· 63 account named <literal>alice</literal>: 64 65 <screen> 66 + # useradd -m alice</screen> 67 68 To make all nix tools available to this new user use `su - USER` which 69 opens a login shell (==shell that loads the profile) for given user. 70 This will create the ~/.nix-defexpr symlink. So run: 71 72 <screen> 73 + # su - alice -c "true"</screen> 74 75 76 The flag <option>-m</option> causes the creation of a home directory ··· 79 be set using the <command>passwd</command> utility: 80 81 <screen> 82 + # passwd alice 83 Enter new UNIX password: *** 84 Retype new UNIX password: *** 85 </screen> ··· 87 A user can be deleted using <command>userdel</command>: 88 89 <screen> 90 + # userdel -r alice</screen> 91 92 The flag <option>-r</option> deletes the user’s home directory. 93 Accounts can be modified using <command>usermod</command>. Unix
+2 -2
nixos/doc/manual/configuration/wireless.xml
··· 41 to generate the <literal>wpa_supplicant.conf</literal>. 42 43 <screen> 44 - $ wpa_passphrase ESSID PSK > /etc/wpa_supplicant.conf</screen> 45 46 After you have edited the <literal>wpa_supplicant.conf</literal>, 47 you need to restart the wpa_supplicant service. 48 49 <screen> 50 - $ systemctl restart wpa_supplicant.service</screen> 51 </para> 52 53 </section>
··· 41 to generate the <literal>wpa_supplicant.conf</literal>. 42 43 <screen> 44 + # wpa_passphrase ESSID PSK > /etc/wpa_supplicant.conf</screen> 45 46 After you have edited the <literal>wpa_supplicant.conf</literal>, 47 you need to restart the wpa_supplicant service. 48 49 <screen> 50 + # systemctl restart wpa_supplicant.service</screen> 51 </para> 52 53 </section>
+2 -2
nixos/doc/manual/configuration/x-windows.xml
··· 5 xml:id="sec-x11"> 6 7 <title>X Window System</title> 8 - 9 <para>The X Window System (X11) provides the basis of NixOS’ graphical 10 user interface. It can be enabled as follows: 11 <programlisting> ··· 48 </programlisting> 49 The X server can then be started manually: 50 <screen> 51 - $ systemctl start display-manager.service 52 </screen> 53 </para> 54
··· 5 xml:id="sec-x11"> 6 7 <title>X Window System</title> 8 + 9 <para>The X Window System (X11) provides the basis of NixOS’ graphical 10 user interface. It can be enabled as follows: 11 <programlisting> ··· 48 </programlisting> 49 The X server can then be started manually: 50 <screen> 51 + # systemctl start display-manager.service 52 </screen> 53 </para> 54
+2 -2
nixos/doc/manual/development/building-nixos.xml
··· 25 suggested by the following command: 26 27 <screen> 28 - $ mount -o loop -t iso9660 ./result/iso/cd.iso /mnt/iso</screen> 29 30 </para> 31 32 - </chapter>
··· 25 suggested by the following command: 26 27 <screen> 28 + # mount -o loop -t iso9660 ./result/iso/cd.iso /mnt/iso</screen> 29 30 </para> 31 32 + </chapter>
+3 -3
nixos/doc/manual/development/building-parts.xml
··· 94 <screen> 95 $ cp $(nix-build -A 'config.systemd.units."httpd.service".unit')/httpd.service \ 96 /run/systemd/system/tmp-httpd.service 97 - $ systemctl daemon-reload 98 - $ systemctl start tmp-httpd.service 99 </screen> 100 101 Note that the unit must not have the same name as any unit in ··· 110 111 </para> 112 113 - </chapter>
··· 94 <screen> 95 $ cp $(nix-build -A 'config.systemd.units."httpd.service".unit')/httpd.service \ 96 /run/systemd/system/tmp-httpd.service 97 + # systemctl daemon-reload 98 + # systemctl start tmp-httpd.service 99 </screen> 100 101 Note that the unit must not have the same name as any unit in ··· 110 111 </para> 112 113 + </chapter>
+1 -1
nixos/doc/manual/development/sources.xml
··· 70 using the <option>-I</option> flag: 71 72 <screen> 73 - $ nixos-rebuild switch -I nixpkgs=<replaceable>/my/sources</replaceable>/nixpkgs 74 </screen> 75 76 </para>
··· 70 using the <option>-I</option> flag: 71 72 <screen> 73 + # nixos-rebuild switch -I nixpkgs=<replaceable>/my/sources</replaceable>/nixpkgs 74 </screen> 75 76 </para>
+4 -4
nixos/doc/manual/development/testing-installer.xml
··· 12 13 <screen> 14 $ nix-build -A config.system.build.nixos-install 15 - $ mount -t tmpfs none /mnt 16 - $ ./result/bin/nixos-install</screen> 17 18 To start a login shell in the new NixOS installation in 19 <filename>/mnt</filename>: 20 21 <screen> 22 - $ ./result/bin/nixos-install --chroot 23 </screen> 24 25 </para> 26 27 - </chapter>
··· 12 13 <screen> 14 $ nix-build -A config.system.build.nixos-install 15 + # mount -t tmpfs none /mnt 16 + # ./result/bin/nixos-install</screen> 17 18 To start a login shell in the new NixOS installation in 19 <filename>/mnt</filename>: 20 21 <screen> 22 + # ./result/bin/nixos-install --chroot 23 </screen> 24 25 </para> 26 27 + </chapter>
+4 -4
nixos/doc/manual/installation/changing-config.xml
··· 10 changed something to that file, you should do 11 12 <screen> 13 - $ nixos-rebuild switch</screen> 14 15 to build the new configuration, make it the default configuration for 16 booting, and try to realise the configuration in the running system ··· 23 <para>You can also do 24 25 <screen> 26 - $ nixos-rebuild test</screen> 27 28 to build the configuration and switch the running system to it, but 29 without making it the boot default. So if (say) the configuration ··· 33 <para>There is also 34 35 <screen> 36 - $ nixos-rebuild boot</screen> 37 38 to build the configuration and make it the boot default, but not 39 switch to it now (so it will only take effect after the next ··· 44 name</emphasis>, e.g. 45 46 <screen> 47 - $ nixos-rebuild switch -p test </screen> 48 49 which causes the new configuration (and previous ones created using 50 <literal>-p test</literal>) to show up in the GRUB submenu “NixOS -
··· 10 changed something to that file, you should do 11 12 <screen> 13 + # nixos-rebuild switch</screen> 14 15 to build the new configuration, make it the default configuration for 16 booting, and try to realise the configuration in the running system ··· 23 <para>You can also do 24 25 <screen> 26 + # nixos-rebuild test</screen> 27 28 to build the configuration and switch the running system to it, but 29 without making it the boot default. So if (say) the configuration ··· 33 <para>There is also 34 35 <screen> 36 + # nixos-rebuild boot</screen> 37 38 to build the configuration and make it the boot default, but not 39 switch to it now (so it will only take effect after the next ··· 44 name</emphasis>, e.g. 45 46 <screen> 47 + # nixos-rebuild switch -p test </screen> 48 49 which causes the new configuration (and previous ones created using 50 <literal>-p test</literal>) to show up in the GRUB submenu “NixOS -
+1 -1
nixos/doc/manual/installation/installing-uefi.xml
··· 5 xml:id="sec-uefi-installation"> 6 7 <title>UEFI Installation</title> 8 - 9 <para>NixOS can also be installed on UEFI systems. The procedure 10 is by and large the same as a BIOS installation, with the following 11 changes:
··· 5 xml:id="sec-uefi-installation"> 6 7 <title>UEFI Installation</title> 8 + 9 <para>NixOS can also be installed on UEFI systems. The procedure 10 is by and large the same as a BIOS installation, with the following 11 changes:
+19 -19
nixos/doc/manual/installation/installing.xml
··· 54 changes. For example: 55 56 <screen> 57 - $ mkfs.ext4 -L nixos /dev/sda1</screen> 58 59 </para></listitem> 60 ··· 66 <listitem><para>For creating LVM volumes, the LVM commands, e.g., 67 68 <screen> 69 - $ pvcreate /dev/sda1 /dev/sdb1 70 - $ vgcreate MyVolGroup /dev/sda1 /dev/sdb1 71 - $ lvcreate --size 2G --name bigdisk MyVolGroup 72 - $ lvcreate --size 1G --name smalldisk MyVolGroup</screen> 73 74 </para></listitem> 75 ··· 84 be installed on <filename>/mnt</filename>, e.g. 85 86 <screen> 87 - $ mount /dev/disk/by-label/nixos /mnt 88 </screen> 89 90 </para></listitem> ··· 113 generate an initial configuration file for you: 114 115 <screen> 116 - $ nixos-generate-config --root /mnt</screen> 117 118 You should then edit 119 <filename>/mnt/etc/nixos/configuration.nix</filename> to suit your 120 needs: 121 122 <screen> 123 - $ nano /mnt/etc/nixos/configuration.nix 124 </screen> 125 126 If you’re using the graphical ISO image, other editors may be ··· 162 <listitem><para>Do the installation: 163 164 <screen> 165 - $ nixos-install</screen> 166 167 Cross fingers. If this fails due to a temporary problem (such as 168 a network issue while downloading binaries from the NixOS binary ··· 186 <listitem><para>If everything went well: 187 188 <screen> 189 - $ reboot</screen> 190 191 </para></listitem> 192 ··· 235 236 <example xml:id='ex-install-sequence'><title>Commands for Installing NixOS on <filename>/dev/sda</filename></title> 237 <screen> 238 - $ fdisk /dev/sda # <lineannotation>(or whatever device you want to install on)</lineannotation> 239 - $ mkfs.ext4 -L nixos /dev/sda1 240 - $ mkswap -L swap /dev/sda2 241 - $ swapon /dev/sda2 242 - $ mount /dev/disk/by-label/nixos /mnt 243 - $ nixos-generate-config --root /mnt 244 - $ nano /mnt/etc/nixos/configuration.nix 245 - $ nixos-install 246 - $ reboot</screen> 247 </example> 248 249 <example xml:id='ex-config'><title>NixOS Configuration</title>
··· 54 changes. For example: 55 56 <screen> 57 + # mkfs.ext4 -L nixos /dev/sda1</screen> 58 59 </para></listitem> 60 ··· 66 <listitem><para>For creating LVM volumes, the LVM commands, e.g., 67 68 <screen> 69 + # pvcreate /dev/sda1 /dev/sdb1 70 + # vgcreate MyVolGroup /dev/sda1 /dev/sdb1 71 + # lvcreate --size 2G --name bigdisk MyVolGroup 72 + # lvcreate --size 1G --name smalldisk MyVolGroup</screen> 73 74 </para></listitem> 75 ··· 84 be installed on <filename>/mnt</filename>, e.g. 85 86 <screen> 87 + # mount /dev/disk/by-label/nixos /mnt 88 </screen> 89 90 </para></listitem> ··· 113 generate an initial configuration file for you: 114 115 <screen> 116 + # nixos-generate-config --root /mnt</screen> 117 118 You should then edit 119 <filename>/mnt/etc/nixos/configuration.nix</filename> to suit your 120 needs: 121 122 <screen> 123 + # nano /mnt/etc/nixos/configuration.nix 124 </screen> 125 126 If you’re using the graphical ISO image, other editors may be ··· 162 <listitem><para>Do the installation: 163 164 <screen> 165 + # nixos-install</screen> 166 167 Cross fingers. If this fails due to a temporary problem (such as 168 a network issue while downloading binaries from the NixOS binary ··· 186 <listitem><para>If everything went well: 187 188 <screen> 189 + # reboot</screen> 190 191 </para></listitem> 192 ··· 235 236 <example xml:id='ex-install-sequence'><title>Commands for Installing NixOS on <filename>/dev/sda</filename></title> 237 <screen> 238 + # fdisk /dev/sda # <lineannotation>(or whatever device you want to install on)</lineannotation> 239 + # mkfs.ext4 -L nixos /dev/sda1 240 + # mkswap -L swap /dev/sda2 241 + # swapon /dev/sda2 242 + # mount /dev/disk/by-label/nixos /mnt 243 + # nixos-generate-config --root /mnt 244 + # nano /mnt/etc/nixos/configuration.nix 245 + # nixos-install 246 + # reboot</screen> 247 </example> 248 249 <example xml:id='ex-config'><title>NixOS Configuration</title>
+6 -6
nixos/doc/manual/installation/upgrading.xml
··· 60 channel you’re subscribed to, run the following as root: 61 62 <screen> 63 - $ nix-channel --list | grep nixos 64 nixos https://nixos.org/channels/nixos-unstable 65 </screen> 66 67 To switch to a different NixOS channel, do 68 69 <screen> 70 - $ nix-channel --add https://nixos.org/channels/<replaceable>channel-name</replaceable> nixos 71 </screen> 72 73 (Be sure to include the <literal>nixos</literal> parameter at the 74 end.) For instance, to use the NixOS 14.12 stable channel: 75 76 <screen> 77 - $ nix-channel --add https://nixos.org/channels/nixos-14.12 nixos 78 </screen> 79 80 If you have a server, you may want to use the “small” channel instead: 81 82 <screen> 83 - $ nix-channel --add https://nixos.org/channels/nixos-14.12-small nixos 84 </screen> 85 86 And if you want to live on the bleeding edge: 87 88 <screen> 89 - $ nix-channel --add https://nixos.org/channels/nixos-unstable nixos 90 </screen> 91 92 </para> ··· 95 channel by running 96 97 <screen> 98 - $ nixos-rebuild switch --upgrade 99 </screen> 100 101 which is equivalent to the more verbose <literal>nix-channel --update
··· 60 channel you’re subscribed to, run the following as root: 61 62 <screen> 63 + # nix-channel --list | grep nixos 64 nixos https://nixos.org/channels/nixos-unstable 65 </screen> 66 67 To switch to a different NixOS channel, do 68 69 <screen> 70 + # nix-channel --add https://nixos.org/channels/<replaceable>channel-name</replaceable> nixos 71 </screen> 72 73 (Be sure to include the <literal>nixos</literal> parameter at the 74 end.) For instance, to use the NixOS 14.12 stable channel: 75 76 <screen> 77 + # nix-channel --add https://nixos.org/channels/nixos-14.12 nixos 78 </screen> 79 80 If you have a server, you may want to use the “small” channel instead: 81 82 <screen> 83 + # nix-channel --add https://nixos.org/channels/nixos-14.12-small nixos 84 </screen> 85 86 And if you want to live on the bleeding edge: 87 88 <screen> 89 + # nix-channel --add https://nixos.org/channels/nixos-unstable nixos 90 </screen> 91 92 </para> ··· 95 channel by running 96 97 <screen> 98 + # nixos-rebuild switch --upgrade 99 </screen> 100 101 which is equivalent to the more verbose <literal>nix-channel --update
+2 -2
nixos/doc/manual/man-configuration.xml
··· 1 <refentry xmlns="http://docbook.org/ns/docbook" 2 xmlns:xlink="http://www.w3.org/1999/xlink" 3 xmlns:xi="http://www.w3.org/2001/XInclude"> 4 - 5 <refmeta> 6 <refentrytitle><filename>configuration.nix</filename></refentrytitle> 7 <manvolnum>5</manvolnum> ··· 34 <xi:include href="options-db.xml" /> 35 36 </refsection> 37 - 38 </refentry>
··· 1 <refentry xmlns="http://docbook.org/ns/docbook" 2 xmlns:xlink="http://www.w3.org/1999/xlink" 3 xmlns:xi="http://www.w3.org/2001/XInclude"> 4 + 5 <refmeta> 6 <refentrytitle><filename>configuration.nix</filename></refentrytitle> 7 <manvolnum>5</manvolnum> ··· 34 <xi:include href="options-db.xml" /> 35 36 </refsection> 37 + 38 </refentry>
+4 -4
nixos/doc/manual/man-nixos-build-vms.xml
··· 1 <refentry xmlns="http://docbook.org/ns/docbook" 2 xmlns:xlink="http://www.w3.org/1999/xlink" 3 xmlns:xi="http://www.w3.org/2001/XInclude"> 4 - 5 <refmeta> 6 <refentrytitle><command>nixos-build-vms</command></refentrytitle> 7 <manvolnum>8</manvolnum> ··· 42 services.openssh.enable = true; 43 nixpkgs.system = "i686-linux"; 44 deployment.targetHost = "test1.example.net"; 45 - 46 # Other NixOS options 47 }; 48 - 49 test2 = {pkgs, config, ...}: 50 { 51 services.openssh.enable = true; ··· 53 environment.systemPackages = [ pkgs.lynx ]; 54 nixpkgs.system = "x86_64-linux"; 55 deployment.targetHost = "test2.example.net"; 56 - 57 # Other NixOS options 58 }; 59 }
··· 1 <refentry xmlns="http://docbook.org/ns/docbook" 2 xmlns:xlink="http://www.w3.org/1999/xlink" 3 xmlns:xi="http://www.w3.org/2001/XInclude"> 4 + 5 <refmeta> 6 <refentrytitle><command>nixos-build-vms</command></refentrytitle> 7 <manvolnum>8</manvolnum> ··· 42 services.openssh.enable = true; 43 nixpkgs.system = "i686-linux"; 44 deployment.targetHost = "test1.example.net"; 45 + 46 # Other NixOS options 47 }; 48 + 49 test2 = {pkgs, config, ...}: 50 { 51 services.openssh.enable = true; ··· 53 environment.systemPackages = [ pkgs.lynx ]; 54 nixpkgs.system = "x86_64-linux"; 55 deployment.targetHost = "test2.example.net"; 56 + 57 # Other NixOS options 58 }; 59 }
+2 -2
nixos/doc/manual/man-nixos-option.xml
··· 1 <refentry xmlns="http://docbook.org/ns/docbook" 2 xmlns:xlink="http://www.w3.org/1999/xlink" 3 xmlns:xi="http://www.w3.org/2001/XInclude"> 4 - 5 <refmeta> 6 <refentrytitle><command>nixos-option</command></refentrytitle> 7 <manvolnum>8</manvolnum> ··· 64 Value: 65 true 66 67 - Default: 68 true 69 70 Description:
··· 1 <refentry xmlns="http://docbook.org/ns/docbook" 2 xmlns:xlink="http://www.w3.org/1999/xlink" 3 xmlns:xi="http://www.w3.org/2001/XInclude"> 4 + 5 <refmeta> 6 <refentrytitle><command>nixos-option</command></refentrytitle> 7 <manvolnum>8</manvolnum> ··· 64 Value: 65 true 66 67 + Default: 68 true 69 70 Description:
+4 -1
nixos/doc/manual/manual.xml
··· 3 xmlns:xi="http://www.w3.org/2001/XInclude" 4 version="5.0" 5 xml:id="book-nixos-manual"> 6 - 7 <info> 8 <title>NixOS Manual</title> 9 <subtitle>Version <xi:include href="version" parse="text" /></subtitle> ··· 26 xlink:href="https://github.com/NixOS/nixpkgs/issues">NixOS’ GitHub 27 issue tracker</link>.</para> 28 29 </preface> 30 31 <xi:include href="installation/installation.xml" />
··· 3 xmlns:xi="http://www.w3.org/2001/XInclude" 4 version="5.0" 5 xml:id="book-nixos-manual"> 6 + 7 <info> 8 <title>NixOS Manual</title> 9 <subtitle>Version <xi:include href="version" parse="text" /></subtitle> ··· 26 xlink:href="https://github.com/NixOS/nixpkgs/issues">NixOS’ GitHub 27 issue tracker</link>.</para> 28 29 + <note>Commands prefixed with <literal>#</literal> have to be run as 30 + root, either requiring to login as root user or temporarily switching 31 + to it using <literal>sudo</literal> for example.</note> 32 </preface> 33 34 <xi:include href="installation/installation.xml" />