all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#60632] [PATCH 1/1] services: base: Add extra-env support to guix-configuration.
@ 2023-01-07 18:19 Mathieu Othacehe
  2023-01-11 19:38 ` Maxim Cournoyer
  0 siblings, 1 reply; 8+ messages in thread
From: Mathieu Othacehe @ 2023-01-07 18:19 UTC (permalink / raw)
  To: 60632; +Cc: Mathieu Othacehe

* gnu/services/base.scm (<guix-configuration>)[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* <guix-configuration>
   (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))))))
-- 
2.38.1





^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-10-14 19:55 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-07 18:19 [bug#60632] [PATCH 1/1] services: base: Add extra-env support to guix-configuration Mathieu Othacehe
2023-01-11 19:38 ` Maxim Cournoyer
2023-01-31 22:18   ` Ludovic Courtès
2023-02-01 18:31     ` configurable guile backtrace in builder (was: services: base: Add extra-env support to guix-configuration) Maxim Cournoyer
2023-02-08  9:39       ` configurable guile backtrace in builder Ludovic Courtès
2023-02-08 16:09         ` Maxim Cournoyer
2023-02-09  9:24         ` Attila Lendvai
2023-10-14 19:54     ` bug#60632: [PATCH 1/1] services: base: Add extra-env support to guix-configuration Mathieu Othacehe

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.