rosenthal: forgejo: Update to 16.0.6.

* modules/rosenthal/packages/web.scm
  (forgejo): Update to 16.0.6.
  Use package definition from the Guix PR.
* modules/rosenthal/services/web.scm
  (forgejo-activation): Simplify.
  (forgejo-shepherd-service): Add a forgejo-init shepherd service.
This commit is contained in:
Hilton Chain committed 2026-10-20 14:22:20 +08:00
1 parent 276eca71dd
commit a7073acb39
3 files changed
+148 -85

No files matched your search

+21 -21
View File
@@ -1,13 +1,13 @@
*** Packages
| PACKAGE | SYNOPSIS | LOCATION |
|-+-+-|
|[[https://github.com/ai-robots-txt/ai.robots.txt][=ai-robots-txt=]]@2.0|List of AI agents and robots to block|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/web.scm#L29][web.scm]]|
|[[https://github.com/ai-robots-txt/ai.robots.txt][=ai-robots-txt=]]@2.0|List of AI agents and robots to block|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/web.scm#L37][web.scm]]|
|[[https://grafana.com/oss/alloy-opentelemetry-collector/][=alloy-bin=]]@1.20.1|OpenTelemetry Collector distribution with programmable pipelines|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/binaries.scm#L609][binaries.scm]]|
|[[https://github.com/anthonyhab/bb-auth][=bb-auth=]]@0.2.0|Unified polkit, keyring, and pinentry authentication daemon|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/authentication.scm#L22][authentication.scm]]|
|[[https://bitwarden.com/][=bitwarden-icecat=]]@2026.3.0|Bitwarden client browser extension|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/browser-extensions.scm#L48][browser-extensions.scm]]|
|[[https://www.busybox.net][=busybox-static=]]@1.37.0|Many common UNIX utilities in a single executable|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/busybox.scm#L14][busybox.scm]]|
|[[https://caddyserver.com/][=caddy=]]@2.11.7|Extensible HTTP web server with automatic HTTPS|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/web.scm#L62][web.scm]]|
|[[https://git.guix.moe/hako/caddy][=caddy-dolly=]]@2026.06.01|Extensible HTTP web server with automatic HTTPS|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/web.scm#L131][web.scm]]|
|[[https://caddyserver.com/][=caddy=]]@2.11.7|Extensible HTTP web server with automatic HTTPS|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/web.scm#L70][web.scm]]|
|[[https://git.guix.moe/hako/caddy][=caddy-dolly=]]@2026.06.01|Extensible HTTP web server with automatic HTTPS|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/web.scm#L139][web.scm]]|
|[[https://1.1.1.1/][=cloudflare-warp-bin=]]@2026.8.2100.0|Cloudflare WARP client|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/binaries.scm#L42][binaries.scm]]|
|[[https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/][=cloudflared=]]@2026.10.0|Cloudflare Tunnel client|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/networking.scm#L25][networking.scm]]|
|[[https://davmac.org/projects/dinit/][=dinit=]]@0.22.1|Service manager with dependency management|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/admin.scm#L25][admin.scm]]|
@@ -26,7 +26,7 @@
|[[https://codeberg.org/divyaranjan/emacs-reader][=emacs-reader=]]@0.3.2-3.b8c8863|Emacs document reader|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/emacs-xyz.scm#L255][emacs-xyz.scm]]|
|[[https://github.com/ArthurHeymans/emacs-tramp-rpc][=emacs-tramp-rpc=]]@0.15.0|TRAMP backend using RPC|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/emacs-xyz.scm#L288][emacs-xyz.scm]]|
|[[https://wakatime.com/emacs][=emacs-wakatime-mode=]]@1.0.2-60.1c5b225|Automatic time tracking extension for Emacs using WakaTime|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/emacs-xyz.scm#L322][emacs-xyz.scm]]|
|[[https://forgejo.org/][=forgejo=]]@14.0.4|Lightweight software forge|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/web.scm#L152][web.scm]]|
|[[https://forgejo.org/][=forgejo=]]@16.0.6|Self-hosted, lightweight software forge|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/web.scm#L161][web.scm]]|
|[[https://grafana.com/][=grafana-bin=]]@12.4.2|Platform for monitoring and observability|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/binaries.scm#L416][binaries.scm]]|
|[[https://github.com/hylophile/guile-toml][=guile-toml=]]@1.0|TOML module for Guile Scheme|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/guile-xyz.scm#L19][guile-xyz.scm]]|
|[[https://github.com/hifi/heisenbridge][=heisenbridge=]]@1.15.4|Bouncer-style Matrix IRC bridge|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/messaging.scm#L33][messaging.scm]]|
@@ -42,7 +42,7 @@
|[[https://wiki.metacubex.one/][=mihomo=]]@1.19.32|Rule-based proxy|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/networking.scm#L70][networking.scm]]|
|[[https://grafana.com/oss/mimir/][=mimir-bin=]]@3.0.4|Scalable long-term storage for Prometheus|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/binaries.scm#L505][binaries.scm]]|
|[[https://github.com/Sevichecc/miniflux-injector][=miniflux-injector-icecat=]]@2.3.3|Injects Miniflux search results into search page|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/browser-extensions.scm#L97][browser-extensions.scm]]|
|[[https://codeberg.org/hako/mirror-substitutes][=mirror-substitutes=]]@0.0.2|Mirror Guix substitutes|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/package-management.scm#L39][package-management.scm]]|
|[[https://codeberg.org/hako/mirror-substitutes][=mirror-substitutes=]]@0.0.3|Mirror Guix substitutes|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/package-management.scm#L39][package-management.scm]]|
|[[https://www.navidrome.org/][=navidrome-bin=]]@0.64.2|Web-based music collection server and streamer|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/binaries.scm#L238][binaries.scm]]|
|[[https://noctalia.dev/][=noctalia-greeter=]]@1.6.0|Login greeter for greetd|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/wm.scm#L40][wm.scm]]|
|[[https://github.com/27justin/ohmyech][=ohmyech-icecat=]]@1.2|Visual indicator for Encrpted Client Hello|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/browser-extensions.scm#L147][browser-extensions.scm]]|
@@ -79,19 +79,19 @@
|=cuirass-worker-container=| |[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/cuirass.scm#L208][cuirass.scm]]|
|=docker-mailserver=|Run Docker Mailserver.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/mail.scm#L77][mail.scm]]|
|=dumb-runtime-dir=|Create `XDG_RUNTIME_DIR' on login and never remove it.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/file-systems.scm#L94][file-systems.scm]]|
|=forgejo=|Run Forgejo.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/web.scm#L275][web.scm]]|
|=forgejo=|Run Forgejo.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/web.scm#L302][web.scm]]|
|=gamemode=|Set up Guix System environment for gamemode.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/games.scm#L51][games.scm]]|
|=grafana=| |[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/monitoring.scm#L180][monitoring.scm]]|
|=heisenbridge=| |[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/messaging.scm#L95][messaging.scm]]|
|=iocaine=| |[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/web.scm#L381][web.scm]]|
|=jellyfin=|Run the Jellyfin media system.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/web.scm#L517][web.scm]]|
|=jellyfin-oci=|Run Jellyfin, a media system.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/web.scm#L607][web.scm]]|
|=komga=|Run Komga.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/web.scm#L679][web.scm]]|
|=iocaine=| |[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/web.scm#L408][web.scm]]|
|=jellyfin=|Run the Jellyfin media system.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/web.scm#L544][web.scm]]|
|=jellyfin-oci=|Run Jellyfin, a media system.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/web.scm#L634][web.scm]]|
|=komga=|Run Komga.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/web.scm#L706][web.scm]]|
|=loki=| |[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/monitoring.scm#L269][monitoring.scm]]|
|=mautrix-telegram=| |[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/messaging.scm#L181][messaging.scm]]|
|=mimir=| |[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/monitoring.scm#L356][monitoring.scm]]|
|=misskey=|Run Misskey, an interplanetary microblogging platform.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/web.scm#L771][web.scm]]|
|=navidrome=|Run Navidrome.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/web.scm#L861][web.scm]]|
|=misskey=|Run Misskey, an interplanetary microblogging platform.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/web.scm#L798][web.scm]]|
|=navidrome=|Run Navidrome.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/web.scm#L888][web.scm]]|
|=network-online=|Wait for the network to come up.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/networking.scm#L72][networking.scm]]|
|=nix-search-paths=|Set up search paths for `with-nix-profile'.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/nix.scm#L59][nix.scm]]|
|=noctalia-greeter=|Set up environment for `noctalia-greeter-session'.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/base.scm#L76][base.scm]]|
@@ -101,11 +101,11 @@
|=sing-box=| |[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/networking.scm#L176][networking.scm]]|
|=smartdns=|Run Smartdns daemon.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/dns.scm#L44][dns.scm]]|
|=tailscaled=|Run tailscaled.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/networking.scm#L249][networking.scm]]|
|=tuwunel=|Run Tuwunel.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/web.scm#L948][web.scm]]|
|=vaultwarden=|Run Vaultwarden, a Bitwarden compatible server.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/web.scm#L1087][web.scm]]|
|=tuwunel=|Run Tuwunel.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/web.scm#L975][web.scm]]|
|=vaultwarden=|Run Vaultwarden, a Bitwarden compatible server.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/web.scm#L1114][web.scm]]|
|=zfs=| |[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/file-systems.scm#L187][file-systems.scm]]|
|=home-atuin=| |[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/shellutils.scm#L63][shellutils.scm]]|
|=home-bb-auth=|Run `bb-auth' daemon.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/desktop.scm#L409][desktop.scm]]|
|=home-bb-auth=|Run `bb-auth' daemon.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/desktop.scm#L423][desktop.scm]]|
|=home-blueman-applet=|Run blueman applet, a tray applet for managing bluetooth.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/desktop.scm#L122][desktop.scm]]|
|=home-direnv=| |[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/shellutils.scm#L100][shellutils.scm]]|
|=home-emacs=|Install Emacs into home profile and run its daemon.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/home/services/emacs.scm#L142][emacs.scm]]|
@@ -119,17 +119,17 @@
|=home-mako=|Run mako, a notification daemon.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/desktop.scm#L302][desktop.scm]]|
|=home-network-manager-applet=|Run nm-applet, a tray applet for managing networks.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/desktop.scm#L341][desktop.scm]]|
|=home-network-online=|Wait for the network to come up.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/networking.scm#L81][networking.scm]]|
|=home-niri=|Set up configuration file for niri, a scrollable-tiling Wayland compositor.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/desktop.scm#L369][desktop.scm]]|
|=home-niri=|Set up configuration file for niri, a scrollable-tiling Wayland compositor.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/desktop.scm#L381][desktop.scm]]|
|=home-nix-search-paths=|Set up search paths for `with-nix-profile'.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/nix.scm#L74][nix.scm]]|
|=home-noctalia=|Run Noctalia, a lightweight Wayland shell and bar.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/home/services/desktop.scm#L219][desktop.scm]]|
|=home-polkit-gnome=| |[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/desktop.scm#L436][desktop.scm]]|
|=home-polkit-gnome=| |[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/desktop.scm#L450][desktop.scm]]|
|=home-qbittorrent=|Run qBittorrent daemon.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/bittorrent.scm#L158][bittorrent.scm]]|
|=home-rofi=|Set up configuration file for rofi, an application launcher.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/desktop.scm#L462][desktop.scm]]|
|=home-rofi=|Set up configuration file for rofi, an application launcher.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/desktop.scm#L476][desktop.scm]]|
|=home-shadow-tls=|Run shadow-tls.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/child-error.scm#L460][child-error.scm]]|
|=home-socks2http=|Run socks2http.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/child-error.scm#L495][child-error.scm]]|
|=home-swaybg=|Run swaybg, a screen wallpaper utility for Wayland compositors.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/desktop.scm#L502][desktop.scm]]|
|=home-theme=|Set up desktop themes.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/desktop.scm#L601][desktop.scm]]|
|=home-swaybg=|Run swaybg, a screen wallpaper utility for Wayland compositors.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/desktop.scm#L516][desktop.scm]]|
|=home-theme=|Set up desktop themes.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/desktop.scm#L615][desktop.scm]]|
|=home-wakapi=|Run Wakapi, a self-hosted WakaTime-compatible backend.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/child-error.scm#L298][child-error.scm]]|
|=home-waybar=|Run waybar, a status bar for Wayland compositors.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/desktop.scm#L666][desktop.scm]]|
|=home-waybar=|Run waybar, a status bar for Wayland compositors.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/desktop.scm#L680][desktop.scm]]|
|=home-writable-files-manager=|Provide an `update-writable-files' script, which copies files to configuration files, makes them writable and creates symlinks to directories on every activation. If an existing file would be overwritten, backs up that file first.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/home/services/writable-files-manager.scm#L264][writable-files-manager.scm]]|
|=home-zoxide=| |[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/shellutils.scm#L137][shellutils.scm]]|
+91 -55
View File
@@ -1,5 +1,6 @@
;;; SPDX-License-Identifier: GPL-3.0-or-later
;;; Copyright © 2022, 2025 Hilton Chain <hako@ultrarare.space>
;;; Copyright © 2026 Maxim Cournoyer <maxim@guixotic.coop>
(define-module (rosenthal packages web)
;; Utilities
@@ -16,12 +17,19 @@
;; Guix build systems
#:use-module (guix build-system cargo)
#:use-module (guix build-system copy)
#:use-module (guix build-system gnu)
#:use-module (guix build-system go)
#:use-module (rosenthal build-system go-vendored)
;; Guix packages
#:use-module (gnu packages base)
#:use-module (gnu packages bash)
#:use-module (gnu packages compression)
#:use-module (gnu packages golang)
#:use-module (gnu packages image)
#:use-module (gnu packages jemalloc)
#:use-module (gnu packages node)
#:use-module (gnu packages sqlite)
#:use-module (gnu packages ssh)
#:use-module (gnu packages version-control)
#:use-module (gnu packages web))
@@ -148,64 +156,92 @@ from serving static websites to running dynamic web applications.")
(home-page "https://git.guix.moe/hako/caddy")
(properties '((disable-updater? . #t)))))
;; https://codeberg.org/guix/guix/pulls/9006
(define-public forgejo
(package
(name "forgejo")
(version "14.0.4")
;; TODO: Address npm dependencies and fetch from git.
(source (origin
(method url-fetch)
(uri (string-append
"https://codeberg.org/forgejo/forgejo/releases/download/v"
version "/forgejo-src-" version ".tar.gz"))
(sha256
(base32
"0mjmns7yqhhkqc3jcg8bffs64zj4b52hy2v1lvr14pq162r6wcil"))))
(build-system go-vendored-build-system)
(version "16.0.6")
(source
(origin
(method url-fetch)
;; XXX: We build from the release tarball for now, which includes all
;; of the needed Go dependencies.
;; TODO: "Unbundle" the index.js and index.css by building them with
;; webpack. This cannot currently be done because of missing Node
;; modules.
(uri (string-append "https://codeberg.org/forgejo/forgejo/"
"releases/download/v" version
"/forgejo-src-" version ".tar.gz"))
(sha256
(base32
"0c56zxadj8rpn9xj7i3l97z2xh0w318vwrbxmb1nw071qh5krs8g"))))
(build-system gnu-build-system)
(outputs (list "out" "data"))
(arguments
(list #:tests? (not (%current-target-system)) ;TODO: Run test suite.
#:go go-1.26
#:install-source? #f
#:build-flags
#~(list (string-append
"-ldflags="
" -X main.ReleaseVersion=" #$(package-version this-package)
" -X main.Version=" #$(package-version this-package)
" -X main.ForgejoVersion=" #$(package-version this-package)
" -X forgejo.org/modules/setting.AppWorkPath=/var/lib/forgejo"
" -X forgejo.org/modules/setting.CustomPath=" #$output "/etc/forgejo"
" -X forgejo.org/modules/setting.CustomConf=/etc/forgejo/app.ini"))
#:phases
#~(modify-phases %standard-phases
(add-after 'install 'rename-binary
(lambda _
(rename-file (in-vicinity #$output "bin/forgejo.org")
(in-vicinity #$output "bin/forgejo"))))
(add-after 'install 'install-extras
(lambda _
(mkdir-p (in-vicinity #$output "/etc/forgejo"))
(copy-file "custom/conf/app.example.ini"
(in-vicinity #$output "etc/forgejo/app.ini"))
(for-each
(lambda (dir)
(copy-recursively
dir (string-append #$output "/etc/forgejo/" dir)))
'("options" "public" "templates"))))
(delete 'check)
(add-after 'rename-binary 'check
(lambda* (#:key tests? #:allow-other-keys)
(when tests?
(let ((forgejo (in-vicinity #$output "bin/forgejo")))
(invoke forgejo "--help")
(invoke forgejo "--version"))))))))
(native-inputs (list git-minimal))
(list
#:test-target "test-backend" ;test-frontend requires npm modules
#:make-flags #~(list "TAGS=sqlite sqlite_unlock_notify") ;sqlite support
#:phases
#~(modify-phases %standard-phases
(add-after 'unpack 'patch-paths
(lambda* (#:key inputs #:allow-other-keys)
(substitute* "modules/git/hook_generate.go"
(("/usr/bin/env")
(search-input-file inputs "bin/env")))))
(add-after 'unpack 'set-static-root-path
(lambda _
(substitute* "modules/setting/server.go"
(("StaticRootPath = AppWorkPath")
(format #f "StaticRootPath = ~s" #$output:data)))))
(add-after 'unpack 'disable-problematic-tests
(lambda _
(for-each
delete-file
;; Theses tests require internet.
'("modules/hcaptcha/hcaptcha_test.go"
"modules/updatechecker/update_checker_test.go"
"services/migrations/migrate_test.go"
"services/migrations/allowlist/is_migrate_allowed_test.go"
;; The 'TestGetDirectorySize' test expects 8037
;; entries, finds 7597 for unknown reasons.
"modules/repository/create_test.go"))))
(replace 'configure
(lambda _
(setenv "CC" "gcc")
(setenv "CGO_ENABLED" "1")
(setenv "GOTOOLCHAIN" "local") ;use 'go' from Guix
(setenv "HOME" (getcwd))
(invoke "git" "init"))) ;for tests
(add-after 'install 'post-install
(lambda* (#:key inputs #:allow-other-keys)
(rename-file "go/bin/forgejo.org" "go/bin/forgejo")
(let ((forgejo (string-append #$output "/bin/forgejo")))
(install-file "go/bin/forgejo" (dirname forgejo))
(wrap-program forgejo
`("PATH" prefix
,(map (lambda (c)
(dirname
(search-input-file inputs
(string-append "bin/" c))))
'("git" "gzip" "sh" "ssh"))))
(substitute* forgejo ;avoid stripping argv[0] in wrapper
(("exec -a \"\\$\\{0##\\*/\\}\" ")
"exec ")))
;; Install data files.
(copy-recursively "options"
(string-append #$output:data "/options"))
(copy-recursively "public"
(string-append #$output:data "/public"))
(copy-recursively "templates"
(string-append #$output:data "/templates")))))))
(native-inputs (list git go-1.26 openssh node sqlite))
(inputs (list bash coreutils git gzip openssh))
(home-page "https://forgejo.org/")
(synopsis "Lightweight software forge")
(synopsis "Self-hosted, lightweight software forge")
(description
"Forgejo is a self-hosted, lightweight software forge designed to
facilitate collaborative software development. It is built to be easy to
install and maintain, making it an ideal choice for teams and organizations
looking for a reliable platform to manage their software projects.")
(license license:gpl3+)
(properties
'((disable-updater? . #t)))))
"Forgejo is a lightweight software forge that aims to be easy to self-host
and maintain. It offers a rich web API for accessing its data. ALong the usual
forge features such as issues and pull requests tracking, it also includes
simple software project management features like roles, scopes, and time
tracking to ease collaboration.")
(license license:expat)))
+36 -9
View File
@@ -231,14 +231,9 @@
(define forgejo-activation
#~(begin
(use-modules (guix build utils))
(let ((user (getpwnam "forgejo")))
(for-each
(lambda (dir)
(mkdir-p dir)
(chown dir (passwd:uid user) (passwd:gid user))
(chmod dir #o750))
'("/var/lib/forgejo" "/var/log/forgejo")))))
(use-modules (srfi srfi-26))
(for-each (cute mkdir-p/perms <> (getpwnam "forgejo") #o750)
'("/var/lib/forgejo" "/var/log/forgejo"))))
(define forgejo-shepherd-service
(match-record-lambda <forgejo-configuration>
@@ -248,9 +243,41 @@
(ini-file "forgejo.ini" config)
config)))
(list (shepherd-service
(documentation "")
(provision '(forgejo-init))
(requirement '(user-processes))
(one-shot? #t)
(start
#~(lambda _
(define (forgejo-exec . options)
(let* ((command
(cons* "/run/current-system/profile/bin/forgejo"
"--config" #$config-file
options))
(pid
(fork+exec-command
command
#:user "forgejo"
#:group "forgejo"
#:log-file "/var/log/forgejo-init.log"
#:environment-variables
'("GIT_EXEC_PATH=/run/current-system/profile/libexec/git-core"
"GIT_SSL_CAINFO=/run/current-system/profile/etc/ssl/certs/ca-certificates.crt"
"HOME=/var/lib/forgejo"
"PATH=/run/current-system/profile/bin"
"SSL_CERT_DIR=/run/current-system/profile/etc/ssl/certs"
"SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt")
#:resource-limits '((nofile 524288 524288)))))
(unless (zero? (cdr (waitpid pid)))
(error "failed to run forgejo command" command))))
(forgejo-exec "migrate")
(forgejo-exec "admin" "regenerate" "hooks")
(forgejo-exec "admin" "regenerate" "keys")
(forgejo-exec "doctor" "check" "--all"))))
(shepherd-service
(documentation "Run Forgejo.")
(provision '(forgejo))
(requirement '(loopback postgresql))
(requirement '(forgejo-init loopback postgresql))
(start
#~(make-forkexec-constructor
(list "/run/current-system/profile/bin/forgejo"