Compare commits

..

No commits in common. "51a983adf3b248f188b04e1998496c2aa2fa1197" and "879f4aef54be480fbe5fedda34ec208e129ac8d2" have entirely different histories.

23 changed files with 318 additions and 1260 deletions

View File

@ -24,8 +24,18 @@ Channel definition:
For configuration, see [[https://guix.gnu.org/manual/devel/en/html_node/Specifying-Additional-Channels.html][Specifying Additional Channels]], [[https://guix.gnu.org/manual/devel/en/html_node/Customizing-the-System_002dWide-Guix.html][Customizing the System-Wide Guix]] and [[https://guix.gnu.org/manual/devel/en/html_node/Guix-Home-Services.html#index-home_002dchannels_002dservice_002dtype][~home-channels-service-type~]] in /GNU Guix Reference Manual/. For configuration, see [[https://guix.gnu.org/manual/devel/en/html_node/Specifying-Additional-Channels.html][Specifying Additional Channels]], [[https://guix.gnu.org/manual/devel/en/html_node/Customizing-the-System_002dWide-Guix.html][Customizing the System-Wide Guix]] and [[https://guix.gnu.org/manual/devel/en/html_node/Guix-Home-Services.html#index-home_002dchannels_002dservice_002dtype][~home-channels-service-type~]] in /GNU Guix Reference Manual/.
Substitutes (see [[https://guix.gnu.org/manual/devel/en/html_node/Substitutes.html][Substitutes]] in /GNU Guix Reference Manual/) are available on [[https://substitute.boiledscript.com/][~https://substitute.boiledscript.com~]], with the following signing key:
#+begin_src scheme
(public-key
(ecc
(curve Ed25519)
(q #374EC58F5F2EC0412431723AF2D527AD626B049D657B5633AAAEBC694F3E33F9#)))
#+end_src
Wiki: https://codeberg.org/hako/Rosenthal/wiki Wiki: https://codeberg.org/hako/Rosenthal/wiki
Build status: https://ci.boiledscript.com/jobset/rosenthal
Git repositories: Git repositories:
- Codeberg: https://codeberg.org/hako/Rosenthal - Codeberg: https://codeberg.org/hako/Rosenthal
- (backup) URSpace VCS: https://git.boiledscript.com/hako/Rosenthal - (backup) URSpace VCS: https://git.boiledscript.com/hako/Rosenthal

View File

@ -1,477 +0,0 @@
#!/usr/bin/env -S guix repl
!#
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2020, 2021, 2022, 2023 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2021 Sarah Morgensen <iskarian@mgsn.dev>
;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz>
;;; Copyright © 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;; This script stages and commits changes to package definitions.
;;; Code:
(use-modules ((sxml xpath) #:prefix xpath:)
(srfi srfi-1)
(srfi srfi-2)
(srfi srfi-9)
(srfi srfi-11)
(srfi srfi-26)
(ice-9 format)
(ice-9 popen)
(ice-9 match)
(ice-9 rdelim)
(ice-9 regex)
(ice-9 textual-ports)
(guix gexp))
(define* (break-string str #:optional (max-line-length 70))
"Break the string STR into lines that are no longer than MAX-LINE-LENGTH.
Return a single string."
(define (restore-line words)
(string-join (reverse words) " "))
(if (<= (string-length str) max-line-length)
str
(let ((words+lengths (map (lambda (word)
(cons word (string-length word)))
(string-tokenize str))))
(match (fold (match-lambda*
(((word . length)
(count current lines))
(let ((new-count (+ count length 1)))
(if (< new-count max-line-length)
(list new-count
(cons word current)
lines)
(list length
(list word)
(cons (restore-line current) lines))))))
'(0 () ())
words+lengths)
((_ last-words lines)
(string-join (reverse (cons (restore-line last-words) lines))
"\n"))))))
(define* (break-string-with-newlines str #:optional (max-line-length 70))
"Break the lines of string STR into lines that are no longer than
MAX-LINE-LENGTH. Return a single string."
(string-join (map (cut break-string <> max-line-length)
(string-split str #\newline))
"\n"))
(define (read-excursion port)
"Read an expression from PORT and reset the port position before returning
the expression."
(let ((start (ftell port))
(result (read port)))
(seek port start SEEK_SET)
result))
(define (lines+offsets-with-opening-parens port)
"Record all line numbers (and their offsets) where an opening parenthesis is
found in column 0. The resulting list is in reverse order."
(let loop ((acc '())
(number 0))
(let ((line (read-line port)))
(cond
((eof-object? line) acc)
((string-prefix? "(" line)
(loop (cons (cons number ;line number
(- (ftell port)
(string-length line) 1)) ;offset
acc)
(1+ number)))
(else (loop acc (1+ number)))))))
(define (surrounding-sexp port target-line-no)
"Return the top-level S-expression surrounding the change at line number
TARGET-LINE-NO in PORT."
(let* ((line-numbers+offsets
(lines+offsets-with-opening-parens port))
(closest-offset
(or (and=> (list-index (match-lambda
((line-number . offset)
(< line-number target-line-no)))
line-numbers+offsets)
(lambda (index)
(match (list-ref line-numbers+offsets index)
((line-number . offset) offset))))
(error "Could not find surrounding S-expression for line"
target-line-no))))
(seek port closest-offset SEEK_SET)
(read port)))
;;; Whether the hunk contains a newly added package (definition), a removed
;;; package (removal) or something else (#false).
(define hunk-types '(addition removal #false))
(define-record-type <hunk>
(make-hunk file-name
old-line-number
new-line-number
diff-lines
type)
hunk?
(file-name hunk-file-name)
;; Line number before the change
(old-line-number hunk-old-line-number)
;; Line number after the change
(new-line-number hunk-new-line-number)
;; The full diff to be used with "git apply --cached"
(diff-lines hunk-diff-lines)
;; Does this hunk add or remove a package?
(type hunk-type)) ;one of 'hunk-types'
(define* (hunk->patch hunk #:optional (port (current-output-port)))
(let ((file-name (hunk-file-name hunk)))
(format port
"diff --git a/~a b/~a~%--- a/~a~%+++ b/~a~%~a"
file-name file-name file-name file-name
(string-join (hunk-diff-lines hunk) ""))))
(define (diff-info)
"Read the diff and return a list of <hunk> values."
(let ((port (open-pipe* OPEN_READ
"git" "diff-files"
"--no-prefix"
;; Only include one context line to avoid lumping in
;; new definitions with changes to existing
;; definitions.
"--unified=1"
"--" "modules/rosenthal")))
(define (extract-line-number line-tag)
(abs (string->number
(car (string-split line-tag #\,)))))
(define (read-hunk)
(let loop ((lines '())
(type #false))
(let ((line (read-line port 'concat)))
(cond
((eof-object? line)
(values (reverse lines) type))
((or (string-prefix? "@@ " line)
(string-prefix? "diff --git" line))
(unget-string port line)
(values (reverse lines) type))
(else
(loop (cons line lines)
(or type
(cond
((string-prefix? "+(define" line)
'addition)
((string-prefix? "-(define" line)
'removal)
(else #false)))))))))
(define info
(let loop ((acc '())
(file-name #f))
(let ((line (read-line port)))
(cond
((eof-object? line) acc)
((string-prefix? "--- " line)
(match (string-split line #\space)
((_ file-name)
(loop acc file-name))))
((string-prefix? "@@ " line)
(match (string-split line #\space)
((_ old-start new-start . _)
(let-values
(((diff-lines type) (read-hunk)))
(loop (cons (make-hunk file-name
(extract-line-number old-start)
(extract-line-number new-start)
(cons (string-append line "\n")
diff-lines)
type) acc)
file-name)))))
(else (loop acc file-name))))))
(close-pipe port)
info))
(define (lines-to-first-change hunk)
"Return the number of diff lines until the first change."
(1- (count (lambda (line)
((negate char-set-contains?)
(char-set #\+ #\-)
(string-ref line 0)))
(hunk-diff-lines hunk))))
(define %original-file-cache
(make-hash-table))
(define (read-original-file file-name)
"Return the contents of FILE-NAME prior to any changes."
(let* ((port (open-pipe* OPEN_READ
"git" "cat-file" "-p" (string-append
"HEAD:" file-name)))
(contents (get-string-all port)))
(close-pipe port)
contents))
(define (read-original-file* file-name)
"Caching variant of READ-ORIGINAL-FILE."
(or (hashv-ref %original-file-cache file-name)
(let ((value (read-original-file file-name)))
(hashv-set! %original-file-cache file-name value)
value)))
(define (old-sexp hunk)
"Using the diff information in HUNK return the unmodified S-expression
corresponding to the top-level definition containing the staged changes."
;; TODO: We can't seek with a pipe port...
(call-with-input-string (read-original-file* (hunk-file-name hunk))
(lambda (port)
(surrounding-sexp port
(+ (lines-to-first-change hunk)
(hunk-old-line-number hunk))))))
(define (new-sexp hunk)
"Using the diff information in HUNK return the modified S-expression
corresponding to the top-level definition containing the staged changes."
(call-with-input-file (hunk-file-name hunk)
(lambda (port)
(surrounding-sexp port
(+ (lines-to-first-change hunk)
(hunk-new-line-number hunk))))))
(define* (change-commit-message file-name old new #:optional (port (current-output-port)))
"Print ChangeLog commit message for changes between OLD and NEW."
(define (get-values expr field)
(match ((xpath:node-or
(xpath:sxpath `(*any* *any* package ,field quasiquote *))
;; For let binding
(xpath:sxpath `(*any* *any* (*any*) package ,field quasiquote *)))
(cons '*TOP* expr))
(()
;; New-style plain lists
(match ((xpath:node-or
(xpath:sxpath `(*any* *any* package ,field list *))
;; For let binding
(xpath:sxpath `(*any* *any* (*any*) package ,field list *)))
(cons '*TOP* expr))
((inner) inner)
(_ '())))
;; Old-style labelled inputs
((first . rest)
(map cadadr first))))
(define (listify items)
(match items
((one) one)
((one two)
(string-append one " and " two))
((one two . more)
(string-append (string-join (drop-right items 1) ", ")
", and " (first (take-right items 1))))))
(define variable-name
(second old))
(define version
(and=> ((xpath:node-or
(xpath:sxpath '(*any* *any* package version *any*))
;; For let binding
(xpath:sxpath '(*any* *any* (*any*) package version *any*)))
(cons '*TOP* new))
first))
(format port
"rosenthal: ~a: Update to ~a.~%~%* ~a (~a): Update to ~a.~%"
variable-name version file-name variable-name version)
(for-each (lambda (field)
(let ((old-values (get-values old field))
(new-values (get-values new field)))
(or (equal? old-values new-values)
(let ((removed (lset-difference equal? old-values new-values))
(added (lset-difference equal? new-values old-values)))
(format port
"[~a]: ~a~%" field
(break-string
;; A dependency can be a list of (pkg output).
(match (list (map object->string removed)
(map object->string added))
((() added)
(format #f "Add ~a."
(listify added)))
((removed ())
(format #f "Remove ~a."
(listify removed)))
((removed added)
(format #f "Remove ~a; add ~a."
(listify removed)
(listify added))))))))))
'(inputs propagated-inputs native-inputs)))
(define* (add-commit-message file-name variable-name
#:optional (port (current-output-port)))
"Print ChangeLog commit message for a change to FILE-NAME adding a
definition."
(format port "rosenthal: Add ~a.~%~%* ~a (~a): New variable.~%"
variable-name file-name variable-name))
(define* (remove-commit-message file-name variable-name
#:optional (port (current-output-port)))
"Print ChangeLog commit message for a change to FILE-NAME removing a
definition."
(format port "rosenthal: Remove ~a.~%~%* ~a (~a): Delete variable.~%"
variable-name file-name variable-name))
(define* (custom-commit-message file-name variable-name message changelog
#:optional (port (current-output-port)))
"Print custom commit message for a change to VARIABLE-NAME in FILE-NAME, using
MESSAGE as the commit message and CHANGELOG as the body of the ChangeLog
entry. If CHANGELOG is #f, the commit message is reused. If CHANGELOG already
contains ': ', no colon is inserted between the location and body of the
ChangeLog entry."
(define (trim msg)
(string-trim-right (string-trim-both msg) (char-set #\.)))
(define (changelog-has-location? changelog)
(->bool (string-match "^[[:graph:]]+:[[:blank:]]" changelog)))
(let* ((message (trim message))
(changelog (if changelog (trim changelog) message))
(message/f (format #f "rosenthal: ~a: ~a." variable-name message))
(changelog/f (if (changelog-has-location? changelog)
(format #f "* ~a (~a)~a."
file-name variable-name changelog)
(format #f "* ~a (~a): ~a."
file-name variable-name changelog))))
(format port
"~a~%~%~a~%"
(break-string-with-newlines message/f 72)
(break-string-with-newlines changelog/f 72))))
(define (add-copyright-line line)
"Add the copyright line on LINE to the previous commit."
(let ((author (match:substring
(string-match "^\\+;;; Copyright ©[^[:alpha:]]+(.*)$" line)
1)))
(format
(current-output-port) "Amend and add copyright line for ~a~%" author)
(system* "git" "commit" "--amend" "--no-edit")))
(define (group-hunks-by-sexp hunks)
"Return a list of pairs associating all hunks with the S-expression they are
modifying."
(fold (lambda (sexp hunk acc)
(match acc
(((previous-sexp . hunks) . rest)
(if (equal? sexp previous-sexp)
(cons (cons previous-sexp
(cons hunk hunks))
rest)
(cons (cons sexp (list hunk))
acc)))
(_
(cons (cons sexp (list hunk))
acc))))
'()
(map new-sexp hunks)
hunks))
(define (new+old+hunks hunks)
(map (match-lambda
((new . hunks)
(cons* new (old-sexp (first hunks)) hunks)))
(group-hunks-by-sexp hunks)))
(define %delay 1000)
(define (main . args)
(define* (change-commit-message* file-name old new #:rest rest)
(let ((changelog #f))
(match args
((or (message changelog) (message))
(apply custom-commit-message
file-name (second old) message changelog rest))
(_
(apply change-commit-message file-name old new rest)))))
(read-disable 'positions)
(match (diff-info)
(()
(display "Nothing to be done.\n" (current-error-port)))
(hunks
(let-values (((definitions changes) (partition hunk-type hunks)))
;; Additions/removals.
(for-each
(lambda (hunk)
(and-let* ((define-line (find (cut string-match "(\\+|-)\\(define" <>)
(hunk-diff-lines hunk)))
(variable-name (and=> (string-tokenize define-line)
second))
(commit-message-proc (match (hunk-type hunk)
('addition add-commit-message)
('removal remove-commit-message))))
(commit-message-proc (hunk-file-name hunk) variable-name)
(let ((port (open-pipe* OPEN_WRITE
"git" "apply"
"--cached"
"--unidiff-zero")))
(hunk->patch hunk port)
(unless (eqv? 0 (status:exit-val (close-pipe port)))
(error "Cannot apply")))
(let ((port (open-pipe* OPEN_WRITE "git" "commit" "-F" "-")))
(commit-message-proc (hunk-file-name hunk) variable-name port)
(usleep %delay)
(unless (eqv? 0 (status:exit-val (close-pipe port)))
(error "Cannot commit"))))
(usleep %delay))
definitions)
;; Changes.
(for-each
(match-lambda
((new old . hunks)
(for-each (lambda (hunk)
(let ((port (open-pipe* OPEN_WRITE
"git" "apply"
"--cached"
"--unidiff-zero")))
(hunk->patch hunk port)
(unless (eqv? 0 (status:exit-val (close-pipe port)))
(error "Cannot apply")))
(usleep %delay))
hunks)
(define copyright-line
(any (lambda (line) (and=> (string-prefix? "+;;; Copyright ©" line)
(const line)))
(hunk-diff-lines (first hunks))))
(cond
(copyright-line
(add-copyright-line copyright-line))
(else
(let ((port (open-pipe* OPEN_WRITE "git" "commit" "-F" "-")))
(change-commit-message* (hunk-file-name (first hunks))
old new)
(change-commit-message* (hunk-file-name (first hunks))
old new
port)
(usleep %delay)
(unless (eqv? 0 (status:exit-val (close-pipe port)))
(error "Cannot commit")))))))
(new+old+hunks (match definitions
('() changes) ;reuse
(_
;; XXX: we recompute the hunks here because previous
;; insertions lead to offsets.
(let-values (((definitions changes)
(partition hunk-type (diff-info))))
changes)))))))))
(apply main (cdr (command-line)))

35
etc/manifest.scm Normal file
View File

@ -0,0 +1,35 @@
;; SPDX-FileCopyrightText: 2025 Hilton Chain <hako@ultrarare.space>
;;
;; SPDX-License-Identifier: CC0-1.0
(specifications->manifest
'(
"atuin"
"cloudflare-warp-bin"
"cloudflared"
"dinit"
"komga-bin"
"mihomo-bin"
"navidrome-bin"
"niri"
"shadow-tls-bin"
"sing-box-bin"
"tree-sitter-yaml"
"wakapi-bin"
"wakatime-cli-bin"
"xwayland-satellite"
;; TODO: Updater unavailable.
;; "bitwarden-icecat"
;; "miniflux-injector-icecat"
;; "sidebery-icecat"
;; "clash-bin"
;; "dnsmasq-china-list"
;; "emacs-pcmpl-tailscale"
;; "emacs-wakatime-mode"
;; "forgejo"
;; "grub-efi-luks2"
;; "hugo"
;; "socks2http"
;; "tailscale"
))

View File

@ -1,8 +0,0 @@
;; SPDX-FileCopyrightText: 2025 Hilton Chain <hako@ultrarare.space>
;;
;; SPDX-License-Identifier: CC0-1.0
(use-modules (guix profiles)
(rosenthal packages))
(manifest (map package->manifest-entry (all-rosenthal-packages)))

View File

@ -1,16 +0,0 @@
;; SPDX-FileCopyrightText: 2025 Hilton Chain <hako@ultrarare.space>
;;
;; SPDX-License-Identifier: CC0-1.0
(use-modules (guix packages)
(guix profiles)
(rosenthal packages))
(define (disable-updater? p)
(let ((properties (package-properties p)))
(and (assq 'rosenthal-update? properties)
(not (assq-ref properties 'rosenthal-update?)))))
(manifest (map package->manifest-entry
(filter (negate disable-updater?)
(all-rosenthal-packages))))

View File

@ -1,16 +0,0 @@
;; SPDX-FileCopyrightText: 2025 Hilton Chain <hako@ultrarare.space>
;;
;; SPDX-License-Identifier: CC0-1.0
(use-modules (guix packages)
(guix profiles)
(rosenthal packages))
(define (disable-updater? p)
(let ((properties (package-properties p)))
(and (assq 'rosenthal-update? properties)
(not (assq-ref properties 'rosenthal-update?)))))
(manifest (map package->manifest-entry
(filter disable-updater?
(all-rosenthal-packages))))

View File

@ -5,18 +5,12 @@
(define-module (rosenthal packages) (define-module (rosenthal packages)
#:use-module (gnu packages) #:use-module (gnu packages)
#:use-module (guix diagnostics) #:use-module (guix diagnostics)
#:use-module (guix discovery)
#:use-module (guix i18n) #:use-module (guix i18n)
#:use-module (guix memoization)
#:use-module (guix packages)
#:use-module (guix ui)
#:use-module (ice-9 match) #:use-module (ice-9 match)
#:use-module (srfi srfi-34) #:use-module (srfi srfi-34)
#:replace (%patch-path #:replace (%patch-path
search-patch) search-patch)
#:export (rosenthal-patches #:export (rosenthal-patches))
%rosenthal-package-module-path
all-rosenthal-packages))
;;; Commentary: ;;; Commentary:
;;; ;;;
@ -46,9 +40,6 @@
(try ("rosenthal/packages/binaries.scm" rosenthal/ packages/) (try ("rosenthal/packages/binaries.scm" rosenthal/ packages/)
("rosenthal/packages.scm" rosenthal/)))) ("rosenthal/packages.scm" rosenthal/))))
(define %rosenthal-package-module-path
`((,%rosenthal-root-directory . "rosenthal/packages")))
(define %patch-path (define %patch-path
;; Define it after '%package-module-path' so that '%load-path' contains user ;; Define it after '%package-module-path' so that '%load-path' contains user
;; directories, allowing patches in $GUIX_PACKAGE_PATH to be found. ;; directories, allowing patches in $GUIX_PACKAGE_PATH to be found.
@ -73,29 +64,3 @@
"Return the list of absolute file names corresponding to each "Return the list of absolute file names corresponding to each
FILE-NAME found in %PATCH-PATH." FILE-NAME found in %PATCH-PATH."
(list (search-patch file-name) ...)) (list (search-patch file-name) ...))
;; Adapted from (@ (gnu packages) all-packages).
(define all-rosenthal-packages
(mlambda ()
"Return the list of all public packages, including replacements and hidden
packages, excluding superseded packages."
;; Note: 'fold-packages' never traverses the same package twice but
;; replacements break that (they may or may not be visible to
;; 'fold-packages'), hence this hash table to track visited packages.
(define visited (make-hash-table))
(fold-packages (lambda (package result)
(if (hashq-ref visited package)
result
(begin
(hashq-set! visited package #t)
(match (package-replacement package)
((? package? replacement)
(hashq-set! visited replacement #t)
(cons* replacement package result))
(#f
(cons package result))))))
'()
(all-modules %rosenthal-package-module-path #:warn warn-about-load-error)
;; Dismiss deprecated packages but keep hidden packages.
#:select? (negate package-superseded))))

View File

@ -19,7 +19,7 @@
(define-public dinit (define-public dinit
(package (package
(name "dinit") (name "dinit")
(version "0.19.4") (version "0.19.3")
(source (source
(origin (origin
(method git-fetch) (method git-fetch)
@ -28,7 +28,7 @@
(commit (string-append "v" version)))) (commit (string-append "v" version))))
(file-name (git-file-name name version)) (file-name (git-file-name name version))
(sha256 (sha256
(base32 "09k7airphnpg6hmif91d9nfi5fhz40qh52sp8vnrshfy7mhkq571")))) (base32 "0gw5jvh9bxnnwdv7ajscs03d6x2hcs9i3hxkqfjs19d4wr5rghyq"))))
(build-system meson-build-system) (build-system meson-build-system)
(arguments (arguments
(list #:configure-flags (list #:configure-flags

View File

@ -3,7 +3,6 @@
;; SPDX-License-Identifier: GPL-3.0-or-later ;; SPDX-License-Identifier: GPL-3.0-or-later
(define-module (rosenthal packages binaries) (define-module (rosenthal packages binaries)
#:use-module (srfi srfi-1)
#:use-module ((guix licenses) #:prefix license:) #:use-module ((guix licenses) #:prefix license:)
#:use-module (guix gexp) #:use-module (guix gexp)
#:use-module (guix deprecation) #:use-module (guix deprecation)
@ -30,7 +29,7 @@
(define-public atuin-bin (define-public atuin-bin
(deprecated-package "atuin-bin" atuin)) (deprecated-package "atuin-bin" atuin))
(define-public bitwarden (define bitwarden
(package (package
(name "bitwarden") (name "bitwarden")
(version "2025.3.1") (version "2025.3.1")
@ -51,24 +50,74 @@
(description (description
"This package provides browser extension for Bitwarden client.") "This package provides browser extension for Bitwarden client.")
(license license:gpl3) (license license:gpl3)
(properties (properties '((addon-id . "{446900e4-71c2-419f-a6a7-df9c091e268b}")))))
'((addon-id . "{446900e4-71c2-419f-a6a7-df9c091e268b}")
(hidden? . #t)
(rosenthal-update? . #f)))))
(define-public bitwarden/icecat (define-public bitwarden/icecat
(let ((base (make-icecat-extension bitwarden))) (make-icecat-extension bitwarden))
(package
(inherit base) (define-public clash-bin
(properties (package
`(,@(alist-delete 'hidden? (package-properties base)) (name "clash-bin")
(rosenthal-update? . #f)))))) (version "1.18.0")
(source (origin
(method url-fetch)
(uri (string-append
"https://github.com/Dreamacro/clash/releases/download/v"
version "/clash-linux-amd64-v3-v" version ".gz"))
(sha256
(base32
"0gchpc4pvy24dvhb5nk08g97rswjqr1ic6i405f1ba5snfv8i5z8"))))
(build-system copy-build-system)
(arguments
(list #:install-plan
#~'((#$(format #f "clash-linux-amd64-v3-v~a" version) "bin/clash"))
#:phases
#~(modify-phases %standard-phases
(add-after 'install 'fix-permission
(lambda _
(chmod (string-append #$output "/bin/clash") #o555))))))
(supported-systems '("x86_64-linux"))
(home-page "https://github.com/Dreamacro/clash")
(synopsis "Rule-based tunnel in Go")
(description
"Clash is a cross-platform rule-based proxy utility that runs on the
network and application layer, supporting various proxy and anti-censorship
protocols out-of-the-box.")
(license license:gpl3)))
(define-public hugo-bin (define-public hugo-bin
(deprecated-package "hugo-bin" hugo)) (deprecated-package "hugo-bin" hugo))
(define-public mihomo-bin (define-public mihomo-bin
(deprecated-package "mihomo-bin" mihomo)) (package
(name "mihomo-bin")
(version "1.19.5")
(source (origin
(method url-fetch)
(uri (string-append
"https://github.com/MetaCubeX/mihomo/releases/download/v"
version "/mihomo-linux-amd64-v" version ".gz"))
(sha256
(base32
"1x7i7v1gkfgc19fmsn9annv8nvwfl6w5pqr1m3982plzabnlr1ni"))))
(build-system copy-build-system)
(arguments
(list #:install-plan
#~'((#$(string-append
"mihomo-linux-amd64-v" (package-version this-package))
"bin/mihomo"))
#:phases
#~(modify-phases %standard-phases
(add-after 'install 'fix-permission
(lambda _
(chmod (string-append #$output "/bin/mihomo") #o555))))))
(supported-systems '("x86_64-linux"))
(home-page "https://wiki.metacubex.one/")
(synopsis "Rule-based tunnel in Go")
(description
"This package provides @command{mihomo}, another @code{clash} kernel.")
(license license:gpl3)
(properties '((upstream-name . "mihomo")))))
(define-public clash-meta-bin (define-public clash-meta-bin
(deprecated-package "clash-meta-bin" mihomo-bin)) (deprecated-package "clash-meta-bin" mihomo-bin))
@ -76,7 +125,7 @@
(define-public cloudflare-warp-bin (define-public cloudflare-warp-bin
(package (package
(name "cloudflare-warp-bin") (name "cloudflare-warp-bin")
(version "2025.4.929.0") (version "2025.2.600.0")
(source (origin (source (origin
(method url-fetch) (method url-fetch)
(uri (string-append "https://pkg.cloudflareclient.com" (uri (string-append "https://pkg.cloudflareclient.com"
@ -84,7 +133,7 @@
"cloudflare-warp_" version "_amd64.deb")) "cloudflare-warp_" version "_amd64.deb"))
(sha256 (sha256
(base32 (base32
"1ygqr6l7lsbkq1f8qwgypv2flyjd430sjkrwsw8rhd2lgnvwisff")))) "0rabxl6vfj3pljn77w96kb2k9w99hh5pvis1grr4im6lf5m86xsj"))))
(build-system copy-build-system) (build-system copy-build-system)
(arguments (arguments
(list #:install-plan (list #:install-plan
@ -189,14 +238,11 @@ eBooks.")
(license license:expat) (license license:expat)
(properties '((upstream-name . "komga"))))) (properties '((upstream-name . "komga")))))
(define-public miniflux-injector (define miniflux-injector
(package (package
(name "miniflux-injector") (name "miniflux-injector")
(version "2.3.3") (version "2.3.3")
(properties (properties '((addon-id . "{528ec801-2e29-4cb9-ae71-5a90503138d1}")))
'((addon-id . "{528ec801-2e29-4cb9-ae71-5a90503138d1}")
(hidden? . #t)
(rosenthal-update? . #f)))
(source (source
(origin (origin
(method url-fetch/zipbomb) (method url-fetch/zipbomb)
@ -231,38 +277,7 @@ results are added in a sidebar next to search engine results.")
(license license:expat))) (license license:expat)))
(define-public miniflux-injector/icecat (define-public miniflux-injector/icecat
(let ((base (make-icecat-extension miniflux-injector))) (make-icecat-extension miniflux-injector))
(package
(inherit base)
(properties
`(,@(alist-delete 'hidden? (package-properties base))
(rosenthal-update? . #f))))))
(define-public navidrome-bin
(package
(name "navidrome-bin")
(version "0.55.2")
(source (origin
(method url-fetch)
(uri (string-append
"https://github.com/navidrome/navidrome/releases/download/v"
version "/navidrome_" version "_linux_amd64.tar.gz"))
(sha256
(base32
"0h3984p10am39y619ibrvk1g96ra52kig929n792399q2jw1lrlp"))))
(build-system copy-build-system)
(arguments
(list #:install-plan
#~'(("navidrome" "bin/"))))
(supported-systems '("x86_64-linux"))
(home-page "https://www.navidrome.org/")
(synopsis "Web-based music collection server and streamer")
(description
"Navidrome is a self-hosted music server that allows users to stream and
manage their music collections. It provides a web interface and is compatible
with the Subsonic API.")
(license license:expat)
(properties '((upstream-name . "navidrome")))))
(define-public shadow-tls-bin (define-public shadow-tls-bin
(package (package
@ -294,8 +309,56 @@ monster-in-the-middle}.")
(license license:expat) (license license:expat)
(properties '((upstream-name . "shadow-tls"))))) (properties '((upstream-name . "shadow-tls")))))
(define sidebery
(package
(name "sidebery")
(version "5.3.3.7")
(source
(origin
(method url-fetch/zipbomb)
(uri (string-append
"https://github.com/mbnuqw/sidebery/releases/download/v"
(string-drop-right version 2) "/sidebery-" version ".xpi"))
(sha256
(base32
"0srply73aa3i353w8d6zlqn55wqb2ndmcmzzr4n3dsxr5hynpypx"))))
(build-system copy-build-system)
(arguments
(list
#:install-plan
#~'(("." #$(assq-ref (package-properties this-package) 'addon-id)))))
(home-page "https://github.com/mbnuqw/sidebery")
(synopsis "Manage tabs and bookmarks in sidebar")
(description
"This package provides a browser extension for managing tabs and bookmarks
in sidebar.")
(license license:expat)
(properties '((addon-id . "{3c078156-979c-498b-8990-85f7987dd929}")))))
(define-public sidebery/icecat
(make-icecat-extension sidebery))
(define-public sing-box-bin (define-public sing-box-bin
(deprecated-package "sing-box-bin" sing-box)) (package
(name "sing-box-bin")
(version "1.11.8")
(source (origin
(method url-fetch)
(uri (string-append
"https://github.com/SagerNet/sing-box/releases/download/v"
version "/sing-box-" version "-linux-amd64.tar.gz"))
(sha256
(base32
"0fdv8wvkydm20fgpy30hm3b6v3vz09pim178faximpyv4846m46z"))))
(build-system copy-build-system)
(arguments (list #:install-plan #~'(("sing-box" "bin/"))))
(supported-systems '("x86_64-linux"))
(home-page "https://sing-box.sagernet.org/")
(synopsis "Universal proxy platform")
(description
"This package provides @command{sing-box}, a universal proxy platform.")
(license license:gpl3+)
(properties '((upstream-name . "sing-box")))))
(define-public tailscale-bin (define-public tailscale-bin
(deprecated-package "tailscale-bin" tailscale)) (deprecated-package "tailscale-bin" tailscale))
@ -303,7 +366,7 @@ monster-in-the-middle}.")
(define-public wakapi-bin (define-public wakapi-bin
(package (package
(name "wakapi-bin") (name "wakapi-bin")
(version "2.13.4") (version "2.13.3")
(source (origin (source (origin
(method url-fetch) (method url-fetch)
(uri (string-append (uri (string-append
@ -311,7 +374,7 @@ monster-in-the-middle}.")
version "/wakapi_linux_amd64.zip")) version "/wakapi_linux_amd64.zip"))
(sha256 (sha256
(base32 (base32
"07wylvgi8yqcmywpvgbsqyhza86nmg8dfx1apmaynlw80y0nzial")))) "1znlp9h1rvisas6qf5r76yg0mbiiqxwgrqcc10gvcjsjrib844av"))))
(build-system copy-build-system) (build-system copy-build-system)
(arguments (list #:install-plan #~'(("wakapi" "bin/wakapi")))) (arguments (list #:install-plan #~'(("wakapi" "bin/wakapi"))))
(supported-systems '("x86_64-linux")) (supported-systems '("x86_64-linux"))
@ -327,7 +390,7 @@ coding statistics.")
(define-public wakatime-cli-bin (define-public wakatime-cli-bin
(package (package
(name "wakatime-cli-bin") (name "wakatime-cli-bin")
(version "1.115.2") (version "1.115.1")
(source (origin (source (origin
(method url-fetch) (method url-fetch)
(uri (string-append "https://github.com/wakatime/wakatime-cli" (uri (string-append "https://github.com/wakatime/wakatime-cli"
@ -335,7 +398,7 @@ coding statistics.")
"/wakatime-cli-linux-amd64.zip")) "/wakatime-cli-linux-amd64.zip"))
(sha256 (sha256
(base32 (base32
"012s2r55iwd8kglh26sbscaps0iccdhk0ccaqf55kcfsbi35qc91")))) "1dd4r963kfka0iq6471sid4zrqkjbdm4lw8fyhx24rk0085lhcap"))))
(build-system copy-build-system) (build-system copy-build-system)
(arguments (arguments
(list #:install-plan (list #:install-plan

View File

@ -47,7 +47,4 @@
(delete-file "configure"))))))) (delete-file "configure")))))))
(native-inputs (native-inputs
(modify-inputs (package-native-inputs base) (modify-inputs (package-native-inputs base)
(append autoconf automake python-minimal-wrapper))) (append autoconf automake python-minimal-wrapper))))))
(properties
`(,@(package-properties base)
(rosenthal-update? . #f))))))

View File

@ -25,7 +25,4 @@
;; FIXME: All mdev tests fail when building staticly. ;; FIXME: All mdev tests fail when building staticly.
(add-before 'check 'disable-failing-tests (add-before 'check 'disable-failing-tests
(lambda _ (lambda _
(delete-file "testsuite/mdev.tests"))))))) (delete-file "testsuite/mdev.tests"))))))))))
(properties
`(,@(package-properties base)
(rosenthal-update? . #f))))))

View File

@ -58,6 +58,4 @@ foreign CDN results so you also get best CDN node for your VPN at the same
time. time.
@item Block ISP ads on NXDOMAIN result (like 114so). @item Block ISP ads on NXDOMAIN result (like 114so).
@end itemize") @end itemize")
(license license:wtfpl2) (license license:wtfpl2))))
(properties
'((rosenthal-update? . #f))))))

View File

@ -6,29 +6,9 @@
#:use-module ((guix licenses) #:prefix license:) #:use-module ((guix licenses) #:prefix license:)
#:use-module (guix build-system emacs) #:use-module (guix build-system emacs)
#:use-module (guix gexp) #:use-module (guix gexp)
#:use-module (guix download)
#:use-module (guix git-download) #:use-module (guix git-download)
#:use-module (guix packages)) #:use-module (guix packages))
(define-public emacs-nftables-mode
(package
(name "emacs-nftables-mode")
(version "1.1")
(source
(origin
(method url-fetch)
(uri (string-append "https://elpa.gnu.org/packages/nftables-mode-"
version ".tar"))
(sha256
(base32 "1wjw6n60kj84j8gj62mr6s97xd0aqvr4v7npyxwmhckw9z13xcqv"))))
(build-system emacs-build-system)
(home-page "https://elpa.gnu.org/packages/nftables-mode.html")
(synopsis "Major mode for editing nftables scripts")
(description
"@code{nftables-mode} is an Emacs major mode for editing nftables scripts.
It currently only offers basic highlighting and primitive indentation.")
(license license:gpl3+)))
(define-public emacs-pcmpl-tailscale (define-public emacs-pcmpl-tailscale
(let ((commit "acd6bce54af506b0450cf6aa1068f63d4e25c8ce") (let ((commit "acd6bce54af506b0450cf6aa1068f63d4e25c8ce")
(revision "0")) (revision "0"))
@ -50,34 +30,7 @@ It currently only offers basic highlighting and primitive indentation.")
(description (description
"This package provides enhanced completions for the tailscale command "This package provides enhanced completions for the tailscale command
and it's subcommands.") and it's subcommands.")
(license license:gpl3+) (license license:gpl3+))))
(properties
'((rosenthal-update? . #f))))))
(define-public emacs-treesit-auto
(package
(name "emacs-treesit-auto")
;; NOTE: Not tagged, also change commit when updating.
(version "1.0.7")
(source
(origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/renzmann/treesit-auto")
(commit "016bd286a1ba4628f833a626f8b9d497882ecdf3")))
(file-name (git-file-name name version))
(sha256
(base32 "03bvam7cpxqp4idhd235n76qdqhsbgw7m2lphy8qqwslbmcq23m4"))))
(build-system emacs-build-system)
(home-page "https://github.com/renzmann/treesit-auto")
(synopsis "Automatically use tree-sitter major modes")
(description
"@code{treesit-auto} is an Emacs package for automatically using tree-sitter
major modes and falling back to the original major mode when its tree-sitter
counterpart is unavailable.")
(license license:gpl3+)
(properties
'((rosenthal-update? . #f)))))
;; https://issues.guix.gnu.org/59552 ;; https://issues.guix.gnu.org/59552
(define-public emacs-wakatime-mode (define-public emacs-wakatime-mode
@ -108,6 +61,4 @@ counterpart is unavailable.")
(description (description
"WakaTime mode is an Emacs minor mode for automatic time tracking and "WakaTime mode is an Emacs minor mode for automatic time tracking and
metrics generated from your programming activity.") metrics generated from your programming activity.")
(license license:gpl3+) (license license:gpl3+))))
(properties
'((rosenthal-update? . #f))))))

View File

@ -1,52 +0,0 @@
;; SPDX-FileCopyrightText: 2025 Hilton Chain <hako@ultrarare.space>
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
(define-module (rosenthal packages golang)
#:use-module (guix packages)
#:use-module ((guix build utils) #:select (alist-replace))
#:use-module (guix git-download)
#:use-module (gnu packages golang))
(define-public go-1.24
(package
(inherit go-1.23)
(name "go")
(version "1.24.2")
(source
(origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/golang/go")
(commit (string-append "go" version))))
(file-name (git-file-name name version))
(sha256
(base32 "199yajw3amvspl9k2a75v4jblwr965laqngxbnsi5l3ragp5c1ck"))))
(native-inputs
;; Go 1.24 and later requires Go 1.22+ as the bootstrap toolchain.
(alist-replace "go" (list go-1.22) (package-native-inputs go-1.23)))
(properties
`(,@(package-properties go-1.23)
(rosenthal-update? . #f)))))
(define-public go-cloudflare
(let ((commit "37bc41c6ff79507200a315b72834fce6ca427a7e")
(revision "0"))
(package
(inherit go-1.22)
(name "go-cloudflare")
(version (git-version "1.22.12" revision commit))
(source (origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/cloudflare/go")
(commit commit)))
(file-name (git-file-name name version))
(sha256
(base32
"1zg6jqwhj42gaapk1fzqc4i7a6shdbfbpqgqhjyry55r4i0nqvxy"))))
(home-page "https://github.com/cloudflare/go")
(synopsis "Go with Cloudflare experimental patches")
(properties
`(,@(package-properties go-1.22)
(rosenthal-update? . #f))))))

View File

@ -9,12 +9,8 @@
#:use-module (guix git-download) #:use-module (guix git-download)
#:use-module (guix packages) #:use-module (guix packages)
#:use-module (rosenthal utils download) #:use-module (rosenthal utils download)
#:use-module (gnu packages base)
#:use-module (gnu packages dns)
#:use-module (gnu packages golang) #:use-module (gnu packages golang)
#:use-module (gnu packages golang-build) #:use-module (gnu packages golang-build))
#:use-module (gnu packages linux)
#:use-module (rosenthal packages golang))
(define-public cloudflared (define-public cloudflared
(package (package
@ -34,7 +30,7 @@
"0mblq1zvl7722k3515yc99ym18li39anlcmj8s10m7kkp9yfc596")))) "0mblq1zvl7722k3515yc99ym18li39anlcmj8s10m7kkp9yfc596"))))
(build-system go-build-system) (build-system go-build-system)
(arguments (arguments
(list #:go go-cloudflare (list #:go go-1.23
#:install-source? #f #:install-source? #f
#:import-path "github.com/cloudflare/cloudflared/cmd/cloudflared" #:import-path "github.com/cloudflare/cloudflared/cmd/cloudflared"
#:unpack-path "github.com/cloudflare/cloudflared" #:unpack-path "github.com/cloudflare/cloudflared"
@ -67,162 +63,6 @@ this daemon, without requiring you to poke holes on your firewall --- your
origin can remain as closed as possible.") origin can remain as closed as possible.")
(license license:asl2.0))) (license license:asl2.0)))
(define-public mihomo
(package
(name "mihomo")
(version "1.19.8")
(source (origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/MetaCubeX/mihomo")
(commit (string-append "v" version))))
(file-name (git-file-name name version))
(sha256
(base32
"0wnzaji5yzj8hvjifgnmhg371mm94bc89bb2m1dmsqsp30m3dj0b"))))
(build-system go-build-system)
(arguments
(list
#:tests? (not (%current-target-system)) ;TODO: Run test suite.
#:go go-1.23
#:install-source? #f
#:import-path "."
#:build-flags
#~(list "-tags" "with_gvisor"
(string-append
"-ldflags="
" -X github.com/metacubex/mihomo/constant.Version="
#$(package-version this-package)))
#:modules
'((ice-9 match)
((guix build gnu-build-system) #:prefix gnu:)
(guix build go-build-system)
(guix build utils))
#:phases
#~(modify-phases %standard-phases
(replace 'unpack
(lambda args
(unsetenv "GO111MODULE")
(apply (assoc-ref gnu:%standard-phases 'unpack) args)
(copy-recursively
#+(this-package-native-input "vendored-go-dependencies")
"vendor")))
(replace 'install-license-files
(assoc-ref gnu:%standard-phases 'install-license-files))
(delete 'check)
(add-after 'install 'check
(lambda* (#:key tests? #:allow-other-keys)
(when tests?
(let ((mihomo (in-vicinity #$output "bin/mihomo")))
(invoke mihomo "--help")
(invoke mihomo "-v"))))))))
(native-inputs
(append
(list (origin
(method (go-mod-vendor #:go go-1.23))
(uri (package-source this-package))
(file-name "vendored-go-dependencies")
(sha256
(base32
"1275yq3n7dg7hbw7vj5i1dqi83qgin77iavqxbc2gw8dawbd9plg"))))
(if (%current-target-system)
(list this-package)
'())))
(home-page "https://wiki.metacubex.one/")
(synopsis "Rule-based proxy")
(description
"Mihomo is an anti-censorship proxy application, originally known as
\"Clash Meta\", designed to facilitate secure and flexible internet access.
It supports various protocols, making it a versatile tool for users seeking to
bypass network restrictions." )
(license license:gpl3+)))
(define-public sing-box
(package
(name "sing-box")
(version "1.11.10")
(source (origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/SagerNet/sing-box")
(commit (string-append "v" version))))
(file-name (git-file-name name version))
(sha256
(base32
"07vsg2zch1z6wk5k0zqj81n95l3crgzkgvafxkyy7za7y72h1jhr"))))
(build-system go-build-system)
(arguments
(list
#:tests? (not (%current-target-system)) ;TODO: Run test suite.
#:go go-1.23
#:install-source? #f
#:import-path "./cmd/sing-box"
#:build-flags
#~(list "-tags" (string-join
'("with_quic"
"with_dhcp"
"with_wireguard"
"with_ech"
"with_utls"
"with_reality_server"
"with_acme"
"with_clash_api"
"with_gvisor"))
(string-append
"-ldflags="
" -X github.com/sagernet/sing-box/constant.Version="
#$(package-version this-package)))
#:modules
'((ice-9 match)
((guix build gnu-build-system) #:prefix gnu:)
(guix build go-build-system)
(guix build utils))
#:phases
#~(modify-phases %standard-phases
(replace 'unpack
(lambda args
(unsetenv "GO111MODULE")
(apply (assoc-ref gnu:%standard-phases 'unpack) args)
(copy-recursively
#+(this-package-native-input "vendored-go-dependencies")
"vendor")))
(replace 'install-license-files
(assoc-ref gnu:%standard-phases 'install-license-files))
(add-after 'install 'install-extras
(lambda _
(let ((sing-box
(or (which "sing-box")
(in-vicinity #$output "bin/sing-box"))))
(map
(match-lambda
((shell . path)
(let ((file (in-vicinity #$output path)))
(mkdir-p (dirname file))
(with-output-to-file file
(lambda ()
(invoke sing-box "completion" shell))))))
'(("bash" . "etc/bash_completion.d/sing-box")
("fish" . "share/fish/vendor_completions.d/sing-box.fish")
("zsh" . "share/zsh/site-functions/_sing-box")))))))))
(native-inputs
(append
(list (origin
(method (go-mod-vendor #:go go-1.23))
(uri (package-source this-package))
(file-name "vendored-go-dependencies")
(sha256
(base32
"11607z2j6q6y20z7lkvhcd8z498mry6291lx69j73qa88wbc0mzd"))))
(if (%current-target-system)
(list this-package)
'())))
(home-page "https://sing-box.sagernet.org/")
(synopsis "Universal proxy platform")
(description
"@command{sing-box} is a customizable and univsersal proxy platform that
can be used to create network proxy servers, clients and transparent proxies.")
(license license:gpl3+)))
(define-public socks2http (define-public socks2http
(package (package
(name "socks2http") (name "socks2http")
@ -246,15 +86,16 @@ can be used to create network proxy servers, clients and transparent proxies.")
(description (description
"This package provides a simple tool to plumb HTTP proxy requests through "This package provides a simple tool to plumb HTTP proxy requests through
a SOCKS5 proxy.") a SOCKS5 proxy.")
(license license:expat) (license license:expat)))
(properties
'((rosenthal-update? . #f)))))
(define-public tailscale (define-public tailscale
(package (package
(name "tailscale") (name "tailscale")
(version "1.82.5") (version "1.80.3")
(source (origin (source
(origin
(method go-vendored-fetch)
(uri (origin
(method git-fetch) (method git-fetch)
(uri (git-reference (uri (git-reference
(url "https://github.com/tailscale/tailscale") (url "https://github.com/tailscale/tailscale")
@ -262,44 +103,42 @@ a SOCKS5 proxy.")
(file-name (git-file-name name version)) (file-name (git-file-name name version))
(sha256 (sha256
(base32 (base32
"05g3bwmdmhdq45v04znly8v3jjxh45b0gh959x5g6k9yq27ssn04")) "07s8kwksvd0f9r65zkrhp3sn4jrv0c8g5w0wbiv9qq950l8gdv2h"))))
(modules '((guix build utils))) (file-name (git-file-name name version))
(snippet (sha256
'(begin (base32
(delete-file-recursively "tool") "0g2pzazrfl41s1gra2g3ni34ddgw32mb2rjlv8x17g3yc7axdbqa"))
(substitute* "net/tstun/tun_linux.go" (modules '((guix build utils)))
(("/sbin/(modprobe)" _ cmd) cmd)))))) (snippet '(delete-file-recursively "tool"))))
(build-system go-build-system) (build-system go-build-system)
(arguments (arguments
(list (list
#:tests? (not (%current-target-system)) ;TODO: Run test suite. #:go go-1.23
#:go go-1.24
#:install-source? #f #:install-source? #f
#:import-path "." #:import-path "."
#:build-flags #:build-flags
#~(list "-tags" "ts_include_cli" #~(list "-tags" "ts_include_cli"
(string-append (string-append
"-ldflags=" "-ldflags="
" -X tailscale.com/version.longStamp=" " -X tailscale.com/version.longStamp=v"
#$(package-version this-package) #$(package-version this-package)
" -X tailscale.com/version.shortStamp=" " -X tailscale.com/version.shortStamp=v"
#$(package-version this-package))) #$(package-version this-package)))
#:test-flags ''("-skip=^TestPackageDocs$")
#:test-subdirs ''(".")
#:modules #:modules
'((ice-9 match) '(((guix build gnu-build-system) #:prefix gnu:)
((guix build gnu-build-system) #:prefix gnu:)
(guix build go-build-system) (guix build go-build-system)
(guix build utils)) (guix build utils))
#:phases #:phases
#~(modify-phases %standard-phases #~(modify-phases %standard-phases
(replace 'unpack (replace 'unpack
(lambda args (lambda args
(unsetenv "GO111MODULE")
(apply (assoc-ref gnu:%standard-phases 'unpack) args) (apply (assoc-ref gnu:%standard-phases 'unpack) args)
(copy-recursively (unsetenv "GO111MODULE")))
#+(this-package-native-input "vendored-go-dependencies")
"vendor")))
(replace 'install-license-files (replace 'install-license-files
(assoc-ref gnu:%standard-phases 'install-license-files)) (assoc-ref gnu:%standard-phases 'install-license-files))
;; TODO: Fix command references.
(replace 'build (replace 'build
(lambda* (#:key build-flags parallel-build? #:allow-other-keys) (lambda* (#:key build-flags parallel-build? #:allow-other-keys)
(let* ((njobs (if parallel-build? (parallel-job-count) 1))) (let* ((njobs (if parallel-build? (parallel-job-count) 1)))
@ -312,69 +151,12 @@ a SOCKS5 proxy.")
,(string-append "tailscale.com/cmd/" pkg)))) ,(string-append "tailscale.com/cmd/" pkg))))
'("derper" '("derper"
"derpprobe" "derpprobe"
"tailscaled" "tailscale"
"tsidp")))))
(add-after 'install 'install-extras
(lambda _
(symlink (in-vicinity #$output "bin/tailscaled")
(in-vicinity #$output "bin/tailscale"))
(let ((tailscale
(or (which "tailscale")
(in-vicinity #$output "bin/tailscale"))))
(map
(match-lambda
((shell . path)
(let ((file (in-vicinity #$output path)))
(mkdir-p (dirname file))
(with-output-to-file file
(lambda ()
(invoke tailscale "completion" shell))))))
'(("bash" . "etc/bash_completion.d/tailscale")
("fish" . "share/fish/vendor_completions.d/tailscale.fish")
("zsh" . "share/zsh/site-functions/_tailscale"))))))
(add-after 'install 'wrap-binaries
(lambda* (#:key inputs #:allow-other-keys)
(wrap-program (in-vicinity #$output "bin/tailscaled")
`("PATH" ":" prefix
,(map (lambda (cmd)
(dirname (search-input-file inputs cmd)))
'("bin/find"
"bin/getent"
"bin/modprobe"
"sbin/ip"
"sbin/iptables"
"sbin/resolvconf"
"sbin/sysctl"))))))
(delete 'check)
(add-after 'install 'check
(lambda* (#:key tests? #:allow-other-keys)
(when tests?
(for-each
(lambda (cmd)
(invoke (string-append #$output "/bin/" cmd) "--help"))
'("derper"
"derpprobe"
"tailscaled" "tailscaled"
"tsidp")))))))) "tsidp"))))))))
(native-inputs
(append
(list (origin
(method (go-mod-vendor #:go go-1.24))
(uri (package-source this-package))
(file-name "vendored-go-dependencies")
(sha256
(base32
"15hpl0binvfwxazawd24xx32mxnfmpvprr5pk0854ashl0vj89aa"))))
(if (%current-target-system)
(list this-package)
'())))
(inputs
(list findutils glibc iproute iptables-nft kmod openresolv procps))
(home-page "https://tailscale.com/") (home-page "https://tailscale.com/")
(synopsis "Mesh VPN service utilizing the WireGuard protocol and 2FA") (synopsis "Private WireGuard® networks made easy")
(description (description
"Tailscale is a mesh VPN service that simplifies the process of securely "This package provides @command{tailscale}, which brings an easy and secure
connecting devices and services across various networks. It allows you to way to use WireGuard and 2FA.")
create a private network with minimal configuration and aims to remove the
complexity of building a trusted and secure network.")
(license license:bsd-3))) (license license:bsd-3)))

View File

@ -23,7 +23,4 @@
(modify-inputs (package-inputs base) (modify-inputs (package-inputs base)
(append `(,zlib "static")) (append `(,zlib "static"))
(replace "libtomcrypt" `(,libtomcrypt "static")) (replace "libtomcrypt" `(,libtomcrypt "static"))
(replace "libtommath" `(,libtommath "static")))) (replace "libtommath" `(,libtommath "static")))))))
(properties
`(,@(package-properties base)
(rosenthal-update? . #f))))))

View File

@ -35,6 +35,4 @@
(inherit base) (inherit base)
(arguments (arguments
(append '(#:tests? #f) ;FIXME (append '(#:tests? #f) ;FIXME
(package-arguments base))) (package-arguments base))))))
(properties
'((rosenthal-update? . #f))))))

View File

@ -20,7 +20,4 @@
((#:phases _) #~%standard-phases))) ((#:phases _) #~%standard-phases)))
(inputs (inputs
(modify-inputs (package-inputs base) (modify-inputs (package-inputs base)
(delete "libx11" "libxext" "libxfixes"))) (delete "libx11" "libxext" "libxfixes"))))))
(properties
`(,@(package-properties base)
(rosenthal-update? . #f))))))

View File

@ -12,102 +12,33 @@
#:use-module (guix build-system go) #:use-module (guix build-system go)
#:use-module (gnu packages golang) #:use-module (gnu packages golang)
#:use-module (gnu packages image) #:use-module (gnu packages image)
#:use-module (gnu packages web) #:use-module (gnu packages web))
#:use-module (gnu packages version-control)
#:use-module (rosenthal packages golang))
(define-public caddy (define-public buku-run-dev
(package (let ((revision "23")
(name "caddy") (commit "54fcdd77fc1e8e657b785b7d4ca8dc915e5f336b"))
(version "2.10.0") (package
(source (origin (inherit buku-run)
(method git-fetch) (name "buku-run-dev")
(uri (git-reference (version (git-version "0.1.1" revision commit))
(url "https://github.com/caddyserver/caddy") (source (origin
(commit (string-append "v" version)))) (method git-fetch)
(file-name (git-file-name name version)) (uri (git-reference
(sha256 (url "https://github.com/carnager/buku_run")
(base32 (commit commit)))
"00crxr956sp865pc3mg0zsacsy80s8v4jgqpmbq3hrsk2gcdsc47")) (file-name (git-file-name name version))
(modules '((guix build utils))) (sha256
(snippet '(substitute* "go.mod" (base32
(("^toolchain.*") ""))))) "079ygn39px71bypa54jn4z55iq24lxxcy7jv3ijy08iinqbfvldc")))))))
(build-system go-build-system)
(arguments
(list #:go go-1.24
#:tests? (not (%current-target-system)) ;TODO: Run test suite.
#:install-source? #f
#:import-path "./cmd/caddy"
#:build-flags
#~(list "-tags" "nobadger nomysql nopgx"
(string-append
"-ldflags="
" -X github.com/caddyserver/caddy/v2.CustomVersion="
#$(package-version this-package)))
#:modules
'((ice-9 match)
((guix build gnu-build-system) #:prefix gnu:)
(guix build go-build-system)
(guix build utils))
#:phases
#~(modify-phases %standard-phases
(replace 'unpack
(lambda args
(unsetenv "GO111MODULE")
(apply (assoc-ref gnu:%standard-phases 'unpack) args)
(copy-recursively
#+(this-package-native-input "vendored-go-dependencies")
"vendor")))
(replace 'install-license-files
(assoc-ref gnu:%standard-phases 'install-license-files))
(add-after 'install 'install-extras
(lambda _
(let ((caddy
(or (which "caddy")
(in-vicinity #$output "bin/caddy"))))
(invoke caddy "manpage" "--directory"
(in-vicinity #$output "share/man/man8"))
(map
(match-lambda
((shell . path)
(let ((file (in-vicinity #$output path)))
(mkdir-p (dirname file))
(with-output-to-file file
(lambda ()
(invoke caddy "completion" shell))))))
'(("bash" . "etc/bash_completion.d/caddy")
("fish" . "share/fish/vendor_completions.d/caddy.fish")
("zsh" . "share/zsh/site-functions/_caddy"))))))
(delete 'check)
(add-after 'install 'check
(lambda* (#:key tests? #:allow-other-keys)
(when tests?
(let ((caddy (in-vicinity #$output "bin/caddy")))
(invoke caddy "help")
(invoke caddy "version"))))))))
(native-inputs
(list (origin
(method (go-mod-vendor #:go go-1.24))
(uri (package-source this-package))
(file-name "vendored-go-dependencies")
(sha256
(base32
"0iwxhc85xnhpqrahiaw1017vxg27hc5q22rc0f96g42mc2mbi2zl")))))
(home-page "https://caddyserver.com/")
(synopsis "Extensible HTTP web server with automatic HTTPS")
(description
"Caddy is a web server designed for simplicity and ease of use. It is
notable for its automatic HTTPS feature, which enables secure connections
without requiring complex configuration. Caddy is built with a focus on
performance and flexibility, making it suitable for a variety of applications,
from serving static websites to running dynamic web applications.")
(license license:asl2.0)))
(define-public hugo (define-public hugo
(package (package
(name "hugo") (name "hugo")
(version "0.147.3") (version "0.145.0")
(source (origin (source
(origin
(method go-vendored-fetch)
(uri (origin
(method git-fetch) (method git-fetch)
(uri (git-reference (uri (git-reference
(url "https://github.com/gohugoio/hugo") (url "https://github.com/gohugoio/hugo")
@ -115,18 +46,19 @@ from serving static websites to running dynamic web applications.")
(file-name (git-file-name name version)) (file-name (git-file-name name version))
(sha256 (sha256
(base32 (base32
"17r4lhxkrv4rd2g5ap7glxnhkvg611g0z143bfj0kx80ir7rbdq8")))) "19kfij8c1ljfn8xr3mfm5c89fhp62bl0c7rx0i8726jn6dbpl9g5"))))
(sha256
(base32
"10fmva8p4hcbs2kyjggbanrmix1mf1fym549c5zdv80khpppzfnb"))))
(build-system go-build-system) (build-system go-build-system)
(arguments (arguments
(list (list
#:go go-1.24 #:go go-1.23
#:install-source? #f #:install-source? #f
#:import-path "." #:import-path "."
#:build-flags #:build-flags
#~(list "-tags" "extended withdeploy" ''("-tags" "extended withdeploy"
(string-append "-ldflags=-X github.com/gohugoio/hugo/common/hugo.vendorInfo=Nonguix")
"-ldflags="
" -X github.com/gohugoio/hugo/common/hugo.vendorInfo=Nonguix"))
#:test-flags ''("-skip=^TestCommands/mod|^TestCommands/server") #:test-flags ''("-skip=^TestCommands/mod|^TestCommands/server")
#:test-subdirs ''(".") #:test-subdirs ''(".")
#:modules #:modules
@ -137,59 +69,42 @@ from serving static websites to running dynamic web applications.")
#~(modify-phases %standard-phases #~(modify-phases %standard-phases
(replace 'unpack (replace 'unpack
(lambda args (lambda args
(unsetenv "GO111MODULE")
(apply (assoc-ref gnu:%standard-phases 'unpack) args) (apply (assoc-ref gnu:%standard-phases 'unpack) args)
(copy-recursively (unsetenv "GO111MODULE")))
#+(this-package-native-input "vendored-go-dependencies")
"vendor")))
(replace 'install-license-files (replace 'install-license-files
(assoc-ref gnu:%standard-phases 'install-license-files)) (assoc-ref gnu:%standard-phases 'install-license-files))
(add-after 'unpack 'fix-paths (add-after 'unpack 'fix-paths
(lambda* (#:key native-inputs inputs #:allow-other-keys) (lambda* (#:key inputs #:allow-other-keys)
(setenv "C_INCLUDE_PATH" (setenv "C_INCLUDE_PATH"
(string-append (string-append
(getenv "C_INCLUDE_PATH") ":" (getenv "C_INCLUDE_PATH") ":"
(dirname (dirname
(dirname (dirname
(dirname (dirname
(search-input-file (search-input-file inputs "src/dec/alphai_dec.h"))))))
(or native-inputs inputs)
"src/dec/alphai_dec.h"))))))
(with-directory-excursion "vendor/github.com/bep/gowebp" (with-directory-excursion "vendor/github.com/bep/gowebp"
(substitute* (find-files "internal/libwebp") (substitute* (find-files "internal/libwebp")
(("../../libwebp_src/(.*)\"" _ file) (("../../libwebp_src/(.*)\"" _ file)
(format #f "~a\"" (string-append (search-input-file inputs file) "\""))))
(search-input-file
(or native-inputs inputs) file)))))
(with-directory-excursion "vendor/github.com/bep/golibsass" (with-directory-excursion "vendor/github.com/bep/golibsass"
(substitute* (find-files "internal/libsass") (substitute* (find-files "internal/libsass")
(("../../libsass_src/(.*)\"" _ file) (("../../libsass_src/(.*)\"" _ file)
(format #f "~a\"" (string-append (search-input-file inputs file) "\"")))))))))
(search-input-file (inputs
(or native-inputs inputs) file)))))))))) (list (package-source libsass)
(native-inputs
(list (origin
(method (go-mod-vendor #:go go-1.24))
(uri (package-source this-package))
(file-name "vendored-go-dependencies")
(sha256
(base32
"1pwq7i0y2gb4cw9nriy699wa6pqlhz42rjkzv39g355nyszwpyj8")))
(package-source libsass)
(package-source libwebp))) (package-source libwebp)))
(home-page "https://gohugo.io/") (home-page "https://gohugo.io/")
(synopsis "Static site generator written in Go") (synopsis "Static site generator")
(description (description
"Hugo is a static site generator written in Go, optimized for speed and "Hugo is a static site generator written in Go, optimized for speed and
designed for flexibility. With its advanced templating system and fast asset designed for flexibility.")
pipelines, Hugo renders a complete site in seconds, often less.")
(license license:asl2.0))) (license license:asl2.0)))
;; TODO: Package Forgejo without vendored dependencies.
(define-public forgejo (define-public forgejo
(package (package
(name "forgejo") (name "forgejo")
(version "10.0.3") (version "10.0.3")
;; TODO: Address npm dependencies and fetch from git.
(source (origin (source (origin
(method url-fetch) (method url-fetch)
(uri (string-append (uri (string-append
@ -197,17 +112,13 @@ pipelines, Hugo renders a complete site in seconds, often less.")
version "/forgejo-src-" version ".tar.gz")) version "/forgejo-src-" version ".tar.gz"))
(sha256 (sha256
(base32 (base32
"0cqp4x3xrvr7q1pkijqmf6jnx3wahi20xjfrv7ap81ykif83269x")) "0cqp4x3xrvr7q1pkijqmf6jnx3wahi20xjfrv7ap81ykif83269x"))))
(modules '((guix build utils)))
;; Avoid downloading toolchain.
(snippet '(substitute* "go.mod"
(("^toolchain.*") "")))))
(build-system go-build-system) (build-system go-build-system)
(arguments (arguments
(list #:tests? (not (%current-target-system)) ;TODO: Run test suite. (list #:go go-1.23
#:go go-1.23
#:install-source? #f #:install-source? #f
#:import-path "." #:tests? #f ;TODO
#:import-path "code.gitea.io/gitea"
#:build-flags #:build-flags
#~(list (string-append #~(list (string-append
"-ldflags=" "-ldflags="
@ -225,40 +136,40 @@ pipelines, Hugo renders a complete site in seconds, often less.")
#:phases #:phases
#~(modify-phases %standard-phases #~(modify-phases %standard-phases
(replace 'unpack (replace 'unpack
(lambda args (assoc-ref gnu:%standard-phases 'unpack))
(unsetenv "GO111MODULE") (add-after 'unpack 'support-module
(apply (assoc-ref gnu:%standard-phases 'unpack) args)))
(replace 'install-license-files
(assoc-ref gnu:%standard-phases 'install-license-files))
(add-after 'install 'rename-binary
(lambda _ (lambda _
(rename-file (in-vicinity #$output "bin/gitea") (unsetenv "GO111MODULE")
(in-vicinity #$output "bin/forgejo")))) (substitute* "go.mod"
(add-after 'install 'install-extras (("^toolchain.*") ""))))
(replace 'build
(lambda* (#:key build-flags (parallel-build? #t)
#:allow-other-keys)
(let* ((njobs (if parallel-build? (parallel-job-count) 1)))
(setenv "GOMAXPROCS" (number->string njobs)))
(apply invoke "go" "install"
"-v" "-x"
"-ldflags=-s -w"
"-trimpath"
build-flags)))
(replace 'install
(lambda _ (lambda _
(mkdir-p (in-vicinity #$output "/etc/forgejo")) (mkdir-p (in-vicinity #$output "/etc/forgejo"))
(copy-file "custom/conf/app.example.ini" (copy-file
(in-vicinity #$output "etc/forgejo/app.ini")) "custom/conf/app.example.ini"
(in-vicinity #$output "etc/forgejo/app.ini"))
(for-each (for-each
(lambda (dir) (lambda (dir)
(copy-recursively (copy-recursively
dir (string-append #$output "/etc/forgejo/" dir))) dir (string-append #$output "/etc/forgejo/" dir)))
'("options" "public" "templates")))) '("options" "public" "templates"))
(delete 'check) (with-directory-excursion (in-vicinity #$output "bin")
(add-after 'install 'check (rename-file "gitea" "forgejo"))))
(lambda* (#:key tests? #:allow-other-keys) (replace 'install-license-files
(when tests? (assoc-ref gnu:%standard-phases 'install-license-files)))))
(let ((gitea (in-vicinity #$output "bin/gitea")))
(invoke gitea "--help")
(invoke gitea "--version"))))))))
(native-inputs (list git-minimal))
(home-page "https://forgejo.org/")
(synopsis "Lightweight software forge") (synopsis "Lightweight software forge")
(description (description
"Forgejo is a self-hosted, lightweight software forge designed to "Forgejo is a self-hosted lightweight software forge. Easy to install and
facilitate collaborative software development. It is built to be easy to low maintenance, it just does the job.")
install and maintain, making it an ideal choice for teams and organizations (home-page "https://forgejo.org/")
looking for a reliable platform to manage their software projects.") (license license:gpl3+)))
(license license:gpl3+)
(properties
'((rosenthal-update? . #f)))))

View File

@ -67,9 +67,7 @@
(synopsis "Rust bindings for PipeWire") (synopsis "Rust bindings for PipeWire")
(description "This package provides Rust bindings for PipeWire.") (description "This package provides Rust bindings for PipeWire.")
(license license:expat) (license license:expat)
(properties (properties '((hidden? . #t))))))
'((hidden? . #t)
(rosenthal-update? . #f))))))
(define-public rust-smithay (define-public rust-smithay
(let ((commit "0cd3345c59f7cb139521f267956a1a4e33248393") (let ((commit "0cd3345c59f7cb139521f267956a1a4e33248393")
@ -120,9 +118,7 @@ will need, in a generic fashion.
It supports the @code{wayland}, @code{wayland-protocols}, and some external It supports the @code{wayland}, @code{wayland-protocols}, and some external
extensions, such as @code{wlr-protocols} and @code{plasma-wayland-protocols}.") extensions, such as @code{wlr-protocols} and @code{plasma-wayland-protocols}.")
(license license:expat) (license license:expat)
(properties (properties '((hidden? . #t))))))
'((hidden? . #t)
(rosenthal-update? . #f))))))
(define-public niri (define-public niri
(package (package

View File

@ -133,7 +133,8 @@ WebUI\\Password_PBKDF2=\"@ByteArray(ARQ77eY1NUZaQsuDHbIMCA==:0WMRkYTUWVT9wVvdDtH
#$(file-append qbittorrent "/bin/qbittorrent-nox") #$(file-append qbittorrent "/bin/qbittorrent-nox")
#$(string-append "--webui-port=" (number->string webui-port)) #$(string-append "--webui-port=" (number->string webui-port))
#$@extra-options))) #$@extra-options)))
(stop #~(make-kill-destructor #:grace-period 1800)))))) (stop #~(make-kill-destructor #:grace-period 1800))
(auto-start? #f)))))
(define home-qbittorrent-service-type (define home-qbittorrent-service-type
(service-type (service-type

View File

@ -7,7 +7,6 @@
#:use-module (guix records) #:use-module (guix records)
#:use-module (gnu packages admin) #:use-module (gnu packages admin)
#:use-module (gnu packages version-control) #:use-module (gnu packages version-control)
#:use-module (gnu packages video)
#:use-module (rosenthal packages binaries) #:use-module (rosenthal packages binaries)
#:use-module (rosenthal packages web) #:use-module (rosenthal packages web)
#:use-module (gnu services) #:use-module (gnu services)
@ -30,9 +29,6 @@
misskey-configuration misskey-configuration
misskey-service-type misskey-service-type
navidrome-configuration
navidrome-service-type
vaultwarden-configuration vaultwarden-configuration
vaultwarden-service-type)) vaultwarden-service-type))
@ -353,77 +349,6 @@
(default-value (misskey-configuration)) (default-value (misskey-configuration))
(description "Run Misskey, an interplanetary microblogging platform."))) (description "Run Misskey, an interplanetary microblogging platform.")))
;;;
;;; Navidrome
;;;
(define-configuration navidrome-configuration
(navidrome
(file-like navidrome-bin)
"")
(ffmpeg
(file-like ffmpeg)
"")
(auto-start?
(boolean #t)
"")
(extra-config
(string "")
"")
(no-serialization))
(define %navidrome-accounts
(list (user-group (name "navidrome") (system? #t))
(user-account
(name "navidrome")
(group "navidrome")
(system? #t)
(comment "Navidrome user")
(home-directory "/var/lib/navidrome"))))
(define navidrome-shepherd-service
(match-record-lambda <navidrome-configuration>
(navidrome ffmpeg auto-start? extra-config)
(let ((config-file
(mixed-text-file
"navidrome.toml"
"DataFolder = '/var/lib/navidrome'\n"
"CacheFolder = '/var/lib/navidrome/cache'\n"
"EnableInsightsCollector = false\n"
extra-config)))
(list (shepherd-service
(documentation "Run Navidrome.")
(provision '(navidrome))
(requirement '(loopback user-processes))
(start
#~(make-forkexec-constructor
(list #$(file-append navidrome "/bin/navidrome")
"--configfile" #$config-file)
#:user "navidrome"
#:group "navidrome"
#:log-file "/var/log/navidrome.log"
#:environment-variables
(list "LC_ALL=C.UTF-8"
(string-append "PATH=" #$ffmpeg "/bin"))))
(stop
#~(make-kill-destructor))
(auto-start? auto-start?)
(actions
(list (shepherd-configuration-action config-file))))))))
(define navidrome-service-type
(service-type
(name 'navidrome)
(extensions
(list (service-extension account-service-type
(const %navidrome-accounts))
(service-extension shepherd-root-service-type
navidrome-shepherd-service)))
(default-value (navidrome-configuration))
(description "Run Navidrome.")))
;; ;;
;; Vaultwarden ;; Vaultwarden

View File

@ -6,41 +6,45 @@
#:use-module (guix gexp) #:use-module (guix gexp)
#:use-module (guix packages) #:use-module (guix packages)
#:use-module (guix build-system gnu) #:use-module (guix build-system gnu)
#:export (go-mod-vendor)) #:use-module (guix build-system go)
#:export (go-vendored-fetch))
;;; ;; NOTE: This approach shouldn't be upstreamed.
;;; go mod vendor based fetcher (define* (go-vendored-fetch src hash-algo hash
;;; #:optional name
#:key (system (%current-system))
(go
(module-ref
(resolve-interface '(gnu packages golang))
;; Use latest Go in Guix.
'go-1.23))
(nss-certs
(module-ref
(resolve-interface '(gnu packages certs))
'nss-certs)))
(gexp->derivation
(or name
(string-append (origin-file-name src) "-vendored"))
(with-imported-modules %default-gnu-imported-modules
#~(begin
(use-modules (guix build gnu-build-system)
(guix build utils))
(setenv "GOCACHE" "/tmp/go")
(setenv "GOMODCACHE" "/tmp/gomod")
(setenv "SSL_CERT_DIR" #+(file-append nss-certs "/etc/ssl/certs"))
;; Support Unicode in file name.
(setlocale LC_ALL "C.UTF-8")
(define* (go-mod-vendor #:key go) ((assoc-ref %standard-phases 'unpack) #:source #+src)
(lambda* (src hash-algo hash #:optional name #:key (system (%current-system))) (invoke #+(file-append go "/bin/go") "mod" "vendor")
(define nss-certs (copy-recursively "." #$output)))
(module-ref (resolve-interface '(gnu packages certs)) 'nss-certs)) #:system system
#:hash-algo hash-algo
(gexp->derivation #:hash hash
(or name "vendored-go-dependencies") ;; Is a directory.
(with-imported-modules %default-gnu-imported-modules #:recursive? #t
#~(begin ;; Honor the user's proxy and locale settings.
(use-modules (guix build gnu-build-system) #:leaked-env-vars '("http_proxy" "https_proxy"
(guix build utils)) "LC_ALL" "LC_MESSAGES" "LANG"
;; Support Unicode in file name. "COLUMNS")
(setlocale LC_ALL "C.UTF-8") #:local-build? #t))
;; For HTTPS support.
(setenv "SSL_CERT_DIR" #+(file-append nss-certs "/etc/ssl/certs"))
((assoc-ref %standard-phases 'unpack) #:source #+src)
(invoke #+(file-append go "/bin/go") "mod" "vendor")
(copy-recursively "vendor" #$output)))
#:system system
#:hash-algo hash-algo
#:hash hash
;; Is a directory.
#:recursive? #t
#: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)))