From patchwork Tue Feb 21 21:37:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bruno Victal X-Patchwork-Id: 47203 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 57BF216B79; Tue, 21 Feb 2023 21:38:30 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id D88C016B4C for ; Tue, 21 Feb 2023 21:38:28 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pUaKq-00055V-RF; Tue, 21 Feb 2023 16:38:04 -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 1pUaKo-00054n-Th for guix-patches@gnu.org; Tue, 21 Feb 2023 16:38:03 -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 1pUaKo-0004Od-8d for guix-patches@gnu.org; Tue, 21 Feb 2023 16:38:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pUaKo-0006Xq-4f for guix-patches@gnu.org; Tue, 21 Feb 2023 16:38:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#61688] [PATCH 1/3] doc: hosts-service-type: Relocate to Base Services. Resent-From: Bruno Victal Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 21 Feb 2023 21:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61688 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 61688@debbugs.gnu.org Cc: Bruno Victal Received: via spool by 61688-submit@debbugs.gnu.org id=B61688.167701544625088 (code B ref 61688); Tue, 21 Feb 2023 21:38:02 +0000 Received: (at 61688) by debbugs.gnu.org; 21 Feb 2023 21:37:26 +0000 Received: from localhost ([127.0.0.1]:57376 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pUaKD-0006Wa-GU for submit@debbugs.gnu.org; Tue, 21 Feb 2023 16:37:26 -0500 Received: from smtpm5.myservices.hosting ([185.26.105.236]:33898) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pUaKB-0006WR-Pn for 61688@debbugs.gnu.org; Tue, 21 Feb 2023 16:37:24 -0500 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpm5.myservices.hosting (Postfix) with ESMTP id B226220CFD for <61688@debbugs.gnu.org>; Tue, 21 Feb 2023 22:37:22 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id 609378009E; Tue, 21 Feb 2023 22:37:22 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-2.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id m_6QP6MPWL5N; Tue, 21 Feb 2023 22:37:22 +0100 (CET) Received: from guix-nuc.home.arpa (bl9-119-177.dsl.telepac.pt [85.242.119.177]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id C1AAC8009D; Tue, 21 Feb 2023 22:37:21 +0100 (CET) From: Bruno Victal Date: Tue, 21 Feb 2023 21:37:07 +0000 Message-Id: X-Mailer: git-send-email 2.39.1 In-Reply-To: References: MIME-Version: 1.0 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+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches hosts-service-type is under (gnu services base) * doc/guix.texi: Merge duplicated copyright lines. (Service Reference): Move hosts-service-type to ... (Base Services): ... here. --- doc/guix.texi | 145 +++++++++++++++++++++++++------------------------- 1 file changed, 72 insertions(+), 73 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 05615b9549..4143488b93 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -109,11 +109,10 @@ Copyright @copyright{} 2022 Simon Streit@* Copyright @copyright{} 2022 (@* Copyright @copyright{} 2022 John Kehayias@* -Copyright @copyright{} 2022 Bruno Victal@* +Copyright @copyright{} 2022⁠–⁠2023 Bruno Victal@* Copyright @copyright{} 2022 Ivan Vilata-i-Balaguer@* Copyright @copyright{} 2023 Giacomo Leidi@* Copyright @copyright{} 2022 Antero Mejr@* -Copyright @copyright{} 2023 Bruno Victal@* Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or @@ -18021,6 +18020,77 @@ Base Services @end lisp @end defvar +@defvar hosts-service-type +Type of the service that populates the entries for (@file{/etc/hosts}). +This service type can be extended by passing it a list of +@code{host} records. + +@c TRANSLATORS: The domain names below SHOULD NOT be translated. +@c They're domains reserved for use in documentation. (RFC6761 Section 6.5) +@c The addresses used are explained in RFC3849 and RFC5737. +@lisp +(simple-service 'add-extra-hosts + hosts-service-type + (list (host "192.0.2.1" "example.com" + '("example.net" "example.org")) + (host "2001:db8::1" "example.com" + '("example.net" "example.org")))) +@end lisp + +@quotation Note +@cindex @file{/etc/host} default entries +By default @file{/etc/host} comes with the following entries: +@example +127.0.0.1 localhost @var{host-name} +::1 localhost @var{host-name} +@end example + +For most setups this is what you want though if you find yourself in +the situation where you want to change the default entries, you can +do so in @code{operating-system}.@pxref{operating-system Reference,@code{essential-services}} + +The following example shows how one would unset @var{host-name} +from being an alias of @code{localhost}. +@lisp +(operating-system + ;; @dots{} + + (essential-services + (modify-services + (operating-system-default-essential-services this-operating-system) + (hosts-service-type config => (list + (host "127.0.0.1" "localhost") + (host "::1" "localhost")))))) +@end lisp +@end quotation + +@deftp {Data Type} host +Available @code{host} fields are: + +@table @asis +@item @code{address} (type: string) +IP address. + +@item @code{canonical-name} (type: string) +Hostname. + +@item @code{aliases} (default: @code{'()}) (type: list-of-string) +Additional aliases that map to the same @code{canonical-name}. + +@end table +@end deftp + +@defun host address canonical-name [aliases] +Procedure for creating @code{host} records. +@end defun + +@quotation Note +The @code{host} data type constructor is @code{%host} though it is +tiresome to create multiple records with it so in practice the procedure +@code{host} (which wraps around @code{%host}) is used instead. +@end quotation +@end defvar + @deffn {Scheme Procedure} login-service @var{config} Return a service to run login according to @var{config}, a @code{} object, which specifies the message of the day, @@ -40508,77 +40578,6 @@ Service Reference pointing to the given file. @end defvar -@defvar hosts-service-type -Type of the service that populates the entries for (@file{/etc/hosts}). -This service type can be extended by passing it a list of -@code{host} records. - -@c TRANSLATORS: The domain names below SHOULD NOT be translated. -@c They're domains reserved for use in documentation. (RFC6761 Section 6.5) -@c The addresses used are explained in RFC3849 and RFC5737. -@lisp -(simple-service 'add-extra-hosts - hosts-service-type - (list (host "192.0.2.1" "example.com" - '("example.net" "example.org")) - (host "2001:db8::1" "example.com" - '("example.net" "example.org")))) -@end lisp - -@quotation Note -@cindex @file{/etc/host} default entries -By default @file{/etc/host} comes with the following entries: -@example -127.0.0.1 localhost @var{host-name} -::1 localhost @var{host-name} -@end example - -For most setups this is what you want though if you find yourself in -the situation where you want to change the default entries, you can -do so in @code{operating-system}.@pxref{operating-system Reference,@code{essential-services}} - -The following example shows how one would unset @var{host-name} -from being an alias of @code{localhost}. -@lisp -(operating-system - ;; @dots{} - - (essential-services - (modify-services - (operating-system-default-essential-services this-operating-system) - (hosts-service-type config => (list - (host "127.0.0.1" "localhost") - (host "::1" "localhost")))))) -@end lisp -@end quotation - -@deftp {Data Type} host -Available @code{host} fields are: - -@table @asis -@item @code{address} (type: string) -IP address. - -@item @code{canonical-name} (type: string) -Hostname. - -@item @code{aliases} (default: @code{'()}) (type: list-of-string) -Additional aliases that map to the same @code{canonical-name}. - -@end table -@end deftp - -@defun host address canonical-name [aliases] -Procedure for creating @code{host} records. -@end defun - -@quotation Note -The @code{host} data type constructor is @code{%host} though it is -tiresome to create multiple records with it so in practice the procedure -@code{host} (which wraps around @code{%host}) is used instead. -@end quotation -@end defvar - @defvar setuid-program-service-type Type for the ``setuid-program service''. This service collects lists of executable file names, passed as gexps, and adds them to the set of From patchwork Tue Feb 21 21:37:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruno Victal X-Patchwork-Id: 47202 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 6914116B70; Tue, 21 Feb 2023 21:38:28 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 6FE9D16B4C for ; Tue, 21 Feb 2023 21:38:26 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pUaKs-00056D-3g; Tue, 21 Feb 2023 16:38:06 -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 1pUaKp-00054v-Qz for guix-patches@gnu.org; Tue, 21 Feb 2023 16:38:03 -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 1pUaKo-0004Oo-U0 for guix-patches@gnu.org; Tue, 21 Feb 2023 16:38:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pUaKo-0006Y5-QS for guix-patches@gnu.org; Tue, 21 Feb 2023 16:38:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#61688] [PATCH 2/3] system: Do not export local-host-entries. Resent-From: Bruno Victal Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 21 Feb 2023 21:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61688 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 61688@debbugs.gnu.org Cc: Bruno Victal Received: via spool by 61688-submit@debbugs.gnu.org id=B61688.167701545825129 (code B ref 61688); Tue, 21 Feb 2023 21:38:02 +0000 Received: (at 61688) by debbugs.gnu.org; 21 Feb 2023 21:37:38 +0000 Received: from localhost ([127.0.0.1]:57382 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pUaKQ-0006XE-Gh for submit@debbugs.gnu.org; Tue, 21 Feb 2023 16:37:38 -0500 Received: from smtpm2.myservices.hosting ([185.26.105.233]:60110) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pUaKJ-0006Wm-CX for 61688@debbugs.gnu.org; Tue, 21 Feb 2023 16:37:34 -0500 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpm2.myservices.hosting (Postfix) with ESMTP id B756D20DB4 for <61688@debbugs.gnu.org>; Tue, 21 Feb 2023 22:37:30 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id 3FCA88009F; Tue, 21 Feb 2023 22:37:30 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-2.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id vB_01QqkZCXx; Tue, 21 Feb 2023 22:37:29 +0100 (CET) Received: from guix-nuc.home.arpa (bl9-119-177.dsl.telepac.pt [85.242.119.177]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id 7531F8009D; Tue, 21 Feb 2023 22:37:29 +0100 (CET) From: Bruno Victal Date: Tue, 21 Feb 2023 21:37:08 +0000 Message-Id: <85a76fc00031c329710fcfde8d028afc70dc0721.1677015071.git.mirai@makinata.eu> X-Mailer: git-send-email 2.39.1 In-Reply-To: References: MIME-Version: 1.0 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+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches Unlike the deprecated 'local-host-aliases', there's no use for local-host-entries since it's used to set the default value for hosts-service-type. Given that this service-type is expected to be extended, one presumes that when they explicitly override the service default value they do not have much interest in the 'local-host-entries' procedure. * gnu/system.scm: Do not export local-host-entries. --- gnu/system.scm | 1 - 1 file changed, 1 deletion(-) diff --git a/gnu/system.scm b/gnu/system.scm index df60fda53b..53f3c62bb0 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -171,7 +171,6 @@ (define-module (gnu system) boot-parameters->menu-entry local-host-aliases ;deprecated - local-host-entries %root-account %setuid-programs %sudoers-specification From patchwork Tue Feb 21 21:37:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruno Victal X-Patchwork-Id: 47204 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 5434516B79; Tue, 21 Feb 2023 21:38:39 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id CC9A516B4C for ; Tue, 21 Feb 2023 21:38:38 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pUaKr-00055y-A6; Tue, 21 Feb 2023 16:38:05 -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 1pUaKp-00054p-2C for guix-patches@gnu.org; Tue, 21 Feb 2023 16:38:03 -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 1pUaKo-0004Oe-J1 for guix-patches@gnu.org; Tue, 21 Feb 2023 16:38:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pUaKo-0006Xy-FS for guix-patches@gnu.org; Tue, 21 Feb 2023 16:38:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#61688] [PATCH 3/3] doc: hosts-service-type: Improve documentation. Resent-From: Bruno Victal Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 21 Feb 2023 21:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61688 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 61688@debbugs.gnu.org Cc: Bruno Victal Received: via spool by 61688-submit@debbugs.gnu.org id=B61688.167701545425118 (code B ref 61688); Tue, 21 Feb 2023 21:38:02 +0000 Received: (at 61688) by debbugs.gnu.org; 21 Feb 2023 21:37:34 +0000 Received: from localhost ([127.0.0.1]:57380 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pUaKM-0006Wy-3p for submit@debbugs.gnu.org; Tue, 21 Feb 2023 16:37:34 -0500 Received: from smtpm1.myservices.hosting ([185.26.105.232]:46266) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pUaKK-0006Wo-41 for 61688@debbugs.gnu.org; Tue, 21 Feb 2023 16:37:32 -0500 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpm1.myservices.hosting (Postfix) with ESMTP id 610BC20293 for <61688@debbugs.gnu.org>; Tue, 21 Feb 2023 22:37:30 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id B992C8009D; Tue, 21 Feb 2023 22:37:30 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-2.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id ovoekaShkAtb; Tue, 21 Feb 2023 22:37:30 +0100 (CET) Received: from guix-nuc.home.arpa (bl9-119-177.dsl.telepac.pt [85.242.119.177]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id E81AE8009E; Tue, 21 Feb 2023 22:37:29 +0100 (CET) From: Bruno Victal Date: Tue, 21 Feb 2023 21:37:09 +0000 Message-Id: X-Mailer: git-send-email 2.39.1 In-Reply-To: References: MIME-Version: 1.0 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+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * doc/guix.texi (Base Services): Improve hosts-service-type documentation. --- doc/guix.texi | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 4143488b93..85768a4b60 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -18022,7 +18022,7 @@ Base Services @defvar hosts-service-type Type of the service that populates the entries for (@file{/etc/hosts}). -This service type can be extended by passing it a list of +This service type can be @emph{extended} by passing it a list of @code{host} records. @c TRANSLATORS: The domain names below SHOULD NOT be translated. @@ -18047,10 +18047,11 @@ Base Services For most setups this is what you want though if you find yourself in the situation where you want to change the default entries, you can -do so in @code{operating-system}.@pxref{operating-system Reference,@code{essential-services}} +do so in @code{operating-system} via @code{modify-services} +(@pxref{Service Reference,@code{modify-services}}). -The following example shows how one would unset @var{host-name} -from being an alias of @code{localhost}. +The following example shows how to unset @var{host-name} from being an +alias of @code{localhost}. @lisp (operating-system ;; @dots{} @@ -18085,9 +18086,9 @@ Base Services @end defun @quotation Note -The @code{host} data type constructor is @code{%host} though it is -tiresome to create multiple records with it so in practice the procedure -@code{host} (which wraps around @code{%host}) is used instead. +The constructor for the @code{host} record-type is @code{%host} though +the procedure @code{host} results in more concise definitions when there are +multiple @code{host} records. @end quotation @end defvar