From patchwork Thu Feb 23 16:10:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruno Victal X-Patchwork-Id: 47237 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 6182616BA8; Thu, 23 Feb 2023 16:12: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=-2.0 required=5.0 tests=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 C379816B9F for ; Thu, 23 Feb 2023 16:12:25 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pVECR-0003df-B3; Thu, 23 Feb 2023 11:12:03 -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 1pVECQ-0003dQ-Aj for guix-patches@gnu.org; Thu, 23 Feb 2023 11:12:02 -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 1pVECQ-0000bT-4X for guix-patches@gnu.org; Thu, 23 Feb 2023 11:12:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pVECP-0001LA-L1 for guix-patches@gnu.org; Thu, 23 Feb 2023 11:12:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#61693] [PATCH v2] services: etc-service: Deprecate etc-service procedure. References: In-Reply-To: Resent-From: Bruno Victal Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 23 Feb 2023 16:12:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61693 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 61693@debbugs.gnu.org Cc: Bruno Victal Received: via spool by 61693-submit@debbugs.gnu.org id=B61693.16771686725094 (code B ref 61693); Thu, 23 Feb 2023 16:12:01 +0000 Received: (at 61693) by debbugs.gnu.org; 23 Feb 2023 16:11:12 +0000 Received: from localhost ([127.0.0.1]:35102 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pVEBc-0001K6-Cc for submit@debbugs.gnu.org; Thu, 23 Feb 2023 11:11:12 -0500 Received: from smtpmciv6.myservices.hosting ([185.26.106.201]:46332) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pVEBZ-0001Jx-Uq for 61693@debbugs.gnu.org; Thu, 23 Feb 2023 11:11:10 -0500 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpmciv6.myservices.hosting (Postfix) with ESMTP id 0A19920DD5 for <61693@debbugs.gnu.org>; Thu, 23 Feb 2023 17:11:07 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id AB4BB80097; Thu, 23 Feb 2023 17:11:07 +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 MhSM7QJhjb61; Thu, 23 Feb 2023 17:11:04 +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 F057680079; Thu, 23 Feb 2023 17:11:03 +0100 (CET) From: Bruno Victal Date: Thu, 23 Feb 2023 16:10:54 +0000 Message-Id: <17305168b7a65be0b9398951bf85abe3309f0494.1677168632.git.mirai@makinata.eu> X-Mailer: git-send-email 2.39.1 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 * gnu/services.scm (etc-service): Deprecate procedure. * gnu/system.scm (operating-system-etc-service): Replace etc-service with etc-service-type. --- gnu/services.scm | 6 +++-- gnu/system.scm | 68 ++++++++++++++++++++++++------------------------ 2 files changed, 38 insertions(+), 36 deletions(-) diff --git a/gnu/services.scm b/gnu/services.scm index 2abef557d4..d6c7ad0553 100644 --- a/gnu/services.scm +++ b/gnu/services.scm @@ -39,6 +39,7 @@ (define-module (gnu services) #:use-module (guix modules) #:use-module (guix packages) #:use-module (guix utils) + #:use-module (guix deprecation) #:use-module (gnu packages base) #:use-module (gnu packages bash) #:use-module (gnu packages hurd) @@ -122,7 +123,7 @@ (define-module (gnu services) %boot-service %activation-service - etc-service) + etc-service) ; deprecated #:re-export (;; Note: Re-export 'delete' to allow for proper syntax matching ;; in 'modify-services' forms. See ;; . @@ -804,7 +805,8 @@ (define etc-service-type (extend append) (description "Populate the @file{/etc} directory."))) -(define (etc-service files) +(define-deprecated (etc-service files) + etc-service-type "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)) diff --git a/gnu/system.scm b/gnu/system.scm index 53f3c62bb0..ca661c4d86 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -1092,40 +1092,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.