services: guix-data-service: Use a script for database setup.

To avoid loading data service code in to the shepherd.

* gnu/services/guix.scm (guix-data-service-shepherd-services): Use a script
for database setup.

Change-Id: Ic67b33a98d63be69c8ee36d6e279d2c5690c179e
This commit is contained in:
Christopher Baines 2025-03-12 09:27:47 +00:00
parent 49e1504de2
commit 6a499bbb8e
No known key found for this signature in database
GPG key ID: 5E28A33B0B84F577

View file

@ -615,12 +615,17 @@ ca-certificates.crt file in the system profile."
(requirement '(user-processes postgres)) (requirement '(user-processes postgres))
(one-shot? #t) (one-shot? #t)
(start (start
(with-extensions (cons package #~(make-forkexec-constructor
;; This is a poorly constructed Guile load path, (list
;; since it contains things that aren't Guile #$(program-file
;; libraries, but it means that the Guile "data-service-setup-database"
;; libraries needed for the Guix Data Service (with-extensions
;; don't need to be individually specified here. (cons package
;; This is a poorly constructed Guile load path, since
;; it contains things that aren't Guile libraries, but
;; it means that the Guile libraries needed for the
;; Guix Data Service don't need to be individually
;; specified here.
(append (append
(map second (package-inputs package)) (map second (package-inputs package))
(map second (package-propagated-inputs package)))) (map second (package-propagated-inputs package))))
@ -641,7 +646,16 @@ ca-certificates.crt file in the system profile."
#~(((@ (guix-data-service model build-server) #~(((@ (guix-data-service model build-server)
specify-build-servers) specify-build-servers)
'(#$@build-servers))) '(#$@build-servers)))
'()))))) '()))))))
#:user #$user
#:group #$group
#:directory "/var/lib/guix-data-service"
#:environment-variables
`(,(string-append
"GUIX_LOCPATH="
#$(libc-utf8-locales-for-target) "/lib/locale")
"LC_ALL=en_US.utf8")
#:log-file "/var/log/guix-data-service/setup-database.log"))
(auto-start? #t)) (auto-start? #t))
(shepherd-service (shepherd-service