diff --git a/doc/manual/development.xml b/doc/manual/development.xml index 6f61068d0b6..71072f0db2a 100644 --- a/doc/manual/development.xml +++ b/doc/manual/development.xml @@ -14,13 +14,49 @@ NixOS. -$ nix-build system/system.nix \ - --arg configuration "import /etc/nixos/configuration.nix" \ - -A attr +$ nix-build /etc/nixos/nixos attr where attr is an attribute in -system/system.nix (e.g., -bootStage1). +/etc/nixos/nixos/default.nix. Attributes of interest include: + + + + + kernel + The kernel. + + + + initialRamdisk + The initial ramdisk (initrd) for this configuration. + + + + bootStage1 + The stage 1 (initrd) init script. + + + + bootStage2 + The stage 2 init script. + + + + etc + The statically computed parts of /etc. + + + + upstartJobs + An attribute set containing the Upstart jobs. For + instance, the sshd Upstart job can be built by + doing nix-build /etc/nixos/nixos -A + upstartJobs.sshd. + + + + + diff --git a/doc/manual/installation.xml b/doc/manual/installation.xml index 6a56b3b874a..1daf6c6d692 100644 --- a/doc/manual/installation.xml +++ b/doc/manual/installation.xml @@ -58,11 +58,9 @@ $ ln -s nixpkgs/pkgs nixos/ $ nix-build configuration/rescue-cd.nix -A rescueCD If everything goes well, you’ll end up with an ISO image in - ./result/iso/nixos.iso. - - Burn the ISO image - ./result/iso/nixos.iso onto a CD or DVD or - attach it to a CD-ROM drive in VMware. + ./result/iso/nixos-version-platform.iso + that you can burn onto a CD or attach to a virtual CD-ROM drive in + your favourite virtual machine software. @@ -81,13 +79,18 @@ $ nix-build configuration/rescue-cd.nix -A rescueCD Boot from the CD. - The CD contains a basic NixOS installation. When - it’s finished booting, it should have detected most of your hardware - and brought up networking (check ifconfig). - Networking is necessary for the installer, since it will download - lots of stuff (such as source tarballs or Nixpkgs channel binaries). - It’s best if you have a DHCP server on your network. Otherwise - configure manually. + The CD contains a basic NixOS installation. (It + also contain Memtest86+, useful if you want to test new hardware.) + When it’s finished booting, it should have detected most of your + hardware and brought up networking (check + ifconfig). Networking is necessary for the + installer, since it will download lots of stuff (such as source + tarballs or Nixpkgs channel binaries). It’s best if you have a DHCP + server on your network. Otherwise configure + manually. + + The NixOS manual is available on virtual console 7 + (press Alt+F7 to access). Login as root, empty password. @@ -130,34 +133,77 @@ $ lvcreate --size 1G --name smalldisk MyVolGroup For creating software RAID devices: mdadm. - Mount the target file system on - /mnt. + - The installation is declarative; you need to write - a description of the configuration that you want to be built and + + + Mount the target file system on + /mnt. + + + + The installation is declarative; you need to write a + description of the configuration that you want to be built and activated. The configuration is specified in a Nix expression and - should be stored in - /etc/nixos/configuration.nix. See + must be stored on the target file system in + /mnt/etc/nixos/configuration.nix. See /etc/nixos/nixos/configuration/examples for example machine configurations. You can copy and edit one of those (e.g., copy /etc/nixos/nixos/configuration/examples/basic.nix - to /etc/nixos/configuration.nix). See for a list of the available configuration - options. The text editor nano is - available. + to /mnt/etc/nixos/configuration.nix). See + for a list of the available + configuration options. The text editors nano + and vim are available. In particular you need to specify a root file system in and the target device for the Grub boot loader in . + The command nixos-hardware-scan can + generate an initial configuration file for you, i.e., + + +$ mkdir -p /mnt/etc/nixos +$ nixos-hardware-scan > /mnt/etc/nixos/configuration.nix + + It tries to figure out the 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. + More examples of NixOS configurations for some actual machines can be found at . - + 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 CD again, mount the target file system on + /mnt, fix + /mnt/etc/nixos/configuration.nix and rerun + nixos-install.) + nixos-hardware-scan should figure out the + required modules in most cases. - Do the installation: + + + If your machine has a limited amount of memory, you + may want to activate swap devices now (swapon + device). The installer (or + rather, the build actions that it may spawn) may need quite a bit of + RAM, depending on your configuration. + + Optionally, you can run + + +$ nixos-checkout + + to make the installer use the latest NixOS/Nixpkgs sources from the + Subversion repository, rather than the sources on CD. + + Do the installation: $ nixos-install @@ -169,22 +215,95 @@ $ nixos-install $ reboot - You should now be able to boot into the installed NixOS. The Grub - boot menu shows a list of available + + + + + You should now be able to boot into the installed NixOS. + The Grub boot menu shows a list of available configurations (initially just one). Every time you - change the NixOS configuration, a new item appears in the menu. + change the NixOS configuration (see ), a new item appears in the menu. This allows you to go back easily to another configuration if something goes wrong. You should log in and change the root - password with passwd. + password with passwd. - + You’ll probably want to create some user accounts as well, + which can be done with useradd: + + +$ useradd -c 'Eelco Dolstra' -m eelco +$ passwd eelco + + + + You may also want to install some software. For instance, + + +$ nix-env -qa \* + + shows what packages are available, and + + +$ nix-env -i w3m + + install the w3m browser. + + - - + shows a typical sequence +of commands for installing NixOS on an empty hard drive (here +/dev/sda). shows a +corresponding configuration Nix expression. + + + +Commands for installing NixOS on <filename>/dev/sda</filename> + +$ fdisk /dev/sda (or whatever device you want to install on) +$ mke2fs -j -L nixos /dev/sda1 (idem) +$ mkswap -L swap /dev/sda2 (idem) +$ mount LABEL=nixos /mnt +$ mkdir -p /mnt/etc/nixos +$ nixos-hardware-scan > /mnt/etc/nixos/configuration.nix +$ nano /mnt/etc/nixos/configuration.nix +(in particular, set the fileSystems and swapDevices options) +$ nixos-install +$ reboot + + +NixOS configuration + +{ + boot = { + initrd = { + extraKernelModules = [ "ata_piix" ]; + }; + grubDevice = "/dev/sda"; + }; + + fileSystems = [ + { mountPoint = "/"; + label = "nixos"; + } + ]; + + swapDevices = [ + { label = "swap"; } + ]; + + services = { + sshd = { + enable = true; + }; + }; +} + + diff --git a/doc/manual/userconfiguration.xml b/doc/manual/userconfiguration.xml index b231cd1eadc..a285532d520 100644 --- a/doc/manual/userconfiguration.xml +++ b/doc/manual/userconfiguration.xml @@ -56,11 +56,11 @@ To have pidgin-latex plugin working after installation, you need the following: - + Symlink /var/run/current-system/sw/share/pidgin-latex/pidgin-latex.so to $HOME/.purple/plugins/pidgin-latex.so - - + + Enable smileys. If you do not want to, you can create $HOME/.purple/smileys/empty/theme with the following contents: @@ -69,10 +69,10 @@ Author=Nobody Enabling this theme will enable smileys, but define none. - - + + Enable the plugin. - + diff --git a/system/options.nix b/system/options.nix index 892003cf019..eed01824bf5 100644 --- a/system/options.nix +++ b/system/options.nix @@ -2071,7 +2071,7 @@ root ALL=(ALL) SETENV: ALL description = " There are some times when you want really small system for specific purpose and do not want default package list. Setting - cleanStart to true allows you + cleanStart to true allows you to create a system with empty path - only extraPackages will be included. ";