me
/
guix
Archived
1
0
Fork 0
This repository has been archived on 2024-08-07. You can view files and clone it, but cannot push or open issues/pull-requests.
guix/gnu/services
Xinglu Chen 2ad896751c
services: configuration: Allow specifying prefix for serializer names.
Sometimes two configurations might have the same types for their field values,
but the values might be serialized in two completely different
ways (e.g. because the two programs have different configuration languages).

An example of this would be the ‘serialize-boolean’ procedure in (gnu services
mail) and (gnu services getmail).  They both serialize a boolean value, but
because the Dovecot’s configuration language has a different syntax to the
configuration language for Getmail, two different procedures have to be
defined.

One way to workaround this would be to specify custom serializers for many
fields in order to separate the serialization of the values that have the same
type but serialize in different ways.  This could get very tedious, especially
if there are many configurations in the same module.

Another way would be to move one of the configurations to its own module, like
what was done with (gnu services getmail).  However, this would mean that
there would be multiple modules containing configurations for related
programs, e.g. we have (gnu services mail) and (gnu services getmail), it
doesn’t make much sense to keep the Getmail configuration in its own module.

This patch will allow one to write something like this:

  (define-configuration foo-configuration
    (bar
      (string "bob")
      "Option bar.")
    (prefix bar-))

and the value of the ‘bar’ field would be serialized using a procedure named
‘bar-serialize-string’ instead of just ‘serialize-string’.

* gnu/services/configuration.scm (define-maybe-helper): Accept ‘prefix’
argument for using serializer with custom prefix.
(define-maybe): Pattern match on ‘prefix’ literal.
(define-configuration-helper): Accept ‘prefix’ argument for using serializer
with custom prefix.
(define-configuration): Pattern match on ‘prefix’ literal.
* tests/services/configuration.scm ("serialize-configuration with prefix"):
New test.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-06-29 12:37:33 +02:00
..
admin.scm services: rottlog: Add /var/log/mcron.log to '%default-rotations'. 2021-03-29 23:33:41 +02:00
audio.scm services: mpd: Make /var/run/mpd/USER user-owned. 2020-12-06 23:18:08 +01:00
auditd.scm services: auditd: Provide default configuration directory. 2020-07-27 12:06:36 +02:00
authentication.scm services: Prevent following symlinks during activation. 2021-03-10 18:01:47 +01:00
avahi.scm services: Remove deprecated service procedures. 2021-06-14 18:35:17 +02:00
base.scm services: guix: Authorize 'bordeaux.guix.gnu.org.pub' by default. 2021-06-19 09:32:54 +01:00
certbot.scm services: certbot: Add option to use CSR file. 2021-06-24 18:19:39 -04:00
cgit.scm
ci.scm services: laminar: Create parent directory for unix socket. 2021-06-10 09:58:20 +05:30
configuration.scm services: configuration: Allow specifying prefix for serializer names. 2021-06-29 12:37:33 +02:00
cuirass.scm services: cuirass: Do not export record type descriptors. 2021-06-01 23:26:07 +02:00
cups.scm services: cups: Remove obsolete KeepAliveTimeout directive. 2021-06-23 03:26:33 +02:00
databases.scm services: mysql: Add extra-environment as configuration option. 2021-04-27 20:45:35 +02:00
dbus.scm services: Prevent following symlinks during activation. 2021-03-10 18:01:47 +01:00
desktop.scm services: Remove deprecated service procedures. 2021-06-14 18:35:17 +02:00
dict.scm services: dicod: Reduce irony. 2020-09-21 00:31:15 +02:00
dns.scm services: dnsmasq: Extend 'activation-service'. 2021-05-31 22:06:54 +02:00
docker.scm services: docker: Disable configuration serialization. 2021-05-08 01:04:31 -04:00
file-sharing.scm services: Add transmission-daemon service. 2021-02-12 15:11:36 +08:00
games.scm
ganeti.scm gnu: ganeti-luxid-service-type: Fix typo. 2020-10-28 21:10:54 -07:00
getmail.scm services: getmail: Fix spelling of "address". 2020-01-30 15:27:31 -08:00
guix.scm services: guix-build-coordinator: Fix queue builds state directory. 2021-05-02 09:56:42 +01:00
herd.scm services: herd: Add restart-service. 2020-03-03 15:00:32 +01:00
hurd.scm services: hurd: Remove deprecated 'hurd-getty-service' wrapper. 2020-06-13 10:04:51 +02:00
kerberos.scm
linux.scm services: Add a service for rasdaemon. 2021-04-24 12:30:01 -04:00
lirc.scm
mail.scm services: dovecot: Add ‘managesieve-sieve-capability’ option. 2021-05-06 11:31:48 +02:00
mcron.scm services: Remove deprecated service procedures. 2021-06-14 18:35:17 +02:00
messaging.scm services: Remove deprecated service procedures. 2021-06-14 18:35:17 +02:00
monitoring.scm prometheus-node-exporter: Support extra options. 2020-12-07 09:08:33 +00:00
networking.scm services: Remove deprecated service procedures. 2021-06-14 18:35:17 +02:00
nfs.scm gnu: services: Fix the NFS service. 2021-02-05 17:19:10 -05:00
nix.scm services: nix: Add /bin/sh to build-sandbox-paths. 2021-04-26 20:03:55 +03:00
pam-mount.scm
pm.scm gnu: tlp: Update to 1.3.0. 2020-02-02 10:42:16 +01:00
rsync.scm
science.scm services: science.scm: Add missing copyright headers. 2020-12-09 12:55:02 +02:00
sddm.scm services: SDDM: Wait for elogind before starting. 2020-11-18 22:31:32 +01:00
security-token.scm services: pcscd: Cleanup socket when started. 2021-06-19 23:49:18 +02:00
shepherd.scm services: shepherd: Make 'assert-valid-graph' public. 2021-03-03 14:19:26 +01:00
sound.scm services: Do not use symbolic links in PulseAudio variables. 2020-05-06 22:49:55 +02:00
spice.scm services: spice-vdagent: Clear the socket file prior to starting. 2021-05-06 16:51:49 -04:00
ssh.scm services: openssh: Replace 'without-password' by 'prohibit-password'. 2021-06-20 16:44:08 +02:00
syncthing.scm services: Add syncthing service. 2021-01-12 14:40:36 +03:00
sysctl.scm services: sysctl: Export <sysctl-configuration> record field accessors. 2021-03-31 15:36:49 +02:00
telephony.scm services: murmur: Add missing newline in murmur-configuration. 2020-04-02 20:55:15 +02:00
version-control.scm services: git-daemon: Fix typo in docstring. 2021-04-10 14:11:26 +02:00
virtualization.scm services/qemu-binfmt: Use the F flag and the static output of QEMU. 2021-03-15 18:00:35 -04:00
vpn.scm Remove unused module imports from (gnu services vpn). 2021-06-25 13:27:10 +02:00
web.scm gnu: services: web: Have fcgiwrap log to a file. 2021-04-01 09:01:52 +01:00
xorg.scm services: Remove deprecated service procedures. 2021-06-14 18:35:17 +02:00