summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2017-02-08 15:32:28 +0100
committerLudovic Courtès <ludo@gnu.org>2017-02-08 16:17:05 +0100
commit387e175492f960d7d86f34f3b2e43938fa72dbf3 (patch)
treea12082201befe64989049c1c417752195f0381be /doc
parent618739b063dd0f8f33d0618cf64567aaaf86f4d7 (diff)
downloadpatches-387e175492f960d7d86f34f3b2e43938fa72dbf3.tar
patches-387e175492f960d7d86f34f3b2e43938fa72dbf3.tar.gz
services: Add 'special-files-service-type'.
* gnu/build/activation.scm (activate-/bin/sh): Remove. (activate-special-files): New procedure. * gnu/services.scm (activation-script): Remove call to 'activate-/bin/sh'. (special-files-service-type): New variable. (extra-special-file): New procedure. * gnu/services/base.scm (%base-services): Add SPECIAL-FILES-SERVICE-TYPE instance. * gnu/tests/base.scm (run-basic-test)[special-files]: New variables. ["special files"]: New test.
Diffstat (limited to 'doc')
-rw-r--r--doc/guix.texi44
1 files changed, 44 insertions, 0 deletions
diff --git a/doc/guix.texi b/doc/guix.texi
index 6acde6621b..21082aece4 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -8272,6 +8272,50 @@ this:
@end example
@end defvr
+@defvr {Scheme Variable} special-files-service-type
+This is the service that sets up ``special files'' such as
+@file{/bin/sh}; an instance of it is part of @code{%base-services}.
+
+The value associated with @code{special-files-service-type} services
+must be a list of tuples where the first element is the ``special file''
+and the second element is its target. By default it is:
+
+@cindex @file{/bin/sh}
+@cindex @file{sh}, in @file{/bin}
+@example
+`(("/bin/sh" ,(file-append @var{bash} "/bin/sh")))
+@end example
+
+@cindex @file{/usr/bin/env}
+@cindex @file{env}, in @file{/usr/bin}
+If you want to add, say, @code{/usr/bin/env} to your system, you can
+change it to:
+
+@example
+`(("/bin/sh" ,(file-append @var{bash} "/bin/sh"))
+ ("/usr/bin/env" ,(file-append @var{coreutils} "/bin/env")))
+@end example
+
+Since this is part of @code{%base-services}, you can use
+@code{modify-services} to customize the set of special files
+(@pxref{Service Reference, @code{modify-services}}). But the simple way
+to add a special file is @i{via} the @code{extra-special-file} procedure
+(see below.)
+@end defvr
+
+@deffn {Scheme Procedure} extra-special-file @var{file} @var{target}
+Use @var{target} as the ``special file'' @var{file}.
+
+For example, adding the following lines to the @code{services} field of
+your operating system declaration leads to a @file{/usr/bin/env}
+symlink:
+
+@example
+(extra-special-file "/usr/bin/env"
+ (file-append coreutils "/bin/env"))
+@end example
+@end deffn
+
@deffn {Scheme Procedure} host-name-service @var{name}
Return a service that sets the host name to @var{name}.
@end deffn