summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2014-10-07 21:33:12 +0200
committerLudovic Courtès <ludo@gnu.org>2014-10-07 23:18:41 +0200
commitfa0c1d610444067001faaad204b25fa112fdc838 (patch)
treef4963ee4ea981e860d17ca8c11336fe4acc69594 /doc
parent568841d4910df8ce904959b843c0c3559f282450 (diff)
services: Add '%facebook-host-aliases'.
* gnu/services/networking.scm (%facebook-host-aliases): New variable. * doc/guix.texi (Networking Services): Document it.
Diffstat (limited to 'doc')
-rw-r--r--doc/guix.texi29
1 files changed, 29 insertions, 0 deletions
diff --git a/doc/guix.texi b/doc/guix.texi
index ac2aad643c..583bdbf621 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -3610,6 +3610,35 @@ root.
The other options should be self-descriptive.
@end deffn
+@defvr {Scheme Variable} %facebook-host-aliases
+This variable contains a string for use in @file{/etc/hosts}
+(@pxref{Host Names,,, libc, The GNU C Library Reference Manual}). Each
+line contains a entry that maps a known server name of the Facebook
+on-line service---e.g., @code{www.facebook.com}---to the local
+host---@code{127.0.0.1} or its IPv6 equivalent, @code{::1}.
+
+This variable is typically used in the @code{hosts-file} field of an
+@code{operating-system} declaration (@pxref{Using the Configuration
+System}):
+
+@example
+(use-modules (gnu) (guix))
+
+(operating-system
+ (host-name "mymachine")
+ ;; ...
+ (hosts-file
+ ;; Create a /etc/hosts file with aliases for "localhost"
+ ;; and "mymachine", as well as for Facebook servers.
+ (text-file "hosts"
+ (string-append (local-host-aliases host-name)
+ %facebook-host-aliases))))
+@end example
+
+This mechanism can prevent programs running locally, such as Web
+browsers, from accessing Facebook.
+@end defvr
+
@node X Window
@subsubsection X Window