From patchwork Tue Feb 16 13:22:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brice Waegeneire X-Patchwork-Id: 27084 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 3D14927BC48; Tue, 16 Feb 2021 13:23:20 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id A04C627BC45 for ; Tue, 16 Feb 2021 13:23:19 +0000 (GMT) Received: from localhost ([::1]:33156 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lC0Jy-0003mI-MK for patchwork@mira.cbaines.net; Tue, 16 Feb 2021 08:23:18 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45444) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lC0Jj-0003kf-6e for guix-patches@gnu.org; Tue, 16 Feb 2021 08:23:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:56512) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lC0Ji-0002NK-W0 for guix-patches@gnu.org; Tue, 16 Feb 2021 08:23:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lC0Ji-00053L-SS for guix-patches@gnu.org; Tue, 16 Feb 2021 08:23:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#46560] [PATCH 1/2] gnu: services: Add activate script to the profile system directory. References: <87czx06ubt.fsf@waegenei.re> In-Reply-To: <87czx06ubt.fsf@waegenei.re> Resent-From: Brice Waegeneire Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 16 Feb 2021 13:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46560 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 46560@debbugs.gnu.org Received: via spool by 46560-submit@debbugs.gnu.org id=B46560.161348176919369 (code B ref 46560); Tue, 16 Feb 2021 13:23:02 +0000 Received: (at 46560) by debbugs.gnu.org; 16 Feb 2021 13:22:49 +0000 Received: from localhost ([127.0.0.1]:39821 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lC0JU-00052L-Vc for submit@debbugs.gnu.org; Tue, 16 Feb 2021 08:22:49 -0500 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:50381) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lC0JS-00051z-Gy for 46560@debbugs.gnu.org; Tue, 16 Feb 2021 08:22:47 -0500 X-Originating-IP: 31.170.9.129 Received: from localhost (reverse4.evolix.net [31.170.9.129]) (Authenticated sender: brice@waegenei.re) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id BCFDEFF80D for <46560@debbugs.gnu.org>; Tue, 16 Feb 2021 13:22:39 +0000 (UTC) From: Brice Waegeneire Date: Tue, 16 Feb 2021 14:22:34 +0100 Message-Id: <20210216132235.15811-1-brice@waegenei.re> X-Mailer: git-send-email 2.30.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" X-getmail-retrieved-from-mailbox: Patches * gnu/services.scm (activation-profile-entry): New procedure... (activation-service-type): ... use it. --- gnu/services.scm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/gnu/services.scm b/gnu/services.scm index 13259dfaee..ddd1bac30c 100644 --- a/gnu/services.scm +++ b/gnu/services.scm @@ -617,13 +617,21 @@ ACTIVATION-SCRIPT-TYPE." "Return a gexp that runs the activation script containing GEXPS." #~(primitive-load #$(activation-script gexps))) +(define (activation-profile-entry gexps) + "Return, as a monadic value, an entry for the activation script in the +system directory." + (mlet %store-monad ((activate (lower-object (activation-script gexps)))) + (return `(("activate" ,activate))))) + (define (second-argument a b) b) (define activation-service-type (service-type (name 'activate) (extensions (list (service-extension boot-service-type - gexps->activation-gexp))) + gexps->activation-gexp) + (service-extension system-service-type + activation-profile-entry))) (compose identity) (extend second-argument) (description