Commit Graph

1354 Commits

Author SHA1 Message Date
Maxim Cournoyer 69dcc24c9f
services: Add a service for Jami.
* gnu/services/telephony.scm (string-or-computed-file?)
(string-list?, account-fingerprint-list?): New procedures.
(maybe-string-list, maybe-account-fingerprint-list)
(maybe-boolean, maybe-string, jami-account-list): New configuration field
types.
(serialize-string-list, serialize-boolean, serialize-string)
(jami-account, jami-account->alist, jami-configuration)
(jami-account-list?, jami-account-list-maybe): New procedures.
(%jami-accounts): New variable.
(jami-configuration->command-line-arguments): New procedure.
(jami-dbus-session-activation, jami-shepherd-services): New procedures.
(jami-service-type): New variable.
* gnu/build/jami-service.scm: New file.
* gnu/tests/data/jami-dummy-account.dat: Likewise.
* gnu/tests/telephony.scm: Likewise.
* gnu/local.mk (GNU_SYSTEM_MODULES): Register them.
* Makefile.am (SCM_TESTS): Register the test file.
(dist_patch_DATA): Register the new data file.
* doc/guix.texi (Telephony Services): Document it.
2021-08-02 15:15:02 -04:00
Xinglu Chen 8e1f944218
services: configuration: Derive the default value from the package variable.
If the type of a configuration field is a package, show the name of its
package *variable* as the default value.

* gnu/services/configuration.scm (generate-documentation){show-default}
{package->symbol}: New nested procedures.  Use them to format the field
entries.

Co-authored-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
2021-08-02 14:16:23 -04:00
Xinglu Chen ad945029a2
services: configuration: Uniformize the generated documentation.
Make the formatting of the generated docs more consistent with the rest of the
docs in the “Services” section of the manual.

* gnu/services/configuration (generate-documentation): Represent the data type
documentation of a field using a DEFTP table rather than DEFTYPEVR elements.

Modified-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
2021-08-02 14:16:22 -04:00
Brice Waegeneire a85ec0bf69
services: Migrate to <setuid-program>.
* gnu/services/dbus.scm (dbus-setuid-programs, polkit-setuid-programs):
  Return setuid-programs.
* gnu/services/desktop.scm (enlightenment-setuid-programs): Return
 setuid-programs.
 (%desktop-services)[mount-setuid-helpers]: Use setuid-programs.
* gnu/services/docker.scm (singularity-setuid-programs): Return
 setuid-programs.
* gnu/services/xorg.scm(screen-locker-setuid-programs): Return
 setuid-programs.
* gnu/system.scm (%setuid-programs): Return setuid-programs.
* doc/guix.texi (Setuid Programs, operating-system Reference): Replace
  'list of G-expressions' with 'list of <setuid-program>'.
2021-07-29 11:32:48 -04:00
Guillaume Le Vaillant e463e09dc2
services: dhcpd: Fix activation with IPv6 configuration.
* gnu/services/networking.scm (dhcpd-activation): Pass the IP version
  parameter to dhcpd.
2021-07-24 15:38:03 +02:00
Ludovic Courtès 1665bb0cec
gnu: hpcguix-web: Update to 0.1.0.
* gnu/packages/web.scm (hpcguix-web): Update to 0.1.0.
[arguments]: In 'wrap-program' phase, change "/bin/run" to
"/bin/hpcguix-web".
[inputs]: Add BASH-MINIMAL.
* gnu/services/web.scm (hpcguix-web-shepherd-service): Run
"/bin/hpcguix-web".
2021-07-23 17:02:28 +02:00
Brice Waegeneire a5fa05dfc7
services: ntp: Log to file.
* gnu/services/networking.scm (ntp-shepherd-service)[start]: Specify log
file.
2021-07-13 07:25:00 +02:00
Brice Waegeneire 8bb45504dd
services: tor: Log to file.
* gnu/services/networking.scm (tor-shepherd-service)[start]: Specify log
file.
2021-07-13 07:24:56 +02:00
Brice Waegeneire 1beeef6261
services: gpm: Use "make-forkexec-contstructor".
* gnu/services/base.scm (gpm-shepherd-service)[start]: Replace custom
logic with "make-forkexec-constructor".
2021-07-13 07:24:52 +02:00
Ludovic Courtès 2ea2bca1dd
services: qemu-binfmt: Preserve argv[0] by default.
Previously, argv[0] would be replaced by the absolute file name of the
executable.  This could cause discrepancies, for example in the
Coreutils test suite: <https://issues.guix.gnu.org/49485>.

* gnu/services/virtualization.scm (<qemu-platform>)[flags]: Default to "FP".
2021-07-10 00:24:59 +02:00
Raghav Gururajan 02562e2f1e
services: Add bitmask-service-type.
* gnu/services/vpn.scm (bitmask-service-type): New variable.
* doc/guix.texi: Document it.

Co-authored-by: jgart <jgart@dismail.de>
2021-07-07 10:20:28 -04:00
Brice Waegeneire e789ce538e
services: pcscd: Fix daemon signal handling.
"pcscd" wouldn't handle SIGTERM as it inherit ignoring this signal (and
others) from its parent shepherd; fork+exec-command restore signal
handling.  Fixes <https://issues.guix.gnu.org/45202>.

* gnu/services/security-token.scm (pcscd)[start]: Use
fork+exec-command to start "pcscd".
2021-07-03 20:13:42 +02:00
luhui fda0959a14
services: kmscon: Add keyboard-layout fields.
* gnu/services/base.scm (<kmscon-configuration>): Add keyboard-layout fields.
* doc/guix.texi (Base Services): Document them.

Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
2021-06-29 19:01:25 +02:00
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
Tobias Geerinckx-Rice abb77e6d4c
Remove unused module imports from (gnu services vpn).
* gnu/services/vpn.scm: Remove (gnu packages networking) and (guix utils) imports.
2021-06-25 13:27:10 +02:00
Domagoj Stolfa 66be80fabb
gnu: Add strongswan service.
* gnu/services/vpn.scm (<strongswan-configuration>): New record type.
(charon-plugins, strongswan-configuration-file)
(strongswan-shepherd-service, strongswan-service-type): New variables.
* doc/guix.tex (VPN Services): Document them all.
2021-06-25 00:39:32 +02:00
Raghav Gururajan 1bf1226a4f
services: certbot: Add option to use CSR file.
* gnu/services/certbot.scm (<certificate-configuration>): Add csr field.
(certbot-command): Modify.
* doc/guix.texi (Certificate Services): Document it.
2021-06-24 18:19:39 -04:00
Tobias Geerinckx-Rice 828ceee7db
services: cups: Remove obsolete KeepAliveTimeout directive.
461bd4e501

* gnu/services/cups.scm (<cups-configuration>): Remove keep-alive-timeout field.
* doc/guix.texi (Printing Services): Likewise.
2021-06-23 03:26:33 +02:00
Tobias Geerinckx-Rice e254287b0c
services: cups: Fix ‘files-config’ typo/left-over.
* gnu/services/cups.scm (<policy-configuration>): Substitute
<files-configuration> for <files-config> in documentation.
* doc/guix.texi (Printing Services): Likewise.
2021-06-23 03:01:48 +02:00
Brice Waegeneire ef3f38ea00
services: openssh: Replace 'without-password' by 'prohibit-password'.
For some time, OpenSSH's option 'PermitRootLogin' has deprecated the
ambiguous argument 'without-password' with 'prohibit-password'.

* doc/guix.texi (Network Services): Replace 'without-password by
'prohibit-password.
* gnu/machine/digital-ocean.scm (guix-infect): Change system
configuration to use 'prohibit-password.
* gnu/services/ssh.scm (openssh-configuration): Change comment to use
'prohibit-password.
(openssh-config-file): Add support for 'prohibit-password to
'permit-root-login'.  Warn about deprecated 'without-password usage.
* gnu/tests/ganeti.scm (%ganeti-os): Replace 'without-password by
'prohibit-password.

Signed-off-by: Tobias Geerinckx-Rice <me@tobias.gr>
2021-06-20 16:44:08 +02:00
Brice Waegeneire 4bed8486d4
services: pcscd: Cleanup socket when started.
Otherwise when pcscd doesn't terminate properly (ie. receive a SIGKILL),
it won't start again because of it's socket already existing.

* gnu/services/security-token.scm (pcscd-shepherd-service)[start]:
Remove existing socket file.
2021-06-19 23:49:18 +02:00
Jack Hill 2e30e84b64
services: guix: Authorize 'bordeaux.guix.gnu.org.pub' by default.
This follows on from the changes in 4985a42724.

* gnu/services/base.scm (%default-authorized-guix-keys): Add
bordeaux.guix.gnu.org.pub.

Signed-off-by: Christopher Baines <mail@cbaines.net>
2021-06-19 09:32:54 +01:00
Ludovic Courtès f70c3429ed
services: Remove deprecated service procedures.
These service procedures were deprecated in January 2019, for instance
in commit 65a67bf711.

* gnu/services/avahi.scm (avahi-service): Remove.
* gnu/services/base.scm (console-keymap, guix-service)
(guix-publish-service, gpm-service, urandom-seed-service): Remove.
* gnu/services/desktop.scm (upower-service, colord-service): Remove.
* gnu/services/mcron.scm (mcron-service): Remove.
* gnu/services/messaging.scm (bitlbee-service): Remove.
* gnu/services/networking.scm (dhcp-client-service, ntp-service)
(tor-service): Remove.
* gnu/services/xorg.scm (slim-service, gdm-service): Remove.
2021-06-14 18:35:17 +02:00
Arun Isaac 0d2cbd6632
services: laminar: Create parent directory for unix socket.
* gnu/services/ci.scm (laminar-activation): New function.
(laminar-service-type): Extend activation-service-type with
laminar-activation.
2021-06-10 09:58:20 +05:30
Ludovic Courtès 0db906c52c
services: cuirass: Do not export record type descriptors.
* gnu/services/cuirass.scm (<cuirass-remote-server-configuration>)
(<cuirass-configuration>, <cuirass-remote-worker-configuration>): Do not
export.
2021-06-01 23:26:07 +02:00
Ludovic Courtès ec9307ea07
services: cuirass: Create the profile and GC root directory.
* gnu/services/cuirass.scm (cuirass-activation): Create
/var/guix/profiles/per-user/cuirass/cuirass or similar.
2021-06-01 23:26:07 +02:00
Brice Waegeneire ea55e1355b
services: dnsmasq: Extend 'activation-service'.
* gnu/services/dns.scm (dnsmasq-activation): New procedure …
(dnsmasq-service-type): … use it.
2021-05-31 22:06:54 +02:00
Brice Waegeneire 62a8d487d6
services: hostapd: Use package from configuration.
* gnu/services/networking.scm (hostapd-shepherd-services): Replace
'hostapd' by the package specified in the configuration.
2021-05-31 22:04:57 +02:00
Solene Rapenne ac95609208
gnu: services: Add missing wireguard related exports.
* gnu/services/vpn.scm: Export 'wireguard-peer-public-key' and
  'wireguard-peer-keep-alive'.

Signed-off-by: Guillaume Le Vaillant <glv@posteo.net>
2021-05-24 10:00:54 +02:00
Maxim Cournoyer a09cdf1f9d
services: opendht: Fix hang at boot.
Fixes <https://issues.guix.gnu.org/48521>.

The problem was caused by the 'file-system-mapping' record not being in scope.

* gnu/services/networking.scm (opendht-shepherd-service): Import the (gnu
system file-systems) module.
[requirement]: Depend on networking, to avoid spurious output.
[modules]: New field.
[start] <group>: New argument.
2021-05-19 22:46:52 -04:00
Maxim Cournoyer fd449608eb
services: Add a service for opendht.
* gnu/services/networking.scm (maybe-number?, maybe-string?): New procedures.
(<opendht-configuration>): New configuration record.
(%opendht-accounts): New variable.
(opendht-configuration->command-line-arguments): New procedure.
(opendht-shepherd-service, opendht-service-type): New variables.
* doc/guix.texi (Networking Services): Document the new service.
2021-05-17 23:27:40 -04:00
Maxim Cournoyer cdd1e15a25
services: configuration: Add a define-configuration/no-serialization syntax.
This is added for convenience and for uniformity with the
define-maybe/no-serialization syntax introduced in the previous commit.

* gnu/services/configuration.scm
(define-configuration/no-serialization): New syntax.
2021-05-17 23:27:40 -04:00
Maxim Cournoyer b7297d66c5
services: configuration: Add a define-maybe/no-serialization syntax.
Before this change, using define-maybe along define-configuration with the
no-serialization syntactic keyword would result in the following warning:

  warning: possibly unbound variable `VARIABLE-NAME'

This change introduces the define-maybe/no-serialization variant that does
away with defining a serialization helper procedure, which makes it possible
to avoid the above warning.

* gnu/services/configuration.scm (define-maybe/no-serialization): New syntax.
(define-maybe-helper): New procedure.
(define-maybe): Define syntax using the above procedure.
* tests/services/configuration.scm (tests): Fix module name.
(custom-number-serializer): Do not print to standard output.
(maybe-number?, serialize-maybe-number): New procedures defined via the
define-maybe macro.
(config-with-maybe-number): New configuration.
(serialize-number): New procedure.
("maybe value serialization"): New test.
(maybe-string?): New procedure defined via the define-maybe/no-serialization
macro.
(config-with-maybe-string/no-serialization): New configuration.
("maybe value without serialization no procedure bound"): New test.
2021-05-17 23:27:39 -04:00
Maxim Cournoyer b7cbca221f
Merge branch 'version-1.3.0' 2021-05-11 22:42:59 -04:00
Ludovic Courtès f903bb7741
services: configuration: Export 'no-serialization' syntactic keyword.
This is a followup to 3f9a12dc08.

* gnu/services/configuration.scm (no-serialization): New variable.
2021-05-08 15:06:31 +02:00
Maxim Cournoyer a9a67da573
services: docker: Disable configuration serialization.
* gnu/services/docker.scm (serialize-boolean): Delete procedure.
(docker-configuration) <no-serialization>: New syntactic keyword.
2021-05-08 01:04:31 -04:00
Maxim Cournoyer dd0826fbf3
services: configuration: Fix %location accessor name.
The non-hygienic binding of the source location accessor was set to
'-location'; in modules where multiple configurations were defined, it would
cause compilation warnings such as:

    gnu/services/mail.scm:175:0: warning: shadows previous definition of
    `%-location-procedure' at gnu/services/mail.scm:165:0

* gnu/services/configuration.scm (define-configuration-helper) <id>: Add a
missing #'stem argument to use the configuration name as a prefix to the
location accessor identifier.
2021-05-08 01:04:01 -04:00
Xinglu Chen b3e99d3399
services: configuration: Allow specifying a custom serializer.
In some cases, rather than globally disabling serialization, it may be more
appropriate to disable or otherwise alter the serialization procedure of a
specific field.  In large module, multiple configurations may also exist that
would need to alter the default serialization procedure, which is named after
the field type.  Being able to specify a per-field serialization procedure
provides more flexibility.

* gnu/services/configuration.scm (define-configuration): Add an optional
pattern variable to allow specifying a custom serialization procedure.
(define-configuration-helper) <field-serializer>: Use it to transform the
syntax.
(empty-serializer): New procedure.
(serialize-package): Alias to ‘empty-serializer’.

Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
2021-05-08 00:50:39 -04:00
Maxim Cournoyer 3f9a12dc08
services: configuration: Allow disabling serialization.
Serialization is not always useful, for example when deriving command line
arguments from a configuration.  This change provides a way to turn it off,
which removes the need to define a bunch of dummy serialization procedures.

Credit goes to Andrew Gierth (RhodiumToad) from #guile for providing the
solution.  Thank you!

* gnu/services/configuration.scm (define-configuration-helper): New procedure.
(define-configuration) <no-serialization>: New syntactic keyword.  Use it in a
new pattern.  Refactor the macro so that it makes use of the above helper
procedure.
2021-05-08 00:50:39 -04:00
Maxim Cournoyer 1a2704add3
services: configuration: Avoid a compilation warning.
This resolves a compilation warning introduced with commit bb716e8d9d.

* gnu/services/configuration.scm (configuration->documentation): Use display
to print the string instead of format.
2021-05-08 00:50:38 -04:00
Maxim Cournoyer bb716e8d9d
services: configuration: Add a new helper to ease generating documentation.
The original (undocumented) procedure to generate the doc has a difficult to
grasp interface; add a simpler one on top of it.

* gnu/services/configuration.scm (configuration->documentation): New procedure.
2021-05-07 08:59:31 -04:00
Xinglu Chen d1caabbce7
services: configuration: Support fields without default values.
Not all fields in a configuration have a sensible default value.  This changes
makes it possible to omit a default value for a configuration field, requiring
the user to provide a value.

* gnu/services/configuration.scm (configuration-missing-field): New procedure.
(define-configuration): Make default value optional.

Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
2021-05-07 08:57:45 -04:00
Maxim Cournoyer b39c4e18f2
services: spice-vdagent: Clear the socket file prior to starting.
This fixes the following issue where spice-vdagent would fail to start if the
spice-vdagent-sock socket file already existed:

  spice-vdagentd: Fatal could not create the server socket
  /run/spice-vdagentd/spice-vdagent-sock: Error binding to address: Address
  already in use

The requirement is also modified to depend on dbus-system, a cue taken from
upstream's own systemd service file (see 'data/spice-vdagentd.service' in the
sources).

* gnu/services/spice.scm (spice-vdagent-activation): Delete procedure.
(spice-vdagent-shepherd-service): Fix indentation.
[requirement]: Replace udev by dbus-system.
[start]: Ensure the spice-vdagentd run-time directory exists and that the
spice-vdagent-sock socket file does *not* exist before forking the daemon.
2021-05-06 16:51:49 -04:00
Alexey Abramov 0d6eb69266
services: dovecot: Add ‘managesieve-sieve-capability’ option.
* gnu/services/mail.scm (protocol-configuration): Add a
‘managesieve-sieve-capability’ field.
* doc/guix.texi (Mail Services): Document it.

Signed-off-by: Tobias Geerinckx-Rice <me@tobias.gr>
2021-05-06 11:31:48 +02:00
Alexey Abramov 6e05920cef
services: dovecot: Add ‘managesieve-notify-capability’ option.
* gnu/services/mail.scm (protocol-configuration): Add a
‘managesieve-notify-capability’ field.
* doc/guix.texi (Mail Services): Document it.

Signed-off-by: Tobias Geerinckx-Rice <me@tobias.gr>
2021-05-06 11:27:00 +02:00
Alexey Abramov 0fd5bdcaf6
services: dovecot: Add ‘imap-metadata?’ protocol configuration option.
* gnu/services/mail.scm (protocol-configuration): Add an ‘imap-metadata?’
setting to enable IMAP METADATA support in the ‘imap’ protocol.
* doc/guix.texi (Mail Services): Document it.

Signed-off-by: Tobias Geerinckx-Rice <me@tobias.gr>
2021-05-06 11:08:52 +02:00
Alexey Abramov 5b5c50961f
services: dovecot: Add ‘mail-attribute-dict’ configuration option.
* gnu/services/mail.scm (dovecot-configuration): Define a
‘mail-attribute-dict’ directive for IMAP METADATA storage.
* doc/guix.texi (Mail Services): Document it.

Signed-off-by: Tobias Geerinckx-Rice <me@tobias.gr>
2021-05-06 11:08:52 +02:00
Maxim Cournoyer 6b0704339d
services: Fix the spice-vdagent service.
* gnu/services/spice.scm (spice-vdagent-activation): Update runtime directory
from /var/run/spice-vdagentd to /run/spice-vdagentd.
(spice-vdagent-service-type): Specify a default value and fix indentation.
2021-05-05 16:31:06 -04:00
Christopher Baines c1131911a7
services: guix-build-coordinator: Fix queue builds state directory.
This service doesn't create a PID file, but it does write a file with the
processed commits in it, so create a directory to contain that.

* gnu/services/guix.scm (guix-build-coordinator-queue-builds-activation):
Ensure /var/cache/guix-build-coordinator-queue-builds exists.
2021-05-02 09:56:42 +01:00
methuselah-0 3802bb0ba0
services: mysql: Add extra-environment as configuration option.
* gnu/services/databases.scm (mysql-configuration): Add extra-environment
(mysql-service): Use #:log-file and #:environment-variables
* doc/guix.texi: Document it.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
2021-04-27 20:45:35 +02:00