From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id kG4AH3BojmOkjwAAbAwnHQ (envelope-from ) for ; Mon, 05 Dec 2022 22:53:52 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id KIzwHnBojmOPQAAA9RJhRA (envelope-from ) for ; Mon, 05 Dec 2022 22:53:52 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 394A82D100 for ; Mon, 5 Dec 2022 22:53:52 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p2JOk-0007hM-H2; Mon, 05 Dec 2022 16:53:14 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p2JOZ-0007g2-QA for guix-patches@gnu.org; Mon, 05 Dec 2022 16:53:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p2JOZ-0007We-ID for guix-patches@gnu.org; Mon, 05 Dec 2022 16:53:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p2JOZ-00020i-9E for guix-patches@gnu.org; Mon, 05 Dec 2022 16:53:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#59845] [PATCH 4/4] doc: Add Integrated Library System section. Resent-From: Yarl Baudig Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 05 Dec 2022 21:53:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59845 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 59845@debbugs.gnu.org Cc: Yarl Baudig Received: via spool by 59845-submit@debbugs.gnu.org id=B59845.16702771787701 (code B ref 59845); Mon, 05 Dec 2022 21:53:03 +0000 Received: (at 59845) by debbugs.gnu.org; 5 Dec 2022 21:52:58 +0000 Received: from localhost ([127.0.0.1]:38615 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p2JOT-000209-Rb for submit@debbugs.gnu.org; Mon, 05 Dec 2022 16:52:58 -0500 Received: from msg-2.mailo.com ([213.182.54.12]:48886) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p2JOR-0001zo-Nr for 59845@debbugs.gnu.org; Mon, 05 Dec 2022 16:52:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailoo.org; s=mailo; t=1670277170; bh=QnhvS1kLbUsmlEpdchGwjtB2jd+/hfj+IT/w5NeGz9A=; h=X-EA-Auth:From:To:Cc:Subject:Date:Message-Id:In-Reply-To: References:MIME-Version:Content-Transfer-Encoding; b=d9a+2AglYU3tFPgIKrcXbffdhBYGGUJLSOnKPZ8+17+JdFoCh3m2oUKyWrfuuIy1j UCKFw+rMZv8DkiE6+DuKngwnL8yhJEmwO9pDXX1xHx7QAByVJtsX1tBSwcjnKVmb4o d0h/+72Q29Teb4VDCyQd+v9tClWE96k8eFhbU/Qs= Received: by b-3.in.mailobj.net [192.168.90.13] with ESMTP via ip-206.mailobj.net [213.182.55.206] Mon, 5 Dec 2022 22:52:50 +0100 (CET) X-EA-Auth: f41oaE/t42JDNDVB/zCClgmWQIkxRrjag2/peuq5tTgqpXSxQLqpUo1B8Z+RzxbrsbZ0L1UOe8kM5Q8pSKEQcG0C498OqA0v+AAjklat52M= From: Yarl Baudig Date: Mon, 5 Dec 2022 22:52:24 +0100 Message-Id: <20221205215224.27623-4-yarl-baudig@mailoo.org> In-Reply-To: <20221205215224.27623-1-yarl-baudig@mailoo.org> References: <20221205215224.27623-1-yarl-baudig@mailoo.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1670277232; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=1AyU64ONEvQ2IHgVg7/y9aGDrq0YqHwMOCHpZhohU7w=; b=Qn782TGnfV+KvBe0NAMwNVSGjWdZd7vsbBBe/eOg8MpXp17JW+UK+kU4BBZ43sVjBx0VbY d8ewq8pMAcobxbiW4Bo4vYUNHK9EgWB1mmn5rtuJM/brew9g0XkMNoTM/6MjLAxx6/Iyg6 QL7zS2k6hJU4W09mRbUq7tQHw+bkLPbSbFh1SjWGORVmvMmqjf9PtLY9RcP6WioZ67WOW/ Li++xGbZieK3bHtMrhxTZEvGycwrQoL2RvPHl5n0UMj2MEAuhrBOGfxxQuvhUZu0GZYNRy sLZwKzU1v6aoXNm3jkXzsISKVcgeAdBlXGV/n2606lbZ7CbkfI0l2S9AGrauVw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1670277232; a=rsa-sha256; cv=none; b=mpNSQL7klxpuuL8K5EDjnOm7CexNoFOnfqBPMof9D+zXhVr8qLC2ug53et21Iwb66WpRgm dso6ZB5KnQ43r2LMFG6qD6X1GpTsGfDaWVXaJPXKpsoGVKDPhj+OeLpI2djXgA1NFA9ZIX O8rf133PPIOvTQXnZ1Va8MLQJFHdlR09E8wjVfL4n44ee+mqmSwDOencD/nKNG2DlymzFE amI0X0k9W0tDUlQ+8zndszq/8lnjheG6nQHfC1ejRHM+0ecmoKiz8ylAvBj1bbGIz1jt5B s1b4Yn1ENTR8Z7qvARH0zTMeURmytH2tMZixXAN+b19rMxXSZh29dbWRKaMZgw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=mailoo.org header.s=mailo header.b=d9a+2Agl; dmarc=fail reason="SPF not aligned (relaxed)" header.from=mailoo.org (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 8.73 X-Spam: Yes Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=mailoo.org header.s=mailo header.b=d9a+2Agl; dmarc=fail reason="SPF not aligned (relaxed)" header.from=mailoo.org (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 394A82D100 X-Spam-Score: 8.73 X-Migadu-Spam: Yes X-Migadu-Scanner: scn0.migadu.com X-TUID: PJQnKn8XzruI doc/guix.texi (System Configuration, Services): Add Integrated Library System Services section. doc/guix.texi (System Configuration, Services, Integrated Library System Services): Add PMB. --- doc/guix.texi | 128 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 127 insertions(+), 1 deletion(-) diff --git a/doc/guix.texi b/doc/guix.texi index a79b777826..5ec72f9ce7 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -109,6 +109,7 @@ Copyright @copyright{} 2022 Reily Siegel@* Copyright @copyright{} 2022 Simon Streit@* Copyright @copyright{} 2022 (@* Copyright @copyright{} 2022 John Kehayias@* +Copyright @copyright{} 2022 Yarl Baudig Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or @@ -402,6 +403,7 @@ Services * Guix Services:: Services relating specifically to Guix. * Linux Services:: Services tied to the Linux kernel. * Hurd Services:: Services specific for a Hurd System. +* Integrated Library System Services:: ILS services. * Miscellaneous Services:: Other services. Defining Services @@ -17720,6 +17722,7 @@ declaration. * Guix Services:: Services relating specifically to Guix. * Linux Services:: Services tied to the Linux kernel. * Hurd Services:: Services specific for a Hurd System. +* Integrated Library System Services:: ILS services. * Miscellaneous Services:: Other services. @end menu @@ -36726,6 +36729,129 @@ An integer specifying the baud rate of the tty. @end table @end deftp +@node Integrated Library System Services +@subsection Integrated Library System Services + +@cindex PMB Service +@subsubheading PMB Service + +@defvr {Scheme Variable} pmb-service-type +Service type for the @uref{https://www.sigb.net/,PMB} Integrated Library System. +The value for this service type is a @code{} record. + +The PMB service needs a web server, @code{mariadb}/@code{mysql}, @code{php} and +is only responsible for copying and changing ownership of files from the +@code{pmb} package. +@end defvr + +Let's start with a demonstration. Here is a sample system configuration (@file{pmb.scm}): + +@lisp +(use-modules (gnu)) +(use-service-modules ils web networking databases) +(use-package-modules databases) + +(operating-system + (host-name "pmb") + (timezone "Europe/Paris") + (file-systems (cons (file-system + (device (file-system-label "does-not-matter")) + (mount-point "/") + (type "ext4")) + %base-file-systems)) + (bootloader (bootloader-configuration + (bootloader grub-bootloader) + (targets '("/dev/sdX")))) + (packages (cons* mariadb %base-packages)) + (services + (cons* (service dhcp-client-service-type) + (service php-fpm-service-type + (php-fpm-configuration + (php-ini-file + (plain-file "php.ini" + %default-pmb-php-fpm-configuration)))) + (service nginx-service-type + (nginx-configuration + (server-blocks + (list (nginx-server-configuration + (locations + (list + %default-nginx-pmb-location)) + (listen '("localhost:8080")) + (root "/srv/http/pmb") + (index '("index.php"))))))) + (service mysql-service-type + (mysql-configuration + (extra-content + %default-pmb-mysql-configuration-extra-content))) + (service pmb-service-type) + %base-services))) +@end lisp + +The interesting points are as follows. +We import the @code{mariadb} package so that we will have access to the program +@command{mysql}. This will be useful to set the password of the database's +administrator. We declare a @code{php-fpm} service whose @file{php.ini} file +is set to @code{%default-pmb-php-fpm-configuration}. +The @code{NGinx} service is declared, with a location set to +@code{%default-nginx-pmb-location} and a root set to @file{/srv/http/pmb}, which +is the default for the @code{http-directory} field of @code{}. +The @code{mysql} service is declared with an @code{extra-content} to its configuration: +@code{default-pmb-mysql-configuration-extra-content}. Finally the pmb service. + +Now let's run @command{guix system container -N pmb.scm} (@pxref{Invoking guix system}). +Run the resulting @file{/gnu/store/...run-container}. +Note that we want to keep the state of the database and the php files (because during +the application setup (see below), the php files will be slightly modified. That is also why +the PMB files need to be copied (and chowned) outside the store), we need to create +two folders, say @file{/mnt/data/pmb} and @file{/mnt/data/mysql} and pass @option{--share} +two times. @command{nsenter} into it to set the database's administrator password. + +@example +# mkdir /mnt/data/mysql /mnt/data/pmb +# /gnu/store/...run-container --share=/mnt/data/pmb=/srv/http/pmb \ +--share=/mnt/data/mysql=/var/lib/mysql +# nsenter -a -t +# mysql +> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('guixisgreat'); +@end example + +Go to @uref{localhost:8080}. Follow the steps. Note that for the database server parameters, +``localhost'' won't work, it's ``127.0.0.1'' and the user is ``root''. +Once the installation is complete, you are redirected to the login page. The name is ``admin'', +the password is ``admin''. + +Now lets detail fields. + +@defvr {Scheme Variable} %default-pmb-php-fpm-configuration +This is meant to represent the content of @file{php.ini} for the +@code{php-fpm} service for a recommended configuration. +@end defvr + +@defvr {Scheme Variable} %default-pmb-mysql-configuration-extra-content +Extra content to be added to @code{mariadb}/@code{mysql} configuration for recommended configuration. +@end defvr + +@defvr {Scheme Variable} %default-nginx-pmb-location +Location for nginx based on @code{nginx-php-location}. +@end defvr + +@deftp {Data Type} pmb-configuration +This data type represents the configuration for PMB. + +@table @asis +@item @code{pmb} (default: @code{pmb}) + +@item @code{http-directory} (default: @file{/srv/http/pmb}) +Must match a webserver's root. + +@item @code{php-fpm-user} (default: @code{php-fpm}) + +@item @code{php-fpm-group} (default: @code{php-fpm}) + +@end table +@end deftp + @node Miscellaneous Services @subsection Miscellaneous Services @@ -38369,7 +38495,7 @@ description: Install the given fonts on the specified ttys (fonts are per + tty/font pairs. The font can be the name of a font provided by the `kbd' + package or any valid argument to `setfont', as in this example: + -+ '(("tty1" . "LatGrkCyr-8x16") ++ 6 '(("tty1" . "LatGrkCyr-8x16") + ("tty2" . (file-append + font-tamzen + "/share/kbd/consolefonts/TamzenForPowerline10x20.psf")) -- 2.38.1