guix_mirror_bot pushed a commit to branch master
in repository guix.

commit b7c99ce1297f19da01ba26828464b5e6d9d74572
Author: Nigko Yerden <[email protected]>
AuthorDate: Thu Jun 18 14:24:21 2026 +0500

    services: yggdrasil: Add http-proxy configuration option.
    
    gnu/services/networking.scm (yggdrasil-configuration)[http-proxy]: Add field
    and expose the accessor procedure.
    
(yggdrasil-shepherd-service)[shepherd-service]{start}<make-forkexec-constructor>:
    Set http_proxy and https_proxy environment variables if needed.
    doc/guix.texi (Networking Services)[yggdrasil-configuration]: Document it.
    
    Change-Id: I690d5857d55d9c2d6776e6b4733bced20913dbff
    Signed-off-by: Ludovic Courtès <[email protected]>
    Merges: #9380
---
 doc/guix.texi               |  3 +++
 gnu/services/networking.scm | 21 ++++++++++++++++-----
 2 files changed, 19 insertions(+), 5 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 739641fc139..bd626efd019 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -25962,6 +25962,9 @@ defined in this file take precedence over 
@code{json-config}.  Use the output
 of @code{yggdrasil -genconf} as a starting point.  To configure a static
 address, delete everything except PrivateKey option.
 
+@item @code{http-proxy} (default: @code{#f})
+The URL of the HTTP and HTTPS proxy used by Yggdrasil to connect to the 
Internet.
+
 @end table
 @end deftp
 
diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm
index b53fe2776df..875358cb458 100644
--- a/gnu/services/networking.scm
+++ b/gnu/services/networking.scm
@@ -287,6 +287,7 @@
             yggdrasil-configuration?
             yggdrasil-configuration-autoconf?
             yggdrasil-configuration-config-file
+            yggdrasil-configuration-http-proxy
             yggdrasil-configuration-log-level
             yggdrasil-configuration-log-to
             yggdrasil-configuration-json-config
@@ -2615,7 +2616,9 @@ local servers publicly accessible on the web, even behind 
NATs and firewalls."))
   (log-level yggdrasil-configuration-log-level
              (default 'info))
   (log-to yggdrasil-configuration-log-to
-          (default 'stdout)))
+          (default 'stdout))
+  (http-proxy yggdrasil-configuration-http-proxy
+              (default #f)))
 
 (define (yggdrasil-configuration-file config)
   (define (scm->yggdrasil-json x)
@@ -2672,10 +2675,18 @@ local servers publicly accessible on the web, even 
behind NATs and firewalls."))
          (documentation "Connect to the Yggdrasil mesh network")
          (provision '(yggdrasil))
          (requirement '(networking))
-         (start #~(make-forkexec-constructor
-                   #$yggdrasil-command
-                   #:log-file "/var/log/yggdrasil.log"
-                   #:group "yggdrasil"))
+         (start (let ((proxy (yggdrasil-configuration-http-proxy config)))
+                  #~(make-forkexec-constructor
+                     #$yggdrasil-command
+                     #:log-file "/var/log/yggdrasil.log"
+                     #:group "yggdrasil"
+                     #:environment-variables
+                     (append
+                      (if #$proxy
+                          (list #$(string-append "http_proxy=" proxy)
+                                #$(string-append "https_proxy=" proxy))
+                          '())
+                      (default-environment-variables)))))
          (stop #~(make-kill-destructor)))))
 
 (define %yggdrasil-accounts

Reply via email to