From c0d2e7b197a3c511eb1bf60b61ee6fdc673e36f4 Mon Sep 17 00:00:00 2001 From: Mathieu Lirzin Date: Tue, 24 May 2016 13:06:21 +0200 Subject: build: Use "%D%" in Makefile fragments. * doc/local.mk: Use "%D%" for the directory of the fragment relative to the base 'Makefile.am'. * emacs/local.mk: Likewise. * gnu/local.mk: Likewise. * nix/local.mk: Likewise. --- doc/local.mk | 84 ++++++++++++++++++++++++++++++------------------------------ 1 file changed, 42 insertions(+), 42 deletions(-) (limited to 'doc') diff --git a/doc/local.mk b/doc/local.mk index b9f07c3590..64bd2a5169 100644 --- a/doc/local.mk +++ b/doc/local.mk @@ -20,49 +20,49 @@ # You should have received a copy of the GNU General Public License # along with GNU Guix. If not, see . -info_TEXINFOS = doc/guix.texi +info_TEXINFOS = %D%/guix.texi DOT_FILES = \ - doc/images/bootstrap-graph.dot \ - doc/images/bootstrap-packages.dot \ - doc/images/coreutils-graph.dot \ - doc/images/coreutils-bag-graph.dot \ - doc/images/service-graph.dot \ - doc/images/shepherd-graph.dot + %D%/images/bootstrap-graph.dot \ + %D%/images/bootstrap-packages.dot \ + %D%/images/coreutils-graph.dot \ + %D%/images/coreutils-bag-graph.dot \ + %D%/images/service-graph.dot \ + %D%/images/shepherd-graph.dot DOT_VECTOR_GRAPHICS = \ $(DOT_FILES:%.dot=%.eps) \ $(DOT_FILES:%.dot=%.pdf) EXTRA_DIST += \ - doc/htmlxref.cnf \ - doc/contributing.texi \ - doc/emacs.texi \ - doc/fdl-1.3.texi \ + %D%/htmlxref.cnf \ + %D%/contributing.texi \ + %D%/emacs.texi \ + %D%/fdl-1.3.texi \ $(DOT_FILES) \ $(DOT_VECTOR_GRAPHICS) \ - doc/images/coreutils-size-map.eps \ - doc/environment-gdb.scm \ - doc/package-hello.scm + %D%/images/coreutils-size-map.eps \ + %D%/environment-gdb.scm \ + %D%/package-hello.scm OS_CONFIG_EXAMPLES_TEXI = \ - doc/os-config-bare-bones.texi \ - doc/os-config-desktop.texi \ - doc/os-config-lightweight-desktop.texi + %D%/os-config-bare-bones.texi \ + %D%/os-config-desktop.texi \ + %D%/os-config-lightweight-desktop.texi # Bundle this file so that makeinfo finds it in out-of-source-tree builds. BUILT_SOURCES += $(OS_CONFIG_EXAMPLES_TEXI) EXTRA_DIST += $(OS_CONFIG_EXAMPLES_TEXI) MAINTAINERCLEANFILES = $(OS_CONFIG_EXAMPLES_TEXI) -doc/os-config-%.texi: gnu/system/examples/%.tmpl +%D%/os-config-%.texi: gnu/system/examples/%.tmpl $(AM_V_GEN)$(MKDIR_P) "`dirname $@`"; \ cp "$<" "$@" infoimagedir = $(infodir)/images dist_infoimage_DATA = \ $(DOT_FILES:%.dot=%.png) \ - doc/images/coreutils-size-map.png + %D%/images/coreutils-size-map.png # Try hard to obtain an image size and aspect that's reasonable for inclusion # in an Info or PDF document. @@ -86,13 +86,13 @@ DOT_OPTIONS = \ $(AM_V_GEN)convert "$<" "$@-tmp.eps"; \ mv "$@-tmp.eps" "$@" -# We cannot add new dependencies to `doc/guix.pdf' & co. (info "(automake) +# We cannot add new dependencies to `%D%/guix.pdf' & co. (info "(automake) # Extending"). Using the `-local' rules is imperfect, because they may be # triggered after the main rule. Oh, well. pdf-local: $(DOT_FILES=%.dot=$(top_srcdir)/%.pdf) info-local: $(DOT_FILES=%.dot=$(top_srcdir)/%.png) ps-local: $(DOT_FILES=%.dot=$(top_srcdir)/%.eps) \ - $(top_srcdir)/doc/images/coreutils-size-map.eps + $(top_srcdir)/%D%/images/coreutils-size-map.eps dvi-local: ps-local ## ----------- ## @@ -106,25 +106,25 @@ dvi-local: ps-local # They are built in $(srcdir) like info manuals. sub_commands_mans = \ - $(srcdir)/doc/guix-archive.1 \ - $(srcdir)/doc/guix-build.1 \ - $(srcdir)/doc/guix-challenge.1 \ - $(srcdir)/doc/guix-download.1 \ - $(srcdir)/doc/guix-edit.1 \ - $(srcdir)/doc/guix-environment.1 \ - $(srcdir)/doc/guix-gc.1 \ - $(srcdir)/doc/guix-hash.1 \ - $(srcdir)/doc/guix-import.1 \ - $(srcdir)/doc/guix-lint.1 \ - $(srcdir)/doc/guix-package.1 \ - $(srcdir)/doc/guix-publish.1 \ - $(srcdir)/doc/guix-pull.1 \ - $(srcdir)/doc/guix-refresh.1 \ - $(srcdir)/doc/guix-size.1 \ - $(srcdir)/doc/guix-system.1 + $(srcdir)/%D%/guix-archive.1 \ + $(srcdir)/%D%/guix-build.1 \ + $(srcdir)/%D%/guix-challenge.1 \ + $(srcdir)/%D%/guix-download.1 \ + $(srcdir)/%D%/guix-edit.1 \ + $(srcdir)/%D%/guix-environment.1 \ + $(srcdir)/%D%/guix-gc.1 \ + $(srcdir)/%D%/guix-hash.1 \ + $(srcdir)/%D%/guix-import.1 \ + $(srcdir)/%D%/guix-lint.1 \ + $(srcdir)/%D%/guix-package.1 \ + $(srcdir)/%D%/guix-publish.1 \ + $(srcdir)/%D%/guix-pull.1 \ + $(srcdir)/%D%/guix-refresh.1 \ + $(srcdir)/%D%/guix-size.1 \ + $(srcdir)/%D%/guix-system.1 dist_man1_MANS = \ - $(srcdir)/doc/guix.1 \ + $(srcdir)/%D%/guix.1 \ $(sub_commands_mans) gen_man = \ @@ -133,14 +133,14 @@ gen_man = \ HELP2MANFLAGS = --source=GNU --info-page=$(PACKAGE_TARNAME) -$(srcdir)/doc/guix.1: scripts/guix.in $(sub_commands_mans) +$(srcdir)/%D%/guix.1: scripts/guix.in $(sub_commands_mans) -$(AM_V_HELP2MAN)$(gen_man) --output="$@" `basename "$@" .1` # The 'case' ensures the man pages are only generated if the corresponding # source script (the first prerequisite) has been changed. The $(GOBJECTS) # prerequisite is solely meant to force these docs to be made only after all # Guile modules have been compiled. -$(srcdir)/doc/guix-%.1: guix/scripts/%.scm $(GOBJECTS) +$(srcdir)/%D%/guix-%.1: guix/scripts/%.scm $(GOBJECTS) -@case '$?' in \ *$<*) $(AM_V_P) && set -x || echo " HELP2MAN $@"; \ $(gen_man) --output="$@" "guix $*";; \ @@ -149,9 +149,9 @@ $(srcdir)/doc/guix-%.1: guix/scripts/%.scm $(GOBJECTS) if BUILD_DAEMON -dist_man1_MANS += $(srcdir)/doc/guix-daemon.1 +dist_man1_MANS += $(srcdir)/%D%/guix-daemon.1 -$(srcdir)/doc/guix-daemon.1: nix/nix-daemon/guix-daemon.cc +$(srcdir)/%D%/guix-daemon.1: nix/nix-daemon/guix-daemon.cc -$(AM_V_HELP2MAN)$(gen_man) --output="$@" `basename "$@" .1` endif -- cgit v1.2.3 From db761534df3b57122da8e8b05a678182b59a9d3a Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 24 May 2016 21:37:13 +0200 Subject: size: Accept several arguments. * guix/scripts/size.scm (display-profile): Display WHOLE at then end. (guix-size): Accept several FILES. * doc/guix.texi (Invoking guix size): Add example with several items. --- doc/guix.texi | 18 ++++++++++++++++++ guix/scripts/size.scm | 14 +++++++------- 2 files changed, 25 insertions(+), 7 deletions(-) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index d88cc256d7..1b47193e1f 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -5058,6 +5058,24 @@ reports information based on the available substitutes (@pxref{Substitutes}). This makes it possible it to profile disk usage of store items that are not even on disk, only available remotely. +You can also specify several package names: + +@example +$ guix size coreutils grep sed bash +store item total self +/gnu/store/@dots{}-coreutils-8.24 77.8 13.8 13.4% +/gnu/store/@dots{}-grep-2.22 73.1 0.8 0.8% +/gnu/store/@dots{}-bash-4.3.42 72.3 4.7 4.6% +/gnu/store/@dots{}-readline-6.3 67.6 1.2 1.2% +@dots{} +total: 102.3 MiB +@end example + +@noindent +In this example we see that the combination of the four packages takes +102.3@tie{}MiB in total, which is much less than the sum of each closure +since they have a lot of dependencies in common. + The available options are: @table @option diff --git a/guix/scripts/size.scm b/guix/scripts/size.scm index 8a7974729b..843213834e 100644 --- a/guix/scripts/size.scm +++ b/guix/scripts/size.scm @@ -91,7 +91,8 @@ if ITEM is not in the store." (sort profile (match-lambda* ((($ _ _ total1) ($ _ _ total2)) - (> total1 total2))))))) + (> total1 total2))))) + (format port (_ "total: ~,1f MiB~%") (/ whole MiB 1.)))) (define display-profile* (lift display-profile %store-monad)) @@ -280,7 +281,7 @@ Report the size of PACKAGE and its dependencies.\n")) (match files (() (leave (_ "missing store item argument\n"))) - ((file) + ((files ..1) (leave-on-EPIPE ;; Turn off grafts because (1) hydra.gnu.org does not serve grafted ;; packages, and (2) they do not make any difference on the @@ -292,13 +293,12 @@ Report the size of PACKAGE and its dependencies.\n")) #:substitute-urls urls) (run-with-store store - (mlet* %store-monad ((item (ensure-store-item file)) - (profile (store-profile (list item)))) + (mlet* %store-monad ((items (mapm %store-monad + ensure-store-item files)) + (profile (store-profile items))) (if map-file (begin (profile->page-map profile map-file) (return #t)) (display-profile* profile))) - #:system system))))) - ((files ...) - (leave (_ "too many arguments\n"))))))) + #:system system))))))))) -- cgit v1.2.3 From 70458ed510d8bae5b5bd50e2aabf607b20198cf4 Mon Sep 17 00:00:00 2001 From: Mathieu Lirzin Date: Thu, 26 May 2016 14:22:26 +0200 Subject: doc: Fix typo. * doc/guix.texi (Derivations): Add 's' to "contain". --- doc/guix.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index 1b47193e1f..bb75425a9f 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -3082,7 +3082,7 @@ Store Monad}). @cindex derivations Low-level build actions and the environment in which they are performed -are represented by @dfn{derivations}. A derivation contain the +are represented by @dfn{derivations}. A derivation contains the following pieces of information: @itemize -- cgit v1.2.3 From a535e1222665f3fe5e195573649b7000e8bc9d34 Mon Sep 17 00:00:00 2001 From: Leo Famulari Date: Sat, 28 May 2016 13:41:21 -0400 Subject: services: Add urandom-seed-service. Fixes . * gnu/services/base.scm (urandom-seed-service): New procedure. (%random-seed-file, urandom-seed-service-type): New variables. (%urandom-seed-shepherd-service): New procedure. (%base-services): Call 'urandom-seed-service'. * doc/guix.texi (Base Services): Document it. --- doc/guix.texi | 11 +++++++++ gnu/services/base.scm | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 72 insertions(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index bb75425a9f..01363c1d13 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -7355,6 +7355,17 @@ Return a service that runs the Guix build daemon according to Run @var{udev}, which populates the @file{/dev} directory dynamically. @end deffn +@deffn {Scheme Procedure} urandom-seed-service @var{#f} +Save some entropy in @var{%random-seed-file} to seed @file{/dev/urandom} +when rebooting. +@end deffn + +@defvr {Scheme Variable} %random-seed-file +This is the name of the file where some random bytes are saved by +@var{urandom-seed-service} to seed @file{/dev/urandom} when rebooting. +It defaults to @file{/var/lib/random-seed}. +@end defvr + @deffn {Scheme Procedure} console-keymap-service @var{files} ... @cindex keyboard layout Return a service to load console keymaps from @var{files} using diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 96bf8da02a..a45f219643 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2015, 2016 Alex Kost ;;; Copyright © 2015 Mark H Weaver ;;; Copyright © 2015 Sou Bunnbu +;;; Copyright © 2016 Leo Famulari ;;; ;;; This file is part of GNU Guix. ;;; @@ -93,6 +94,8 @@ gpm-service-type gpm-service + urandom-seed-service + %base-services)) ;;; Commentary: @@ -420,6 +423,63 @@ stopped before 'kill' is called." (service user-processes-service-type (list (filter file-system-mount? file-systems) grace-delay))) + +;;; +;;; Preserve entropy to seed /dev/urandom on boot. +;;; + +(define %random-seed-file + "/var/lib/random-seed") + +(define %urandom-seed-activation + ;; Activation gexp for the urandom seed + #~(begin + (use-modules (guix build utils)) + + (mkdir-p (dirname #$%random-seed-file)) + (close-port (open-file #$%random-seed-file "a0b")) + (chmod #$%random-seed-file #o600))) + +(define (urandom-seed-shepherd-service _) + "Return a shepherd service for the /dev/urandom seed." + (list (shepherd-service + (documentation "Preserve entropy across reboots for /dev/urandom.") + (provision '(urandom-seed)) + (requirement '(user-processes)) + (start #~(lambda _ + ;; On boot, write random seed into /dev/urandom. + (when (file-exists? #$%random-seed-file) + (call-with-input-file #$%random-seed-file + (lambda (seed) + (call-with-output-file "/dev/urandom" + (lambda (urandom) + (dump-port seed urandom)))))) + #t)) + (stop #~(lambda _ + ;; During shutdown, write from /dev/urandom into random seed. + (let ((buf (make-bytevector 512))) + (call-with-input-file "/dev/urandom" + (lambda (urandom) + (get-bytevector-n! urandom buf 0 512) + (call-with-output-file #$%random-seed-file + (lambda (seed) + (put-bytevector seed buf))) + #t))))) + (modules `((rnrs bytevectors) + (rnrs io ports) + ,@%default-modules))))) + +(define urandom-seed-service-type + (service-type (name 'urandom-seed) + (extensions + (list (service-extension shepherd-root-service-type + urandom-seed-shepherd-service) + (service-extension activation-service-type + (const %urandom-seed-activation)))))) + +(define (urandom-seed-service) + (service urandom-seed-service-type #f)) + ;;; ;;; System-wide environment variables. @@ -1200,7 +1260,6 @@ extra rules from the packages listed in @var{rules}." "Return a service that uses @var{device} as a swap device." (service swap-service-type device)) - (define-record-type* gpm-configuration make-gpm-configuration gpm-configuration? (gpm gpm-configuration-gpm) ;package @@ -1281,6 +1340,7 @@ This is the GNU operating system, welcome!\n\n"))) (static-networking-service "lo" "127.0.0.1" #:provision '(loopback)) (syslog-service) + (urandom-seed-service) (guix-service) (nscd-service) -- cgit v1.2.3 From 7f3b2510d6b050b8fb0974fa0cd7a164ac51f6d1 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 12 Jan 2016 16:44:26 +0100 Subject: daemon: check: Keep the differing output if -K is given. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This makes it easier to investigate the non-determinism, e.g. $ nix-build pkgs/stdenv/linux -A stage1.pkgs.zlib --check -K error: derivation ‘/nix/store/l54i8wlw22656i4pk05c52ngv9rpl39q-zlib-1.2.8.drv’ may not be deterministic: output ‘/nix/store/11a27shh6n2ivi4a7s964i65ql80cf27-zlib-1.2.8’ differs from ‘/nix/store/11a27shh6n2ivi4a7s964i65ql80cf27-zlib-1.2.8-check’ $ diffoscope /nix/store/11a27shh6n2ivi4a7s964i65ql80cf27-zlib-1.2.8 /nix/store/11a27shh6n2ivi4a7s964i65ql80cf27-zlib-1.2.8-check ... ├── lib/libz.a │ ├── metadata │ │ @@ -1,15 +1,15 @@ │ │ -rw-r--r-- 30001/30000 3096 Jan 12 15:20 2016 adler32.o ... │ │ +rw-r--r-- 30001/30000 3096 Jan 12 15:28 2016 adler32.o ... Co-authored-by: Ludovic Courtès --- doc/guix.texi | 4 ++++ nix/libstore/build.cc | 14 ++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index 01363c1d13..cd4e550ef3 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -4332,6 +4332,10 @@ substitutes are genuine (@pxref{Substitutes}), or whether the build result of a package is deterministic. @xref{Invoking guix challenge}, for more background information and tools. +When used in conjunction with @option{--keep-failed}, the differing +output is kept in the store, under @file{/gnu/store/@dots{}-check}. +This makes it easy to look for differences between the two results. + @item --derivations @itemx -d Return the derivation paths, not the output paths, of the given diff --git a/nix/libstore/build.cc b/nix/libstore/build.cc index dd8660dffe..d51705b48f 100644 --- a/nix/libstore/build.cc +++ b/nix/libstore/build.cc @@ -2431,8 +2431,18 @@ void DerivationGoal::registerOutputs() if (buildMode == bmCheck) { if (!store->isValidPath(path)) continue; ValidPathInfo info = worker.store.queryPathInfo(path); - if (hash.first != info.hash) - throw Error(format("derivation `%1%' may not be deterministic: hash mismatch in output `%2%'") % drvPath % path); + if (hash.first != info.hash) { + if (settings.keepFailed) { + Path dst = path + "-check"; + if (pathExists(dst)) deletePath(dst); + if (rename(actualPath.c_str(), dst.c_str())) + throw SysError(format("renaming `%1%' to `%2%'") % actualPath % dst); + throw Error(format("derivation `%1%' may not be deterministic: output `%2%' differs from ‘%3%’") + % drvPath % path % dst); + } else + throw Error(format("derivation `%1%' may not be deterministic: output `%2%' differs") + % drvPath % path); + } continue; } -- cgit v1.2.3 From b4528110c647b6fe9389730826941bea05801394 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 12 Jan 2016 18:25:57 +0100 Subject: daemon: rounds: Keep the differing output if -K is given. Regardless of -K, we now also print which output differs. --- doc/guix.texi | 4 ++++ nix/libstore/build.cc | 45 ++++++++++++++++++++++++++++++++++++++------- 2 files changed, 42 insertions(+), 7 deletions(-) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index cd4e550ef3..4222e011e5 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -998,6 +998,10 @@ consecutive build results are not bit-for-bit identical. Note that this setting can be overridden by clients such as @command{guix build} (@pxref{Invoking guix build}). +When used in conjunction with @option{--keep-failed}, the differing +output is kept in the store, under @file{/gnu/store/@dots{}-check}. +This makes it easy to look for differences between the two results. + @item --debug Produce debugging output. diff --git a/nix/libstore/build.cc b/nix/libstore/build.cc index d51705b48f..2d3960bf89 100644 --- a/nix/libstore/build.cc +++ b/nix/libstore/build.cc @@ -2320,6 +2320,8 @@ void DerivationGoal::registerOutputs() outputs to allow hard links between outputs. */ InodesSeen inodesSeen; + Path checkSuffix = "-check"; + /* Check whether the output paths were created, and grep each output path to determine what other paths it references. Also make all output paths read-only. */ @@ -2433,7 +2435,7 @@ void DerivationGoal::registerOutputs() ValidPathInfo info = worker.store.queryPathInfo(path); if (hash.first != info.hash) { if (settings.keepFailed) { - Path dst = path + "-check"; + Path dst = path + checkSuffix; if (pathExists(dst)) deletePath(dst); if (rename(actualPath.c_str(), dst.c_str())) throw SysError(format("renaming `%1%' to `%2%'") % actualPath % dst); @@ -2487,9 +2489,11 @@ void DerivationGoal::registerOutputs() checkRefs("disallowedReferences", false, false); checkRefs("disallowedRequisites", false, true); - worker.store.optimisePath(path); // FIXME: combine with scanForReferences() + if (curRound == nrRounds) { + worker.store.optimisePath(path); // FIXME: combine with scanForReferences() - worker.store.markContentsGood(path); + worker.store.markContentsGood(path); + } ValidPathInfo info; info.path = path; @@ -2502,10 +2506,37 @@ void DerivationGoal::registerOutputs() if (buildMode == bmCheck) return; - if (curRound > 1 && prevInfos != infos) - throw NotDeterministic( - format("result of ‘%1%’ differs from previous round; rejecting as non-deterministic") - % drvPath); + /* Compare the result with the previous round, and report which + path is different, if any.*/ + if (curRound > 1 && prevInfos != infos) { + assert(prevInfos.size() == infos.size()); + for (auto i = prevInfos.begin(), j = infos.begin(); i != prevInfos.end(); ++i, ++j) + if (!(*i == *j)) { + Path prev = i->path + checkSuffix; + if (pathExists(prev)) + throw NotDeterministic( + format("output ‘%1%’ of ‘%2%’ differs from ‘%3%’ from previous round") + % i->path % drvPath % prev); + else + throw NotDeterministic( + format("output ‘%1%’ of ‘%2%’ differs from previous round") + % i->path % drvPath); + } + assert(false); // shouldn't happen + } + + if (settings.keepFailed) { + for (auto & i : drv.outputs) { + Path prev = i.second.path + checkSuffix; + if (pathExists(prev)) deletePath(prev); + if (curRound < nrRounds) { + Path dst = i.second.path + checkSuffix; + if (rename(i.second.path.c_str(), dst.c_str())) + throw SysError(format("renaming ‘%1%’ to ‘%2%’") % i.second.path % dst); + } + } + + } if (curRound < nrRounds) { prevInfos = infos; -- cgit v1.2.3 From b2e13aa287ef366aa6374dc915520199ef5589ad Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 1 Jun 2016 22:08:29 +0200 Subject: doc: Suggest pgp.mit.edu. * doc/guix.texi (Binary Installation): Use pgp.mit.edu instead of keys.gnupg.net, which seems to be dead. --- doc/guix.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index 4222e011e5..dc61aa8537 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -375,7 +375,7 @@ If that command fails because you do not have the required public key, then run this command to import it: @example -$ gpg --keyserver keys.gnupg.net --recv-keys 090B11993D9AEBB5 +$ gpg --keyserver pgp.mit.edu --recv-keys 090B11993D9AEBB5 @end example @noindent -- cgit v1.2.3 From d23ef788b3fff804d017247c4fee170b693c533d Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 1 Jun 2016 22:56:33 +0200 Subject: doc: Clarify non-interference when installed on a foreign distro. Suggested by Hartmut Goebel . * doc/guix.texi (Installation): Add paragraph explaining that files live in two directories. --- doc/guix.texi | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index dc61aa8537..2cd30f6f86 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -336,6 +336,13 @@ manager, which can be done on top of a running GNU/Linux system. If, instead, you want to install the complete GNU operating system, @pxref{System Installation}. +@cindex foreign distro +When installed on a running GNU/Linux system---thereafter called a +@dfn{foreign distro}---GNU@tie{}Guix complements the available tools +without interference. Its data lives exclusively in two directories, +usually @file{/gnu/store} and @file{/var/guix}; other files on your +system, such as @file{/etc}, are left untouched. + @menu * Binary Installation:: Getting Guix running in no time! * Requirements:: Software needed to build and run Guix. @@ -1096,6 +1103,7 @@ daemons on the same machine. @node Application Setup @section Application Setup +@cindex foreign distro When using Guix on top of GNU/Linux distribution other than GuixSD---a so-called @dfn{foreign distro}---a few additional steps are needed to get everything in place. Here are some of them. -- cgit v1.2.3 From 99c866a0bbe48b1c5c1558f7dd870bac85dcf0ad Mon Sep 17 00:00:00 2001 From: Hartmut Goebel Date: Sun, 29 May 2016 19:05:40 +0200 Subject: doc: Update specification for Python packages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * doc/guix.texi (Python Packages): Add rule for packages with upstream name starting with "py". Signed-off-by: Ludovic Courtès --- doc/guix.texi | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index 2cd30f6f86..6d47976378 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -11113,7 +11113,9 @@ packages with the corresponding names. If a project already contains the word @code{python}, we drop this; for instance, the module python-dateutil is packaged under the names -@code{python-dateutil} and @code{python2-dateutil}. +@code{python-dateutil} and @code{python2-dateutil}. If the project name +starts with @code{py} (e.g. @code{pytz}), we keep it and prefix it as +described above. @node Perl Modules -- cgit v1.2.3 From 0e69cf67cb07a2f955bdebed19aec63d1d28a635 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 3 Jun 2016 09:53:46 +0200 Subject: doc: Explain that packages can be installed in the installation system. * doc/guix.texi (Preparing for Installation): Add paragraph about package installation in the installation system. --- doc/guix.texi | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index 6d47976378..c8c755580a 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -5982,6 +5982,11 @@ dependencies of your system configuration can be downloaded. See the ``Networking'' section below. @end quotation +The installation system includes many common tools needed for this task. +But it is also a full-blown GuixSD system, which means that you can +install additional packages, should you need it, using @command{guix +package} (@pxref{Invoking guix package}). + @subsubsection Keyboard Layout @cindex keyboard layout -- cgit v1.2.3 From 1713c37f835a0566a47d76d2379b2d0b12c0b548 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 4 Jun 2016 22:38:11 +0200 Subject: doc: Mention the 'ip' command. Suggested by Alex Kost . * doc/guix.texi (Preparing for Installation): Mention 'ip'. --- doc/guix.texi | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index c8c755580a..12dd3541f0 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -6010,6 +6010,13 @@ Run the following command see what your network interfaces are called: ifconfig -a @end example +@noindent +@dots{} or, using the GNU/Linux-specific @command{ip} command: + +@example +ip a +@end example + @c http://cgit.freedesktop.org/systemd/systemd/tree/src/udev/udev-builtin-net_id.c#n20 Wired interfaces have a name starting with @samp{e}; for example, the interface corresponding to the first on-board Ethernet controller is -- cgit v1.2.3 From c3d38b2b9d91f5632436eb74809622bc9f1ac6d1 Mon Sep 17 00:00:00 2001 From: 宋文武 Date: Fri, 3 Jun 2016 22:30:00 +0800 Subject: gnu: services: Add dicod-service. * gnu/services/dict.scm: New file. * gnu/local.mk (GNU_SYSTEM_MODULES): Add it. * doc/guix.texi (Various Services): Document it. --- doc/guix.texi | 49 +++++++++++++++++++ gnu/local.mk | 1 + gnu/services/dict.scm | 131 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 181 insertions(+) create mode 100644 gnu/services/dict.scm (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index 12dd3541f0..b9bf986640 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -9395,6 +9395,55 @@ Finally, @var{extra-options} is a list of additional command-line options passed to @command{lircd}. @end deffn +@subsubsection Dictionary Services +The @code{(gnu services dict)} module provides the following service: + +@deffn {Scheme Procedure} dicod-service [#:config (dicod-configuration)] +Return a service that runs the @command{dicod} daemon, an implementation +of DICT server (@pxref{Dicod,,, dico, GNU Dico Manual}). + +The optional @var{config} argument specifies the configuration for +@command{dicod}, which should be a @code{} object, by +default it serves the GNU Collaborative International Dictonary of English. + +You can add @command{open localhost} to your @file{~/.dico} file to make +@code{localhost} the default server for @command{dico} client +(@pxref{Initialization File,,, dico, GNU Dico Manual}). +@end deffn + +@deftp {Data Type} dicod-configuration +Data type representing the configuration of dicod. + +@table @asis +@item @code{dico} (default: @var{dico}) +Package object of the GNU Dico dictionary server. + +@item @code{databases} (default: @var{(list %dicod-database:gcide)}) +List of @code{} objects denoting dictionaries to be served. +@end table +@end deftp + +@deftp {Data Type} dicod-database +Data type representing a dictionary database. + +@table @asis +@item @code{name} +Name of the database, will be used in DICT commands. + +@item @code{module} +Name of the dicod module used by this database +(@pxref{Modules,,, dico, GNU Dico Manual}). + +@item @code{options} +List of strings or gexps representing the arguments for the module handler +(@pxref{Handlers,,, dico, GNU Dico Manual}). +@end table +@end deftp + +@defvr {Scheme Variable} %dicod-database:gcide +A @code{} object serving the GNU Collaborative International +Dictonary of English using the @code{gcide} package. +@end defvr @node Setuid Programs @subsection Setuid Programs diff --git a/gnu/local.mk b/gnu/local.mk index c3a3ea47b5..d3e72629bc 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -374,6 +374,7 @@ GNU_SYSTEM_MODULES = \ %D%/services/databases.scm \ %D%/services/dbus.scm \ %D%/services/desktop.scm \ + %D%/services/dict.scm \ %D%/services/lirc.scm \ %D%/services/mail.scm \ %D%/services/networking.scm \ diff --git a/gnu/services/dict.scm b/gnu/services/dict.scm new file mode 100644 index 0000000000..abab6a3eba --- /dev/null +++ b/gnu/services/dict.scm @@ -0,0 +1,131 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2016 Sou Bunnbu +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu services dict) + #:use-module (guix gexp) + #:use-module (guix records) + #:use-module (gnu services) + #:use-module (gnu services shepherd) + #:use-module (gnu system shadow) + #:use-module ((gnu packages admin) #:select (shadow)) + #:use-module (gnu packages dico) + #:use-module (gnu packages dictionaries) + #:use-module (srfi srfi-1) + #:use-module (srfi srfi-26) + #:use-module (ice-9 match) + #:export (dicod-service + dicod-configuration + dicod-database + %dicod-database:gcide)) + + +;;; +;;; GNU Dico. +;;; + +(define-record-type* + dicod-configuration make-dicod-configuration + dicod-configuration? + (dico dicod-configuration-dico (default dico)) + (databases dicod-configuration-databases + ;; list of + (default (list %dicod-database:gcide)))) + +(define-record-type* + dicod-database make-dicod-database + dicod-database? + (name dicod-database-name) + (module dicod-database-module) + (options dicod-database-options (default '()))) + +(define %dicod-database:gcide + (dicod-database + (name "gcide") + (module "gcide") + (options (list #~(string-append "dbdir=" #$gcide "/share/gcide") + "idxdir=/var/run/dicod")))) + +(define %dicod-accounts + (list (user-group + (name "dicod") + (system? #t)) + (user-account + (name "dicod") + (group "dicod") + (system? #t) + (home-directory "/var/empty") + (shell #~(string-append #$shadow "/sbin/nologin"))))) + +(define (dicod-configuration-file config) + (define dicod-configuration->text + (match-lambda + (($ dico databases) + (append-map (match-lambda + (($ name module options) + `(" +load-module " ,module "; +database { + name \"" ,name "\"; + handler \"" ,module + (string-join (list ,@options) " " 'prefix) "\"; +}\n"))) + databases)))) + (apply mixed-text-file "dicod.conf" (dicod-configuration->text config))) + +(define %dicod-activation + #~(begin + (use-modules (guix build utils)) + (let ((user (getpwnam "dicod")) + (rundir "/var/run/dicod")) + (mkdir-p rundir) + (chown rundir (passwd:uid user) (passwd:gid user))))) + +(define (dicod-shepherd-service config) + (list (shepherd-service + (provision '(dicod)) + (documentation "Run the dicod daemon.") + (start #~(make-forkexec-constructor + (list (string-append #$dico "/bin/dicod") "--foreground" + (string-append + "--config=" #$(dicod-configuration-file config))) + #:user "dicod" #:group "dicod")) + (stop #~(make-kill-destructor))))) + +(define dicod-service-type + (service-type + (name 'dict) + (extensions + (list (service-extension account-service-type + (const %dicod-accounts)) + (service-extension activation-service-type + (const %dicod-activation)) + (service-extension shepherd-root-service-type + dicod-shepherd-service))))) + +(define* (dicod-service #:key (config (dicod-configuration))) + "Return a service that runs the @command{dicod} daemon, an implementation +of DICT server (@pxref{Dicod,,, dico, GNU Dico Manual}). + +The optional @var{config} argument specifies the configuration for +@command{dicod}, which should be a @code{} object, by +default it serves the GNU Collaborative International Dictonary of English. + +You can add @command{open localhost} to your @file{~/.dico} file to make +@code{localhost} the default server for @command{dico} +client (@pxref{Initialization File,,, dico, GNU Dico Manual})." + (service dicod-service-type config)) -- cgit v1.2.3