From patchwork Sat Jan 7 18:19:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Othacehe X-Patchwork-Id: 45912 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 7B0DC27BBEB; Sat, 7 Jan 2023 18:20:27 +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.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 54CF327BBE9 for ; Sat, 7 Jan 2023 18:20:25 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pEDnY-0007cN-HY; Sat, 07 Jan 2023 13:20: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 1pEDnX-0007bg-3I for guix-patches@gnu.org; Sat, 07 Jan 2023 13:20: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 1pEDnW-0007ii-F8 for guix-patches@gnu.org; Sat, 07 Jan 2023 13:20:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pEDnW-0001OH-0y for guix-patches@gnu.org; Sat, 07 Jan 2023 13:20:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#60632] [PATCH 1/1] services: base: Add extra-env support to guix-configuration. Resent-From: Mathieu Othacehe Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 07 Jan 2023 18:20:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 60632 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 60632@debbugs.gnu.org Cc: Mathieu Othacehe X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16731155965326 (code B ref -1); Sat, 07 Jan 2023 18:20:01 +0000 Received: (at submit) by debbugs.gnu.org; 7 Jan 2023 18:19:56 +0000 Received: from localhost ([127.0.0.1]:58865 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEDnP-0001Nq-K8 for submit@debbugs.gnu.org; Sat, 07 Jan 2023 13:19:55 -0500 Received: from lists.gnu.org ([209.51.188.17]:48134) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEDnO-0001Nj-3d for submit@debbugs.gnu.org; Sat, 07 Jan 2023 13:19:54 -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 1pEDnN-0007Y5-V9 for guix-patches@gnu.org; Sat, 07 Jan 2023 13:19:53 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pEDnN-0007gm-Mn for guix-patches@gnu.org; Sat, 07 Jan 2023 13:19:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:Subject:To:From:in-reply-to: references; bh=vzEoa5Qe7VZ8HFYCjCvqoDINxXSk/MWM+FFXwBCX3VY=; b=ZYijfiWCG6kSkG zNRx2vUiEt3QBgrzq6hb2VEbjJ8KFAFtiJwPeSrqGNif37iS8bF4a/2ZcNktCpbObKpnpV07dtxDS ++7rDLVb/VHQx4LYZi2rZmQFzZo46KOO2EuE6fifXXTyrLCgbJd7REMp2VaBgc7SiGOWR9coP0Fhs y/K5sqtMboDirFibiGRyB5J7aDQdORZuzoRJyIw6ff4zVyOWH0Vy6z6aZ5EZsU64ESgbI9X+hHDSk aQAnwThPCrwjRh01Uk7NzBuRk4VBsj7uqc5elfMGqYYqsZmwLxTZKYhQMMfyEaug6wCl1O1qlisNH P835SpTCosBBIBh39e7Q==; Received: from [109.190.253.11] (helo=localhost.localdomain) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pEDnM-0005LN-Ul; Sat, 07 Jan 2023 13:19:53 -0500 From: Mathieu Othacehe Date: Sat, 7 Jan 2023 19:19:38 +0100 Message-Id: <20230107181938.14334-1-othacehe@gnu.org> X-Mailer: git-send-email 2.38.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/base.scm ()[extra-env]: New field. (guix-shepherd-service): Honor it. * doc/guix.texi (Base Services): Document it. --- Hello, Here is a small patch to allow defining extra environment variables in the guix-daemon context. I intend to use it to set the GUIX_SUBSTITUTE_DEBUG variable to debug https://issues.guix.gnu.org/48468. Thanks, Mathieu doc/guix.texi | 4 ++++ gnu/services/base.scm | 10 +++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 293c3016aa..e337945ba7 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -18482,6 +18482,10 @@ herd set-http-proxy guix-daemon @item @code{tmpdir} (default: @code{#f}) A directory path where the @command{guix-daemon} will perform builds. +@item @code{extra-env} (default: @code{'()}) +Environment variables to be set before starting the daemon, as a list of +@code{key=value} strings. + @end table @end deftp diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 6993e1f174..f29657e86e 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -198,6 +198,7 @@ (define-module (gnu services base) guix-configuration-generate-substitute-key? guix-configuration-extra-options guix-configuration-log-file + guix-configuration-extra-env guix-extension guix-extension? @@ -1654,7 +1655,9 @@ (define-record-type* (http-proxy guix-http-proxy ;string | #f (default #f)) (tmpdir guix-tmpdir ;string | #f - (default #f))) + (default #f)) + (extra-env guix-configuration-extra-env ;list of strings + (default '()))) (define %default-guix-configuration (guix-configuration)) @@ -1710,7 +1713,7 @@ (define (guix-shepherd-service config) (guix build-group build-accounts authorize-key? authorized-keys use-substitutes? substitute-urls max-silent-time timeout log-compression discover? extra-options log-file - http-proxy tmpdir chroot-directories) + http-proxy tmpdir chroot-directories extra-env) (list (shepherd-service (documentation "Run the Guix daemon.") (provision '(guix-daemon)) @@ -1799,7 +1802,8 @@ (define discover? (if proxy (list (string-append "http_proxy=" proxy) (string-append "https_proxy=" proxy)) - '())) + '()) + extra-env) #:log-file #$log-file)))) (stop #~(make-kill-destructor))))))