diff --git a/nixos/doc/manual/configuration.xml b/nixos/doc/manual/configuration.xml index e93c49d1cce..b0b1da71184 100644 --- a/nixos/doc/manual/configuration.xml +++ b/nixos/doc/manual/configuration.xml @@ -11,6 +11,15 @@ NixOS machine through the configuration file effect after you run nixos-rebuild. + + +
Configuration syntax + +TODO + +
+ +
Package management diff --git a/nixos/doc/manual/installation.xml b/nixos/doc/manual/installation.xml index 3068fa5cb94..d274cfc6908 100644 --- a/nixos/doc/manual/installation.xml +++ b/nixos/doc/manual/installation.xml @@ -44,7 +44,7 @@ Wiki. The NixOS manual is available on virtual console 8 (press Alt+F8 to access). - Login as root, empty + Login as root and the empty password. If you downloaded the graphical ISO image, you can @@ -89,7 +89,13 @@ $ lvcreate --size 1G --name smalldisk MyVolGroup Mount the target file system on which NixOS should - be installed on /mnt. + be installed on /mnt, e.g. + + +$ mount /dev/disk/by-label/nixos /mnt + + + @@ -97,40 +103,56 @@ $ lvcreate --size 1G --name smalldisk MyVolGroup /mnt/etc/nixos/configuration.nix that specifies the intended configuration of the system. This is because NixOS has a declarative configuration - model: you create or edit a description of the configuration that - you want to be built and activated, and then NixOS takes care of - realising that configuration. The command - nixos-option can generate an initial - configuration file for you: + model: you create or edit a description of the desired + configuration of your system, and then NixOS takes care of making + it happen. The syntax of the NixOS configuration file is + described in , while a + list of available configuration options appears in . A minimal example is shown in . + + The command nixos-generate-config can + generate an initial configuration file for you: -$ nixos-option --install +$ nixos-generate-config --root /mnt - It tries to figure out the kernel modules necessary for mounting - the root device, as well as various other hardware - characteristics. However, it doesn’t try to figure out the - option yet. - - You should edit + You should then edit /mnt/etc/nixos/configuration.nix to suit your - needs. The text editors nano and - vim are available. + needs: - You need to specify a root file system in - and the target device for the Grub boot - loader in . See - for a list of the available configuration - options. + +$ nano /mnt/etc/nixos/configuration.nix + - It is very important that you specify in the option - all kernel modules that - are necessary for mounting the root file system, otherwise the - installed system will not be able to boot. (If this happens, boot - from the CD again, mount the target file system on + The vim text editor is also available. + + You must set the option + to specify on which disk + the GRUB boot loader is to be installed. Without it, NixOS cannot + boot. + + Another critical option is , + specifying the file systems that need to be mounted by NixOS. + However, you typically don’t need to set it yourself, because + nixos-generate-config sets it automatically in + /mnt/etc/nixos/hardware-configuration.nix + from your currently mounted file systems. (The configuration file + hardware-configuration.nix is included from + configuration.nix and will be overwritten by + future invocations of nixos-generate-config; + thus, you generally should not modify it.) + + Depending on your hardware configuration or type of + file system, you may need to set the option + to include the kernel + modules that are necessary for mounting the root file system, + otherwise the installed system will not be able to boot. (If this + happens, boot from the CD again, mount the target file system on /mnt, fix /mnt/etc/nixos/configuration.nix and rerun nixos-install.) In most cases, - nixos-option --install will figure out the + nixos-generate-config will figure out the required modules. Examples of real-world NixOS configuration files can be @@ -218,7 +240,7 @@ $ fdisk /dev/sda (or whatever device you want to install on)(idem) $ mkswap -L swap /dev/sda2 (idem) $ mount LABEL=nixos /mnt -$ nixos-option --install +$ nixos-generate-config $ nano /mnt/etc/nixos/configuration.nix (in particular, set the fileSystems and swapDevices options) $ nixos-install @@ -228,8 +250,16 @@ $ reboot NixOS configuration { + imports = + [ # Include the results of the hardware scan. + ./hardware-configuration.nix + ]; + boot.loader.grub.device = "/dev/sda"; + # Note: setting fileSystems and swapDevices is generally not + # necessary, since nixos-generate-config has set them automatically + # in hardware-configuration.nix. fileSystems."/".device = "/dev/disk/by-label/nixos"; swapDevices = diff --git a/nixos/doc/manual/manual.xml b/nixos/doc/manual/manual.xml index 7d6634bf093..dfbd865b505 100644 --- a/nixos/doc/manual/manual.xml +++ b/nixos/doc/manual/manual.xml @@ -42,7 +42,7 @@ xlink:href="irc://irc.freenode.net/#nixos"> #nixos channel on Freenode. Bugs should be reported in NixOS’ GitHub + xlink:href="https://github.com/NixOS/nixpkgs/issues">NixOS’ GitHub issue tracker. @@ -55,7 +55,7 @@ - List of Options + List of options