This commit is contained in:
Jean-François GUILLAUME 2021-11-02 09:07:30 +01:00
parent 5c1dfeb662
commit 9ade8e1e6d
GPG key ID: 38751DAE145EFB5A

View file

@ -1,5 +1,10 @@
(define-module (glicid services openldap) (define-module (glicid services openldap)
#:use-module (glicid packages openldap) #:use-module (glicid packages openldap)
#:use-module (gnu services)
#:use-module (gnu services shepherd)
#:use-module (guix)
#:use-module (guix records)
#:use-module (ice-9 match)
#: export ( #: export (
openldap-configuration openldap-configuration
openldap-configuration? openldap-configuration?
@ -7,7 +12,7 @@
) )
) )
(define-record-type* <openldap-configuration> (define-record-type* <openldap-configuration>
openldap-configuration make-openldap-configuration openldap-configuration make-openldap-configuration
openldap-configuration? openldap-configuration?
(openldap openldap-configuration-openldap ;<package> (openldap openldap-configuration-openldap ;<package>
@ -31,13 +36,13 @@
(schema-dir openldap-configuration-schema-dir ; string (schema-dir openldap-configuration-schema-dir ; string
(default '()) (default '())
) )
) )
(define %default-slapd.conf (define %default-slapd.conf
(plain-file "slapd.conf" " (plain-file "slapd.conf" "
# Empty file for test # Empty file for test
")) "))
(define schema_dir (local-file "ldap_schema" #:recursive? #t)) (define schema_dir (local-file "ldap_schema" #:recursive? #t))
(define openldap-shepherd-service (define openldap-shepherd-service
(match-lambda (match-lambda
(($ <openldap-configuration> openldap arguments logflags log-file pid-file config-file schema-dir) (($ <openldap-configuration> openldap arguments logflags log-file pid-file config-file schema-dir)
(list (list
@ -60,8 +65,8 @@
) )
) )
) )
) )
(define openldap-service-type (define openldap-service-type
(service-type (name 'slapd) (service-type (name 'slapd)
(extensions (extensions
(list ( (list (
@ -72,4 +77,4 @@
) )
(description "Run @uref{https://www.openldap.org, Openldap} community developped LDAP software.") (description "Run @uref{https://www.openldap.org, Openldap} community developped LDAP software.")
) )
) )