mirror of
https://codeberg.org/hako/Rosenthal.git
synced 2025-11-16 09:24:58 +00:00
Compare commits
No commits in common. "dcc1fad6684a428fa3e671f4b413f821a9b693f0" and "cc202637fdd7ce2eff1f9114bbba27f41b6015ac" have entirely different histories.
dcc1fad668
...
cc202637fd
@ -4,7 +4,6 @@
|
||||
|
||||
(define-module (rosenthal services cuirass)
|
||||
#:use-module (srfi srfi-1)
|
||||
#:use-module (srfi srfi-26)
|
||||
#:use-module (guix gexp)
|
||||
#:use-module (guix modules)
|
||||
#:use-module (guix records)
|
||||
@ -20,63 +19,20 @@
|
||||
#:use-module (gnu services admin)
|
||||
#:use-module (gnu services base)
|
||||
#:use-module (gnu services cuirass)
|
||||
#:use-module (gnu services databases)
|
||||
#:use-module (gnu services shepherd)
|
||||
#:use-module (gnu packages linux)
|
||||
#:export (cuirass-worker-container-service-type
|
||||
cuirass-worker-container-configuration
|
||||
#:export (cuirass-worker-container-configuration
|
||||
cuirass-worker-container-configuration?
|
||||
this-cuirass-worker-container-configuration
|
||||
cuirass-worker-container-host-name
|
||||
cuirass-worker-container-server
|
||||
cuirass-worker-container-supported-systems
|
||||
cuirass-worker-container-substitute-urls
|
||||
cuirass-worker-container-script
|
||||
cuirass-worker-container-activation
|
||||
cuirass-worker-container-shepherd
|
||||
cuirass-worker-container-service-type))
|
||||
|
||||
cuirass-service-type/hako))
|
||||
|
||||
;;;
|
||||
;;; Cuirass service with ‘avahi-daemon’ shepherd requirement stripped.
|
||||
;;;
|
||||
|
||||
(define cuirass-service-type/hako
|
||||
(let ((cuirass-configuration-cuirass
|
||||
(@@ (gnu services cuirass) cuirass-configuration-cuirass))
|
||||
(cuirass-activation
|
||||
(@@ (gnu services cuirass) cuirass-activation))
|
||||
(cuirass-shepherd-service
|
||||
(@@ (gnu services cuirass) cuirass-shepherd-service))
|
||||
(cuirass-account
|
||||
(@@ (gnu services cuirass) cuirass-account))
|
||||
(cuirass-postgresql-role
|
||||
(@@ (gnu services cuirass) cuirass-postgresql-role))
|
||||
(strip-shepherd-requirement
|
||||
(lambda (services)
|
||||
(map (lambda (service)
|
||||
(if (member 'cuirass-remote-server
|
||||
(shepherd-service-provision service))
|
||||
(shepherd-service
|
||||
(inherit service)
|
||||
(requirement
|
||||
(remove (cut eqv? <> 'avahi-daemon)
|
||||
(shepherd-service-requirement service))))
|
||||
service))
|
||||
services))))
|
||||
(service-type
|
||||
(name 'cuirass)
|
||||
(extensions
|
||||
(list
|
||||
(service-extension profile-service-type ;for 'info cuirass'
|
||||
(compose list cuirass-configuration-cuirass))
|
||||
(service-extension activation-service-type cuirass-activation)
|
||||
(service-extension shepherd-root-service-type
|
||||
(compose strip-shepherd-requirement
|
||||
cuirass-shepherd-service))
|
||||
(service-extension account-service-type cuirass-account)
|
||||
;; Make sure postgresql and postgresql-role are instantiated.
|
||||
(service-extension postgresql-service-type (const #t))
|
||||
(service-extension postgresql-role-service-type
|
||||
cuirass-postgresql-role)))
|
||||
(description "Run the Cuirass continuous integration service."))))
|
||||
|
||||
|
||||
;;;
|
||||
;;; Run Cuirass remote worker in container.
|
||||
;;;
|
||||
@ -114,33 +70,34 @@
|
||||
(match-record-lambda <cuirass-worker-container-configuration>
|
||||
(host-name server workers supported-systems substitute-urls)
|
||||
|
||||
(define cuirass-remote-worker-shepherd-service
|
||||
(@@ (gnu services cuirass) cuirass-remote-worker-shepherd-service))
|
||||
(define %cuirass-remote-worker-accounts
|
||||
(@@ (gnu services cuirass) %cuirass-remote-worker-accounts))
|
||||
|
||||
(define (strip-shepherd-requirement services)
|
||||
(map (lambda (service)
|
||||
(if (member 'cuirass-remote-worker
|
||||
(shepherd-service-provision service))
|
||||
(shepherd-service
|
||||
(inherit service)
|
||||
(requirement
|
||||
(remove (cut member <> '(avahi-daemon guix-daemon))
|
||||
(shepherd-service-requirement service))))
|
||||
service))
|
||||
services))
|
||||
|
||||
(define cuirass-remote-worker-for-container
|
||||
(service-type
|
||||
(name 'cuirass-remote-worker)
|
||||
(extensions
|
||||
(list (service-extension shepherd-root-service-type
|
||||
(compose strip-shepherd-requirement
|
||||
cuirass-remote-worker-shepherd-service))
|
||||
(compose
|
||||
(lambda (services)
|
||||
(map
|
||||
(lambda (s)
|
||||
(if (member 'cuirass-remote-worker
|
||||
(shepherd-service-provision s))
|
||||
(shepherd-service
|
||||
(inherit s)
|
||||
(requirement
|
||||
(lset-difference
|
||||
eqv?
|
||||
(shepherd-service-requirement s)
|
||||
'(avahi-daemon guix-daemon))))
|
||||
s))
|
||||
services))
|
||||
(@@ (gnu services cuirass)
|
||||
cuirass-remote-worker-shepherd-service)))
|
||||
(service-extension account-service-type
|
||||
(const %cuirass-remote-worker-accounts))))
|
||||
(description "Run the Cuirass remote build worker service.")))
|
||||
(const
|
||||
(@@ (gnu services cuirass)
|
||||
%cuirass-remote-worker-accounts)))))
|
||||
(description
|
||||
"Run the Cuirass remote build worker service.")))
|
||||
|
||||
(define os
|
||||
(operating-system
|
||||
@ -166,7 +123,6 @@
|
||||
(publish-port 5558)
|
||||
(substitute-urls substitute-urls)))
|
||||
%base-services))))
|
||||
|
||||
(with-store store
|
||||
(run-with-store store
|
||||
(container-script os #:shared-network? #t)))))
|
||||
|
||||
@ -1,61 +0,0 @@
|
||||
;;; SPDX-License-Identifier: GPL-3.0-or-later
|
||||
;;; Copyright © 2025 Hilton Chain <hako@ultrarare.space>
|
||||
|
||||
(define-module (rosenthal utils transformations)
|
||||
#:use-module (guix channels)
|
||||
#:use-module (guix gexp)
|
||||
#:use-module (gnu system)
|
||||
#:use-module (gnu services)
|
||||
#:use-module (gnu services base)
|
||||
#:use-module (gnu packages package-management)
|
||||
#:export (rosenthal-transformation-guix))
|
||||
|
||||
|
||||
(define* (rosenthal-transformation-guix #:key (substitutes? #t)
|
||||
(channel? #t)
|
||||
(guix-source? #f))
|
||||
(define %rosenthal-signing-key
|
||||
(plain-file "rosenthal.pub" "
|
||||
(public-key
|
||||
(ecc
|
||||
(curve Ed25519)
|
||||
(q #374EC58F5F2EC0412431723AF2D527AD626B049D657B5633AAAEBC694F3E33F9#)))"))
|
||||
|
||||
(define %rosenthal-channel
|
||||
(channel
|
||||
(name 'rosenthal)
|
||||
(url "https://codeberg.org/hako/rosenthal.git")
|
||||
(branch "trunk")
|
||||
(introduction
|
||||
(make-channel-introduction
|
||||
"7677db76330121a901604dfbad19077893865f35"
|
||||
(openpgp-fingerprint
|
||||
"13E7 6CD6 E649 C28C 3385 4DF5 5E5A A665 6149 17F7")))))
|
||||
|
||||
(lambda (os)
|
||||
(operating-system
|
||||
(inherit os)
|
||||
(services
|
||||
(modify-services (operating-system-user-services os)
|
||||
(guix-service-type
|
||||
config => (guix-configuration
|
||||
(inherit config)
|
||||
(channels
|
||||
(let ((configured-channels
|
||||
(guix-configuration-channels config)))
|
||||
(if channel?
|
||||
(cons %rosenthal-channel
|
||||
(or configured-channels %default-channels))
|
||||
configured-channels)))
|
||||
(guix
|
||||
(if guix-source?
|
||||
(guix-for-channels channels)
|
||||
(guix-configuration-guix config)))
|
||||
(authorized-keys
|
||||
(cons %rosenthal-signing-key
|
||||
(guix-configuration-authorized-keys config)))
|
||||
(substitute-urls
|
||||
`(,@(guix-configuration-substitute-urls config)
|
||||
,@(if substitutes?
|
||||
'("https://ci.boiledscript.com")
|
||||
'()))))))))))
|
||||
Loading…
Reference in New Issue
Block a user