build-system: Add go-vendored-build-system.

* modules/rosenthal/utils/download.scm (go-mod-vendor): Sync with Nonguix.
* modules/rosenthal/build/go-vendored-build-system.scm
* modules/rosenthal/build-system/go-vendored.scm: New files.
* modules/rosenthal/packages/networking.scm (cloudflared, mihomo, sing-box)
(tailscale): Use go-vendored-build-system.
* modules/rosenthal/packages/web.scm (anubis-anti-crawler, caddy, caddy/dolly)
(forgejo): Likewise.
This commit is contained in:
Hilton Chain committed 2026-06-28 19:41:05 +08:00
1 parent ffce98cafe
commit 8bf6002818
5 files changed
+377 -152

No files matched your search

+16 -8
View File
@@ -15,6 +15,11 @@
(define* (go-mod-vendor #:key go)
(lambda* (src hash-algo hash #:optional name #:key (system (%current-system)))
"Return a fixed-output derivation to run \"go mod vendor\" against SRC and
use the produced \"vendor\" directory as the result. The derivation is expected
to have HASH of type HASH-ALGO (a symbol). File name of the derivation defaults
to \"vendored-go-dependencies\" and can be specified by NAME."
(define nss-certs
(module-ref (resolve-interface '(gnu packages nss)) 'nss-certs))
@@ -26,7 +31,9 @@
(guix build utils))
;; Support Unicode in file name.
(setlocale LC_ALL "C.UTF-8")
;; For HTTPS support.
;; Use our bundled Go toolchain.
(setenv "GOTOOLCHAIN" "local")
;; HTTPS support.
(setenv "SSL_CERT_DIR" #+(file-append nss-certs "/etc/ssl/certs"))
((assoc-ref %standard-phases 'unpack) #:source #+src)
@@ -37,11 +44,12 @@
#:hash hash
;; Is a directory.
#:recursive? #t
#:env-vars '(("GOCACHE" . "/tmp/go-cache")
("GOPATH" . "/tmp/go"))
#:env-vars
'(("GOCACHE" . "/tmp/go-cache")
("GOPATH" . "/tmp/go"))
;; Honor the user's proxy and locale settings.
#:leaked-env-vars '("GOPROXY"
"http_proxy" "https_proxy"
"LC_ALL" "LC_MESSAGES" "LANG"
"COLUMNS")
#:local-build? #t)))
#:leaked-env-vars
'("GOPROXY"
"http_proxy" "https_proxy"
"LC_ALL" "LC_MESSAGES" "LANG"
"COLUMNS"))))