From 24e02c28fbf2b0efbc2fd6cdcd770037a6cff7e3 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 5 Jun 2015 22:41:55 +0200 Subject: system: 'hosts-file' is now a file-like object. Partly fixes . Reported by Alex Kost . * gnu/system.scm (default-/etc/hosts): Change 'text-file' to 'plain-file'. (maybe-file->monadic): New procedure. (operating-system-etc-directory): Use it. * doc/guix.texi (operating-system Reference, Networking Services): Adjust accordingly. --- doc/guix.texi | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'doc/guix.texi') diff --git a/doc/guix.texi b/doc/guix.texi index ecdfa1b1ce..f8da9c1224 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -4480,9 +4480,9 @@ The host name. @item @code{hosts-file} @cindex hosts file -A zero-argument monadic procedure that returns a text file for use as +A file-like object (@pxref{G-Expressions, file-like objects}) for use as @file{/etc/hosts} (@pxref{Host Names,,, libc, The GNU C Library -Reference Manual}). The default is to produce a file with entries for +Reference Manual}). The default is a file with entries for @code{localhost} and @var{host-name}. @item @code{mapped-devices} (default: @code{'()}) @@ -5299,9 +5299,9 @@ This variable is typically used in the @code{hosts-file} field of an (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)))) + (plain-file "hosts" + (string-append (local-host-aliases host-name) + %facebook-host-aliases)))) @end example This mechanism can prevent programs running locally, such as Web -- cgit v1.2.3