From patchwork Wed Feb 22 00:09:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruno Victal X-Patchwork-Id: 47207 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 2BB5E1684B; Wed, 22 Feb 2023 00:11:33 +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,URIBL_BLOCKED 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 F0F6816745 for ; Wed, 22 Feb 2023 00:11:29 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pUcj7-0007Hs-5c; Tue, 21 Feb 2023 19:11:17 -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 1pUciu-00077n-UA for guix-patches@gnu.org; Tue, 21 Feb 2023 19:11:07 -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 1pUcis-0003QV-LY for guix-patches@gnu.org; Tue, 21 Feb 2023 19:11:04 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pUcis-0002Bc-Fe for guix-patches@gnu.org; Tue, 21 Feb 2023 19:11:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#61693] [PATCH] services: Remove etc-service procedure. Resent-From: Bruno Victal Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 22 Feb 2023 00:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 61693 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 61693@debbugs.gnu.org Cc: Bruno Victal X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16770246038297 (code B ref -1); Wed, 22 Feb 2023 00:11:02 +0000 Received: (at submit) by debbugs.gnu.org; 22 Feb 2023 00:10:03 +0000 Received: from localhost ([127.0.0.1]:57514 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pUcht-00029a-UG for submit@debbugs.gnu.org; Tue, 21 Feb 2023 19:10:02 -0500 Received: from lists.gnu.org ([209.51.188.17]:33678) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pUchp-00029Q-Op for submit@debbugs.gnu.org; Tue, 21 Feb 2023 19:10:00 -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 1pUchp-0005sd-Jz for guix-patches@gnu.org; Tue, 21 Feb 2023 19:09:57 -0500 Received: from smtpm2.myservices.hosting ([185.26.105.233]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pUchn-00030R-D6 for guix-patches@gnu.org; Tue, 21 Feb 2023 19:09:57 -0500 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpm2.myservices.hosting (Postfix) with ESMTP id DAB5E20DE7 for ; Wed, 22 Feb 2023 01:09:52 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id 53C4180097; Wed, 22 Feb 2023 01:09:52 +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 PVLSxINbn5q6; Wed, 22 Feb 2023 01:09:48 +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 2902480079; Wed, 22 Feb 2023 01:09:48 +0100 (CET) From: Bruno Victal Date: Wed, 22 Feb 2023 00:09:45 +0000 Message-Id: X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 Received-SPF: pass client-ip=185.26.105.233; envelope-from=mirai@makinata.eu; helo=smtpm2.myservices.hosting X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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 * gnu/services.scm (etc-service): Delete procedure. * gnu/system.scm (operating-system-etc-service): Replace etc-service with etc-service-type. --- Note: This procedure is not documented in the manual so we skip the deprecation phase. gnu/services.scm | 8 +----- gnu/system.scm | 68 ++++++++++++++++++++++++------------------------ 2 files changed, 35 insertions(+), 41 deletions(-) diff --git a/gnu/services.scm b/gnu/services.scm index 2abef557d4..fd073b60dd 100644 --- a/gnu/services.scm +++ b/gnu/services.scm @@ -121,8 +121,7 @@ (define-module (gnu services) linux-loadable-module-service-type %boot-service - %activation-service - etc-service) + %activation-service) #:re-export (;; Note: Re-export 'delete' to allow for proper syntax matching ;; in 'modify-services' forms. See ;; . @@ -804,11 +803,6 @@ (define etc-service-type (extend append) (description "Populate the @file{/etc} directory."))) -(define (etc-service files) - "Return a new service of ETC-SERVICE-TYPE that populates /etc with FILES. -FILES must be a list of name/file-like object pairs." - (service etc-service-type files)) - (define (setuid-program->activation-gexp programs) "Return an activation gexp for setuid-program from PROGRAMS." (let ((programs (map (lambda (program) diff --git a/gnu/system.scm b/gnu/system.scm index df60fda53b..779fe26049 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -1093,40 +1093,40 @@ (define* (operating-system-etc-service os) # as those in ~/.guix-profile and /run/current-system/profile. source /run/current-system/profile/etc/profile.d/bash_completion.sh fi\n"))) - (etc-service - `(("os-release" ,#~#$(os-release)) - ("services" ,(file-append net-base "/etc/services")) - ("protocols" ,(file-append net-base "/etc/protocols")) - ("rpc" ,(file-append net-base "/etc/rpc")) - ("login.defs" ,#~#$login.defs) - ("issue" ,#~#$issue) - ,@(if nsswitch `(("nsswitch.conf" ,#~#$nsswitch)) '()) - ("profile" ,#~#$profile) - ("bashrc" ,#~#$bashrc) - ;; Write the operating-system-host-name to /etc/hostname to prevent - ;; NetworkManager from changing the system's hostname when connecting - ;; to certain networks. Some discussion at - ;; https://lists.gnu.org/archive/html/help-guix/2017-09/msg00037.html - ("hostname" ,(plain-file "hostname" (operating-system-host-name os))) - ;; Some programs (e.g., GLib) look at /etc/timezone to find the - ;; name of the current timezone. For details, see - ;; https://lists.gnu.org/archive/html/guix-devel/2019-07/msg00166.html - ;; Some programs expect a terminating newline. - ("timezone" ,(plain-file "timezone" - (string-append - (string-trim-both - (operating-system-timezone os)) - "\n"))) - ("localtime" ,(file-append tzdata "/share/zoneinfo/" - (operating-system-timezone os))) - ,@(if sudoers - `(("sudoers" ,(validated-sudoers-file sudoers))) - '()) - ,@(if hurd - `(("login" ,(file-append hurd "/etc/login")) - ("motd" ,(file-append hurd "/etc/motd")) - ("ttys" ,(file-append hurd "/etc/ttys"))) - '()))))) + (service etc-service-type + `(("os-release" ,#~#$(os-release)) + ("services" ,(file-append net-base "/etc/services")) + ("protocols" ,(file-append net-base "/etc/protocols")) + ("rpc" ,(file-append net-base "/etc/rpc")) + ("login.defs" ,#~#$login.defs) + ("issue" ,#~#$issue) + ,@(if nsswitch `(("nsswitch.conf" ,#~#$nsswitch)) '()) + ("profile" ,#~#$profile) + ("bashrc" ,#~#$bashrc) + ;; Write the operating-system-host-name to /etc/hostname to prevent + ;; NetworkManager from changing the system's hostname when connecting + ;; to certain networks. Some discussion at + ;; https://lists.gnu.org/archive/html/help-guix/2017-09/msg00037.html + ("hostname" ,(plain-file "hostname" (operating-system-host-name os))) + ;; Some programs (e.g., GLib) look at /etc/timezone to find the + ;; name of the current timezone. For details, see + ;; https://lists.gnu.org/archive/html/guix-devel/2019-07/msg00166.html + ;; Some programs expect a terminating newline. + ("timezone" ,(plain-file "timezone" + (string-append + (string-trim-both + (operating-system-timezone os)) + "\n"))) + ("localtime" ,(file-append tzdata "/share/zoneinfo/" + (operating-system-timezone os))) + ,@(if sudoers + `(("sudoers" ,(validated-sudoers-file sudoers))) + '()) + ,@(if hurd + `(("login" ,(file-append hurd "/etc/login")) + ("motd" ,(file-append hurd "/etc/motd")) + ("ttys" ,(file-append hurd "/etc/ttys"))) + '()))))) (define %root-account ;; Default root account.