summaryrefslogtreecommitdiff
path: root/doc/guix.texi
diff options
context:
space:
mode:
Diffstat (limited to 'doc/guix.texi')
-rw-r--r--doc/guix.texi119
1 files changed, 107 insertions, 12 deletions
diff --git a/doc/guix.texi b/doc/guix.texi
index 7093bf7461..6acde6621b 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -452,6 +452,7 @@ If your host distro uses the Upstart init system:
@example
# ln -s ~root/.guix-profile/lib/upstart/system/guix-daemon.conf /etc/init/
+# initctl reload-configuration
# start guix-daemon
@end example
@@ -2336,7 +2337,9 @@ instance, when user @code{root} runs @command{guix pull}, this has no
effect on the version of Guix that user @code{alice} sees, and vice
versa@footnote{Under the hood, @command{guix pull} updates the
@file{~/.config/guix/latest} symbolic link to point to the latest Guix,
-and the @command{guix} command loads code from there.}.
+and the @command{guix} command loads code from there. Currently, the
+only way to roll back an invocation of @command{guix pull} is to
+manually update this symlink to point to the previous Guix.}.
The @command{guix pull} command is usually invoked with no arguments,
but it supports the following options:
@@ -3290,6 +3293,49 @@ specified with the @code{#:glib} parameter.
Both phases are executed after the @code{install} phase.
@end defvr
+@defvr {Scheme Variable} ocaml-build-system
+This variable is exported by @code{(guix build-sytem ocaml)}. It implements
+a build procedure for @uref{https://ocaml.org, OCaml} packages, which consists
+of choosing the correct set of commands to run for each package. OCaml
+packages can expect many different commands to be run. This build system will
+try some of them.
+
+When the package has a @file{setup.ml} file present at the top-level, it will
+run @code{ocaml setup.ml -configure}, @code{ocaml setup.ml -build} and
+@code{ocaml setup.ml -install}. The build system will assume that this file
+was generated by @uref{http://oasis.forge.ocamlcore.org/, OASIS} and will take
+care of setting the prefix and enabling tests if they are not disabled. You
+can pass configure and build flags with the @code{#:configure-flags} and
+@code{#:build-flags}. The @code{#:test-flags} key can be passed to change the
+set of flags used to enable tests. The @code{#:use-make?} key can be used to
+bypass this system in the build and install phases.
+
+When the package has a @file{configure} file, it is assumed that it is a
+hand-made configure script that requires a different argument format than
+in the @code{gnu-build-system}. You can add more flags with the
+@code{#:configure-flags} key.
+
+When the package has a @file{Makefile} file (or @code{#:use-make?} is
+@code{#t}), it will be used and more flags can be passed to the build and
+install phases with the @code{#:make-flags} key.
+
+Finally, some packages do not have these files and use a somewhat standard
+location for its build system. In that case, the build system will run
+@code{ocaml pkg/pkg.ml} or @code{ocaml pkg/build.ml} and take care of
+providing the path to the required findlib module. Additional flags can
+be passed via the @code{#:build-flags} key. Install is taken care of by
+@command{opam-installer}. In this case, the @code{opam} package must
+be added to the @code{native-inputs} field of the package definition.
+
+Note that most OCaml packages assume they will be installed in the same
+directory as OCaml, which is not what we want in guix. In particular, they
+will install @file{.so} files in their module's directory, which is usually
+fine because it is in the OCaml compiler directory. In guix though, these
+libraries cannot be found and we use @code{CAML_LD_LIBRARY_PATH}. This
+variable points to @file{lib/ocaml/site-lib/stubslibs} and this is where
+@file{.so} libraries should be installed.
+@end defvr
+
@defvr {Scheme Variable} python-build-system
This variable is exported by @code{(guix build-system python)}. It
implements the more or less standard build procedure used by Python
@@ -4510,7 +4556,7 @@ guix build --quiet --keep-going \
@var{package-or-derivation} may be either the name of a package found in
the software distribution such as @code{coreutils} or
-@code{coreutils-8.20}, or a derivation such as
+@code{coreutils@@8.20}, or a derivation such as
@file{/gnu/store/@dots{}-coreutils-8.19.drv}. In the former case, a
package with the corresponding name (and optionally version) is searched
for among the GNU distribution modules (@pxref{Package Modules}).
@@ -5670,7 +5716,7 @@ single output for a package that could easily be split (@pxref{Packages
with Multiple Outputs}). Such are the typical issues that
@command{guix size} can highlight.
-The command can be passed a package specification such as @code{gcc-4.8}
+The command can be passed a package specification such as @code{gcc@@4.8}
or @code{guile:debug}, or a file name in the store. Consider this
example:
@@ -7017,6 +7063,26 @@ mkswap /dev/sda2
swapon /dev/sda2
@end example
+Alternatively, you may use a swap file. For example, assuming that in
+the new system you want to use the file @file{/swapfile} as a swap file,
+you would run@footnote{This example will work for many types of file
+systems (e.g., ext4). However, for copy-on-write file systems (e.g.,
+btrfs), the required steps may be different. For details, see the
+manual pages for @command{mkswap} and @command{swapon}.}:
+
+@example
+# This is 10 GiB of swap space. Adjust "count" to change the size.
+dd if=/dev/zero of=/mnt/swapfile bs=1MiB count=10240
+# For security, make the file readable and writable only by root.
+chmod 600 /mnt/swapfile
+mkswap /mnt/swapfile
+swapon /mnt/swapfile
+@end example
+
+Note that if you have encrypted the root partition and created a swap
+file in its file system as described above, then the encryption also
+protects the swap file, just like any other file in that file system.
+
@node Proceeding with the Installation
@subsection Proceeding with the Installation
@@ -7119,8 +7185,8 @@ disk image, follow these steps:
@enumerate
@item
-First, retrieve the GuixSD installation image as described previously
-(@pxref{USB Stick Installation}).
+First, retrieve and decompress the GuixSD installation image as
+described previously (@pxref{USB Stick Installation}).
@item
Create a disk image that will hold the installed system. To make a
@@ -7137,7 +7203,7 @@ Boot the USB installation image in an VM:
@example
qemu-system-x86_64 -m 1024 -smp 1 \
- -net default -net nic,model=virtio -boot menu=on \
+ -net user -net nic,model=virtio -boot menu=on \
-drive file=guixsd.img \
-drive file=guixsd-usb-install-@value{VERSION}.@var{system}
@end example
@@ -7470,9 +7536,12 @@ A list of file systems. @xref{File Systems}.
@item @code{swap-devices} (default: @code{'()})
@cindex swap devices
-A list of strings identifying devices to be used for ``swap space''
-(@pxref{Memory Concepts,,, libc, The GNU C Library Reference Manual}).
-For example, @code{'("/dev/sda3")}.
+A list of strings identifying devices or files to be used for ``swap
+space'' (@pxref{Memory Concepts,,, libc, The GNU C Library Reference
+Manual}). For example, @code{'("/dev/sda3")} or @code{'("/swapfile")}.
+It is possible to specify a swap file in a file system on a mapped
+device, provided that the necessary device mapping and file system are
+also specified. @xref{Mapped Devices} and @ref{File Systems}.
@item @code{users} (default: @code{%base-user-accounts})
@itemx @code{groups} (default: @var{%base-groups})
@@ -7815,6 +7884,13 @@ and use it as follows:
(type luks-device-mapping))
@end example
+@cindex swap encryption
+It is also desirable to encrypt swap space, since swap space may contain
+sensitive data. One way to accomplish that is to use a swap file in a
+file system on a device mapped via LUKS encryption. In this way, the
+swap file is encrypted because the entire device is encrypted.
+@xref{Preparing for Installation,,Disk Partitioning}, for an example.
+
A RAID device formed of the partitions @file{/dev/sda1} and @file{/dev/sdb1}
may be declared as follows:
@@ -8742,11 +8818,21 @@ Return a service that runs @var{dhcp}, a Dynamic Host Configuration
Protocol (DHCP) client, on all the non-loopback network interfaces.
@end deffn
+@defvr {Scheme Variable} static-networking-service-type
+This is the type for statically-configured network interfaces.
+@c TODO Document <static-networking> data structures.
+@end defvr
+
@deffn {Scheme Procedure} static-networking-service @var{interface} @var{ip} @
[#:netmask #f] [#:gateway #f] [#:name-servers @code{'()}]
Return a service that starts @var{interface} with address @var{ip}. If
@var{netmask} is true, use it as the network mask. If @var{gateway} is true,
it must be a string specifying the default network gateway.
+
+This procedure can be called several times, one for each network
+interface of interest. Behind the scenes what it does is extend
+@code{static-networking-service-type} with additional network interfaces
+to handle.
@end deffn
@cindex wicd
@@ -9288,6 +9374,7 @@ makes the good ol' XlockMore usable.
@node Printing Services
@subsubsection Printing Services
+@cindex printer support with CUPS
The @code{(gnu services cups)} module provides a Guix service definition
for the CUPS printing service. To add printer support to a GuixSD
system, add a @code{cups-service} to the operating system definition:
@@ -9308,13 +9395,17 @@ as GNOME's printer configuration services. By default, configuring a
CUPS service will generate a self-signed certificate if needed, for
secure connections to the print server.
-One way you might want to customize CUPS is to enable or disable the web
-interface. You can do that directly, like this:
+Suppose you want to enable the Web interface of CUPS and also add
+support for HP printers @i{via} the @code{hplip} package. You can do
+that directly, like this (you need to use the @code{(gnu packages cups)}
+module):
@example
(service cups-service-type
(cups-configuration
- (web-interface? #f)))
+ (web-interface? #t)
+ (extensions
+ (list cups-filters hplip))))
@end example
The available configuration parameters follow. Each parameter
@@ -13055,6 +13146,10 @@ from source.
@item @code{one-shot?} (default: @code{#f})
Only evaluate specifications and build derivations once.
+@item @code{load-path} (default: @code{'()})
+This allows users to define their own packages and make them visible to
+cuirass as in @command{guix build} command.
+
@item @code{cuirass} (default: @code{cuirass})
The Cuirass package to use.
@end table