Commit Graph

1980 Commits

Author SHA1 Message Date
Bruno Victal 00a28bc435
services: configuration: Add some commonly used predicates.
* gnu/services/configuration.scm (list-of-packages?, list-of-symbols?): New
predicate.
* gnu/services/audio.scm (list-of-symbol?): Remove.
* gnu/services/telephony.scm (string-list?): Remove.
(serialize-string-list): Rename to …
(serialize-list-of-strings): … this.
(account-fingerprint-list?, jami-account-list?): Use list-of.
* doc/guix.texi: Update it.

Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
2023-10-07 12:41:06 -04:00
Bruno Victal dd65564db0
services: fstrim-service-type: Serialize with SRFI-171 transducers.
* gnu/services/linux.scm (serialize-fstrim-configuration): Refactor to use
base-transducer.

Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
2023-10-07 12:41:05 -04:00
Bruno Victal a7994ed58d
services: configuration: Use transducers within serialize-configuration.
Introduces 'base-transducer', a SRFI-171 based transducer that can be used as a
starting point for writing custom configuration record serializing procedures.

This also fixes the symbol maybe-value serialization test case.

* gnu/services/configuration.scm (empty-serializer?): New predicate.
(base-transducer, tfilter-maybe-value): New procedure.
(serialize-configuration): Adapt to use base-transducer.

* gnu/services/telephony.scm (jami-account->alist): Use transducers to skip
fields that are unserializable or whose field maybe-value is unset.

* tests/services/configuration.scm: Remove test-expect-fail.

Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
2023-10-07 12:41:05 -04:00
Bruno Victal 1b29e5db8f
services: configuration: Simplify normalize-extra-args.
* gnu/services/configuration.scm
(define-configuration-helper, normalize-extra-args): Use #f instead of %unset-value.

Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
2023-10-07 12:41:04 -04:00
Ludovic Courtès e863274e67
services: hurd-vm: Leave root password uninitialized when offloading.
Starting with 953c65ffdd, offloading to
the Hurd VM would be enabled by default.  However, ‘root’ had an empty
password so any user on the host could connect to the VM over VNC, log
in as root, and potentially populate the host’s store from there.  This
change fixes that.

* gnu/services/virtualization.scm (operating-system-with-locked-root-account):
New procedure.
(hurd-vm-disk-image)[transform]: Add
‘operating-system-with-locked-root-account’ when offloading.
2023-10-05 23:14:55 +02:00
Ludovic Courtès a0818d0236
services: mcron: Hide ‘mkdir-p’ from (shepherd support).
This a avoids a Guile warning about the name collision with (guix build
utils).  The warning was introduced by commit
e0e85f2b23.

* gnu/services/mcron.scm (mcron-shepherd-services): Hide ‘mkdir-p’.
2023-10-05 23:14:55 +02:00
Ludovic Courtès e0e85f2b23
services: mcron: Do not #:select ‘%user-log-dir’.
* gnu/services/mcron.scm (mcron-shepherd-services): Do not #:select
‘%user-log-dir’ from (shepherd support) since it’s missing in the
Shepherd 0.8, which is still used on GNU/Hurd.
2023-10-02 17:17:07 +02:00
Ludovic Courtès 3b71b2dca7
gnu: cuirass: Update to 797b26a.
* gnu/packages/ci.scm (cuirass): Update to 797b26a.
* gnu/services/cuirass.scm (cuirass-activation): Create /var/run/cuirass.
2023-10-02 11:07:14 +02:00
Ludovic Courtès 953c65ffdd
services: hurd-vm: Implement zero-configuration offloading.
This allows for zero-configuration offloading to a childhurd.

* gnu/services/virtualization.scm (operating-system-with-offloading-account):
New procedure.
(<hurd-vm-configuration>)[offloading?]: New field.
(hurd-vm-disk-image): Define ‘transform’ and use it.
(hurd-vm-activation): Generate SSH key for user ‘offloading’ and add
authorize it via /etc/childhurd/etc/ssh/authorized_keys.d.
(hurd-vm-configuration-offloading-ssh-key)
(hurd-vm-guix-extension): New procedures.
(hurd-vm-service-type): Add GUIX-SERVICE-TYPE extension.
* gnu/tests/virtualization.scm (run-childhurd-test)[import-module?]: New
procedure.
[os]: Add (gnu build install) and its closure to #:import-modules.
[test]: Add “copy-on-write store” and “offloading” tests.
* doc/guix.texi (Virtualization Services): Document it.
2023-10-01 22:58:20 +02:00
Ludovic Courtès c3a19cc2ac
services: hurd-vm: Disable password-based authentication for root.
With offloading to a childhurd is enabled, allowing password-less root
login in the childhurd to anyone amounts to providing write access to
the host’s store to anyone.  Thus, disable password-based root logins in
the childhurd.

* gnu/services/virtualization.scm (%hurd-vm-operating-system): Change
‘permit-root-login’ to 'prohibit-password.
* gnu/tests/virtualization.scm (%childhurd-os): Provide a custom ‘os’
field for ‘hurd-vm-configuration’.
* doc/guix.texi (Virtualization Services): Remove mention of
password-less root login.
2023-10-01 22:58:20 +02:00
Ludovic Courtès bab6434f58
services: hurd-vm: ‘image’ field has to be an <image> record.
* gnu/services/virtualization.scm (<hurd-vm-configuration>)[image]:
Document as being an <image> record.
(hurd-vm-disk-image): Remove call to ‘system-image’.
(hurd-vm-shepherd-service): Add call to ‘system-image’.
* gnu/tests/virtualization.scm (hurd-vm-disk-image-raw): Remove call to
‘system-image’.
* doc/guix.texi (Virtualization Services): Adjust accordingly.
2023-10-01 22:58:19 +02:00
Ludovic Courtès 416933cde5
services: childhurd: Authorize the childhurd’s key on the host.
This partly automates setting up a childhurd for offloading purposes.

* gnu/services/virtualization.scm (authorize-guest-substitutes-on-host):
New procedure.
(hurd-vm-activation): Use it.
2023-10-01 22:58:19 +02:00
Ludovic Courtès aa40b085dc
services: guix: Support declarative offloading setup.
* gnu/services/base.scm (guix-machines-files-installation): New
procedure.
(<guix-configuration>)[build-machines]: New field.
(guix-activation): Call ‘ guix-machines-files-installation’.
(<guix-extension>)[build-machines]: New field.
(guix-extension-merge): Handle it.
(guix-service-type)[extend]: Likewise.
* doc/guix.texi (Daemon Offload Setup): Add note linking to
‘guix-configuration’.
(Base Services): Document ‘build-machines’ field of <guix-configuration>
and of <guix-extension>.
(Virtualization Services): Add ‘hurd-vm’ anchor.
2023-10-01 22:58:19 +02:00
Ludovic Courtès 21deb89e28
services: guix: Use the right locale package on GNU/Hurd.
Fixes a bug introduced in 0dd293b4d9
whereby guix-daemon on GNU/Hurd would have ‘GUIX_LOCPATH’ set to the
“wrong” locale data (2.35 instead of 2.37).

Consequently, it would fail to setlocale(3) and calls to
‘std::stoi’ (when reading the output of ‘guix authenticate’) would
throw, leading to this error message of guix-daemon:

  unexpected build daemon error: stoi

This would manifest when sending store items to a childhurd:

  $ guix copy --to=localhost:10022 sed
  guix copy: sending 1 store item (1 MiB) to 'localhost'...
  guix copy: error: unknown error while sending files over SSH

The “unknown error” is the ‘stoi’ exception.

This commit fixes that, but for the ‘guix-daemon’ service only.

* gnu/services/base.scm (guix-shepherd-service)[locales]: New variable.
Use it instead of ‘glibc-utf8-locales’.
2023-10-01 22:58:19 +02:00
Ludovic Courtès 81d46ef989
services: hurd-vm: Use the default SSH port number.
* gnu/services/virtualization.scm (%hurd-vm-operating-system): Remove
‘port-number’ from ‘openssh-configuration’.
(hurd-vm-net-options): Change 2222 to 22 in port forwarding.
2023-10-01 22:58:19 +02:00
Marius Bakke 4163c617b8
services: nftables: Add 'configuration' action.
* gnu/services/networking.scm (nftables-shepherd-service)[actions]: New field.
2023-09-22 01:29:18 +08:00
Ludovic Courtès 5e0ae26846
services: hurd-vm: Use ‘qemu-system-x86_64’.
Fixes <https://issues.guix.gnu.org/66053>.

* gnu/services/virtualization.scm (hurd-vm-shepherd-service)[vm-command]:
Use ‘qemu-system-x86_64’.
2023-09-18 23:14:00 +02:00
Ludovic Courtès fc3a53525a
services: dhcp-client: Fix name of the provision accessor.
This is a followup to 04f71edb73.

* gnu/services/networking.scm (<dhcp-client-configuration>)[shepherd-provision]:
Fix accessor name.
2023-09-17 16:29:19 +02:00
Alexey Abramov 04f71edb73
services: dhcp-client-configuration: Allow provision override.
* gnu/services/networking.scm (<dhcp-client-configuration>)[shepherd-provision]:
New field.
(dhcp-client-shepherd-service): Honor it.
* doc/guix.texi (Networking Setup): Document it.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2023-09-17 15:31:03 +02:00
Adam Maleszka 944c1b62a1
services: syncthing: Ensure that service runs after mounting home directories.
Sometimes `syncthing-service-type' fails during startup because it tries
to read configuration files from the user's home directory:

Failure on home directory: mkdir /home/xyz/.config: permission denied

This patch adds `user-processes' to the shepherd service requirements to
ensure that `user-homes' is fired before `syncthing' tries to read data
from the home directory.

* gnu/services/syncthing.scm (syncthing-shepherd-service): add
`user-processes' to requirements

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2023-09-17 15:31:03 +02:00
Christopher Baines 9c9d6c3dab
services: bffe: Use guile from the package.
Rather than hardcoding a particular guile in the service definition.

* gnu/services/guix.scm (bffe-shepherd-services): Use guile from the package.
* gnu/packages/package-management.scm (bffe)[inputs]: Remove unnecessary
guile-next input.
2023-09-15 11:10:43 +01:00
Christopher Baines 82abf6ddad
services: guix: Add bffe-service-type.
This is intended to replace the functionality of the Guix Build Coordinator
queue builds script, and also provide a web interface for build farms.

* gnu/services/guix.scm (<bffe-configuration>): New record type.
(bffe-configuration, bffe-configuration?,
bffe-configuration-package,
bffe-configuration-user,
bffe-configuration-group,
bffe-configuration-arguments
bffe-configuration-extra-environment-variables): New procedures.
(bffe-service-type): New variable.
* gnu/tests/guix.scm (%test-bffe): New variable.
* doc/guix.texi (Guix Services): Document the new service.
2023-09-15 09:57:32 +01:00
Thomas Albers 4cf4bd1ebe
services: cgit: Allow file-like objects for ‘root-readme’.
* gnu/services/cgit.scm (cgit-configuration)[root-readme]: Accept
'file-object' instead of only 'string'

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2023-09-09 15:54:37 +02:00
Reily Siegel 5e72bb5c67
services: vpn: Fix broken format string for wireguard dns.
* gnu/services/vpn.scm (wireguard-configuration-file): Fix broken format
string.

Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com>
2023-09-09 12:24:12 +02:00
Marius Bakke 0fbeeee7e9
services: Open vSwitch: Depend on 'user-processes' target.
* gnu/services/networking.scm (openvswitch-shepherd-service)[ovsdb](requirement):
Add user-processes.
2023-09-08 18:53:47 +08:00
Christopher Baines d823ed25d5
services: nar-herder: Specify a working directory.
Mostly so that core dumps end up here.

* gnu/services/guix.scm (nar-herder-shepherd-services): Specify a working
directory.
2023-08-26 12:19:14 +01:00
Christopher Baines 82b5e89d78
services: guix-data-service: Specify a working directory.
Mostly so that core dumps end up here.

* gnu/services/guix.scm (guix-data-service-shepherd-services): Specify a
working directory.
2023-08-26 12:18:52 +01:00
Christopher Baines aba7c73d04
services: guix-build-coordinator: Specify a working directory.
Mostly so that core dumps end up here.

* gnu/services/guix.scm (guix-build-coordinator-shepherd-services): Specify a
working directory.
2023-08-26 12:18:08 +01:00
Hilton Chain 0c4fb8f43f
services: mcron: Use (shepherd support) module unconditionally.
This fixes a issue introduced in the previous commit 552d070377 (services:
mcron: Add module for %user-log-dir.)  which made the expression invalid when
using a '() module for the system service.

* gnu/services/mcron.scm (mcron-shepherd-services)[modules]: Use
(shepherd support) unconditionally.
2023-08-22 21:37:41 +08:00
Hilton Chain 552d070377
services: mcron: Add module for %user-log-dir.
* gnu/services/mcron.scm (mcron-shepherd-services)[modules]: Add
(shepherd support) for home service.
2023-08-22 20:18:34 +08:00
Ludovic Courtès 2274d71f94
services: file-database: Clarify 'excluded-directories' description.
* gnu/services/admin.scm (file-database-configuration)[excluded-directories]:
Mention that these are regexps.
(%default-file-database-excluded-directories): Likewise.
* doc/guix.texi (File Search Services): Adjust accordingly.
2023-08-22 11:17:53 +02:00
Ludovic Courtès 6fc754c2d6
services: file-database: Set 'PATH' for 'updatedb'.
Previously 'updatedb' would fail to find 'sed', 'rm', etc.

* gnu/services/admin.scm (file-database-mcron-jobs): Set PATH before
invoking 'updatedb'.
2023-08-22 11:17:53 +02:00
Ludovic Courtès 0e6215ac72
gnu: earlyoom: Improve description.
* gnu/services/linux.scm (earlyoom-service-type)[description]: Tweak.
2023-08-21 17:29:51 +02:00
Ludovic Courtès 69d8d0a719
services: earlyoom: Move 'user-processes' to 'requirements'.
Fixes a regression introduced in
9c34b793c1.

* gnu/services/linux.scm (earlyoom-shepherd-service): Move
'user-processes' to 'requirements'.

Reported-by: Attila Lendvai <attila@lendvai.name>
2023-08-21 17:29:50 +02:00
Ludovic Courtès 9c34b793c1
services: Add missing 'user-processes' requirements.
* gnu/services/guix.scm (guix-build-coordinator-agent-shepherd-services):
Add 'user-processes' requirement.
* gnu/services/linux.scm (earlyoom-shepherd-service): Likewise.
2023-08-21 16:16:47 +02:00
Ludovic Courtès 7605c01fcc
home: services: Add Syncthing.
* gnu/home/services/syncthing.scm: New file.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
* gnu/services/syncthing.scm (<syncthing-configuration>)[home-service?]:
New field.
Adjust 'provision' and 'requirement' depending on 'home-service?', and
likewise for #:user and #:group.
Use 'filter' + 'negate' instead of 'remove'.
* doc/guix.texi (Networking Services): Add note and cross-reference to
"Networking Home Services".
(Networking Home Services): New node.
2023-08-20 22:48:48 +02:00
Ludovic Courtès 1ce3424e22
home: services: Add dicod.
* gnu/home/services/dict.scm: New file.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
* gnu/services/dict.scm (<dicod-configuration>)[home-service?]: New
field.
(dicod-shepherd-service): Do not map /dev/log when 'home-service?' is
true.  Remove 'user-processes' requirement when 'home-service?' is
true.
(dicod-shepherd-service): Set #:user and #:group to #f when
'home-service?' is true.
* doc/guix.texi (Miscellaneous Home Services): New node.
(Miscellaneous Services): Add cross-reference.
2023-08-20 22:48:47 +02:00
Ludovic Courtès 1c30d5a6bf
home: services: mcron: Define as a mapping of the system service.
* gnu/services/mcron.scm (list-of-gexps?): Remove.
(<mcron-configuration>): Rewrite using 'define-record-type*'.
[home-service?]: New field.
[log-file]: Make thunked and changed default value.
(mcron-shepherd-services): Honor 'home-service?' and remove use of
'maybe-value-set?'.
(mcron-service-type): Inherit 'home-service?' from CONFIG.
(generate-doc): Remove.
* gnu/home/services/mcron.scm (list-of-gexp?)
(<home-mcron-configuration>, job-files, shepherd-schedule-action)
(home-mcron-shepherd-services, home-mcron-profile)
(home-mcron-extend, generate-doc): Remove.
(home-mcron-configuration): Turn into a macro.
(home-mcron-service-type): Define in terms of
'system->home-service-type'.
<top level>: Add service type mapping.
2023-08-20 22:48:47 +02:00
Ludovic Courtès c6c8106c65
services: syncthing: Use 'match-record'.
* gnu/services/syncthing.scm (syncthing-shepherd-service): Use
'match-record-lambda' instead of 'match-lambda'.
2023-08-20 22:48:39 +02:00
Ludovic Courtès 9bfe7fbdbe
services: dicod: Pre-build the GCIDE index.
* gnu/services/dict.scm (%dicod-gcide-index): New variable.
(%dicod-database:gcide): Use it.
(%dicod-activation): Remove.
(dicod-shepherd-service): Remove reference to /var/run/dicod.
(dicod-service-type): Remove ACTIVATION-SERVICE-TYPE extension.
2023-08-20 22:47:26 +02:00
Ludovic Courtès 171ab374f9
services: dicod: Remove Shepherd < 0.9.0 compatibility layer.
* gnu/services/dict.scm (dicod-shepherd-service): Use
'make-inetd-constructor' and 'make-inetd-destructor' unconditionally.
2023-08-20 22:47:25 +02:00
宋文武 0ffbdf3456
Merge remote-tracking branch 'origin/master' into kde-updates 2023-08-17 18:38:23 +08:00
Bruno Victal 2b031ca4b2
Revert "services: Add ddclient service."
ddclient is unmaintained as of 2023-07-04 [1] and this service has been broken
for a while [2]. Remove it rather than shipping a broken service for an
unmaintained program that's unlikely to be fixed.

[1]: <https://github.com/ddclient/ddclient>
[2]: <https://issues.guix.gnu.org/52770>

This reverts commit 8490a8346b.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2023-08-16 23:13:55 +02:00
Martin Baulig 9dda747975
services: posgresql: Add option to specify UID/GID for postgres user.
Add 'createAccount?', 'uid' and 'gid' to <postgresql-configuation>.

Unlike other system daemons, the PostgreSQL data directory is typically
meant to persist across 'guix system reconfigure' and once created, you
don't want it's UID or GID to change anymore.

Furthermore, if you want to place the data directory on a network share
and use NFSv4 with idmap, then the 'postgres' user must exist when the
'rpc.idmapd' daemon is launched; prior to mounting the share.  And it
needs to be possible to mount the share without configuring PostgreSQL.

With NFSv3, the UID and GID typically needs to match those on the
server.

The added options allow for both of these scenarios:

You can either create the user in (operating-system (users)) completely
independently of the 'postgresql-service-type' (for instance to get your
NFS setup working first prior to configuring your databases) - or "pin"
it's UID / GID values.

* gnu/services/databases.scm (<postgresql-configuration>)[create-account?]
[uid, gid]: New fields.
(%postgresql-accounts): Remove.
(create-postgresql-account): New procedure.
(postgresql-service-type)[extensions]: Use it.
* doc/guix.texi (Database Services): Update accordingly.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2023-08-16 22:37:52 +02:00
Maxim Cournoyer 132ddca5a4
gnu: elogind: Update to 252.9.
* gnu/packages/freedesktop.scm (elogind): Update to 252.9.
[source]: Replace elogind-revert-polkit-detection.patch with
elogind-fix-rpath.patch in patches.
[configure-flags]: Add the dbussystemservicedir, dbussessionservicedir,
dbussystemservicedir and dbus-interfaces-dir flags.
[phases] <use-global-hook-directory> Update list of patched files.
<adjust-tests> Update substitutions, and skip the copy_holes test.
[native-inputs]: Add python-jinja2.
[inputs]: Add util-linux:lib.
* gnu/services/desktop.scm (elogind-dbus-service)
<elogind-dbus-service-wrapper>: Add a symlink to elogind's
share/dbus-1/system.d to expose D-Bus policy configurations.
* gnu/tests/desktop.scm (run-elogind-test): Adjust expected result for the new
"linger" value.
* gnu/packages/patches/elogind-revert-polkit-detection.patch: Delete file.
* gnu/packages/patches/elogind-fix-rpath.patch: New file.
* gnu/local.mk (dist_patch_DATA): Update.

Series-to: 64938@debbugs.gnu.org
Series-prefix: elogind-updates
Series-version: 2
Series-changes: 2
- Fix elogind system test
- Install D-Bus policy files in elogind-dbus-service-wrapper
- Remove duplicate 'dbussystemservicedir' configure flag
2023-08-16 11:24:10 -04:00
Felix Lechner b8ee6b8a59
services: Add cachefilesd service.
Thanks to Bruno Victal "mirai" for cooperating on this patch and for
generously sharing a wealth of insights about Guix services.

Thanks to Jean-Baptiste Note for an early version of this service!

* doc/guix.texi (Linux Services)[Cachefilesd Service]: New heading.
* gnu/services/linux.scm (serialize-string, non-negative-integer?)
(serialize-non-negative-integer, string, non-negative-integer)
(make-option-serializer, make-percentage-threshold-serializer): New
procedures.
(cachefilesd-configuration): New record type.
(cachefilesd-service-type): New variable.
* gnu/tests/cachefilesd.scm: New file.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.

Co-authored-by: Bruno Victal <mirai@makinata.eu>
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2023-08-15 23:30:44 +02:00
Felix Lechner 48d06aee7b
services: Use more 'file-append'.
* gnu/services/authentication.scm (pam-ldap-pam-service): Use
'file-append' instead of #~(string-append ...).
* gnu/services/base.scm (greetd-pam-service): Likewise.
* gnu/services/kerberos.scm (pam-krb5-pam-service): Likewise.
* gnu/services/pam-mount.scm (pam-mount-pam-service): Likewise.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2023-08-15 23:30:44 +02:00
Felix Lechner 20c51c1d2c
services: pam-limits: Keep 'limits.conf' in the store.
* gnu/services/base.scm (pam-limits-service-type)[pam-extension]: Wrap
into a 'lambda' that takes 'limits-file'.  Pass that in the <pam-entry>
'arguments' field.  Define 'make-limits-file' and use it.
Remove ETC-SERVICE-TYPE extension.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2023-08-15 23:30:43 +02:00
宋文武 770f3f587d
Merge remote-tracking branch 'origin/master' into kde-updates 2023-08-11 20:19:52 +08:00
terramorpha 56fddefc6d
services: syncthing: Use the new command line syntax.
* gnu/services/syncthing.scm (syncthing-shepherd-service): Use the new command line syntax.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2023-08-11 00:50:48 +02:00
Miguel Moreno 71aba798d3
services: postgresql: Add more role fields.
* gnu/services/databases.scm (postgresql-role): Add more role fields.
(postgresql-create-roles): Honor it.
* doc/guix.texi (Database Services): Document it.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2023-08-11 00:50:48 +02:00
Hartmut Goebel 8055649428
services: Add Plasma desktop service.
* gnu/services/desktop.scm (kde-desktop-service-type): New variable.
(<kde-desktop-configuration>): New record type.
(kde-desktop-configuration): New procedure.
* doc/guix.texi (Desktop Services): Document it.

Co-authored-by: Zheng Junjie <873216071@qq.com>
Signed-off-by: 宋文武 <iyzsong@member.fsf.org>
2023-08-03 17:38:03 +08:00
Zheng Junjie 7e056197d7
services: sddm: Set some environment variables for the breeze theme.
* gnu/services/sddm.scm (sddm-service-type): Pass #:environment-variables to
make-forkexec-constructor.

Signed-off-by: 宋文武 <iyzsong@member.fsf.org>
2023-08-02 22:27:43 +08:00
Brian Cully 8a88b8b0b5
services: Add pam-mount-volume-service-type.
The `pam-mount-volumes-service-type' adds additional volumes to the
pam-mount-service-type in addition to any that are already specified in
`pam-mount-rules'.

* doc/guix.texi (PAM Mount Volume Service): add documentation for
`pam-mount-service-type'.
* gnu/services/pam-mount.scm: new file.
* Makefile.am: add pam-mount tests
* tests/services/pam-mount.scm: new tests

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2023-08-10 09:26:08 +02:00
Sam Lockart 969cea6836
file-systems: Use cgroups v2.
cgroup v2 is the next generation of the control groups API.  This patch
replaces the cgroup v1 file systems with the unified cgroup v2 file
system.

cgroup v2 allows for things like containerd/podman to run rootless
containers and opens guix system up to running things like Kubernetes.

Thanks to Hilton Chain <hako@ultrarare.space> for suggesting the Docker
service change.

* gnu/system/file-systems.scm (%control-groups): Change to a single
"cgroup2" mount point.
* gnu/services/docker.scm (docker-shepherd-service): Trim 'requirement'
field accordingly.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2023-08-08 18:01:55 +02:00
Ludovic Courtès b3a2b3e723
services: Add 'package-database' service.
* gnu/services/admin.scm (%default-package-database-update-schedule):
New variable.
(<package-database-configuration>): New record type.
(package-database-mcron-jobs): New procedure.
(package-database-service-type): New variable.
* doc/guix.texi (File Search Services): Document it.
2023-08-07 15:11:45 +02:00
Ludovic Courtès e63c87020d
services: Add 'file-database' service.
* gnu/services/admin.scm (%default-file-database-update-schedule)
(%default-file-database-excluded-directories): New variables.
(<file-database-configuration>): New record type.
(file-database-mcron-jobs): New procedure.
(file-database-service-type): New variable.
* doc/guix.texi (File Search Services): New node.
2023-08-07 15:11:44 +02:00
Maxim Cournoyer c7e45139fa
Revert "services: mpd: Add an 'update' action to trigger a database update."
This reverts commit e1070ee160.  Rationale: this
only works with the default 'endpoints'.  The 'auto-update?' option should be
sufficient to trigger a database update automatically anyway.
2023-07-26 12:04:37 -04:00
Maxim Cournoyer 776317e707
services: mpd: Provision a default cache directory and set HOME.
Relates to <https://issues.guix.gnu.org/63082>.

* gnu/services/audio.scm (mpd-shepherd-service): Create a default .cache
directory.  Use mkdir-p/perms and refactor loop.  Set the HOME environment
variables.
2023-07-26 10:40:16 -04:00
Maxim Cournoyer 07bb69d52c
services: mpd: Auto-detect mpd-output mixer type by default.
Relates to <https://issues.guix.gnu.org/63082>.

* gnu/services/audio.scm (mpd-output) [mixer-type]: Change default value from
"none" to unspecified.
* doc/guix.texi (Audio Services): Regenerate doc.
2023-07-26 10:40:16 -04:00
Maxim Cournoyer f16c7188f4
services: Avoid 'delete' overrides warning in audio module.
* gnu/services/audio.scm: Hide 'delete' on (gnu services) import.
2023-07-26 10:40:16 -04:00
Maxim Cournoyer 0db2fa1ac0
services: mpd: Do not rotate logs when using syslog.
* gnu/services/audio.scm (mpd-log-rotation): Conditionlize based on the value
of LOG-FILE.
2023-07-26 10:40:16 -04:00
Maxim Cournoyer 131746885c
services: mpd: Log to syslog by default.
Rationale: the tristate value was awkward to deal with, the default log file
name was odd (/var/log/mpd/log) and it required special attention to create
the 'mpd' parent directory as root and chowning it to the MPD user.  It also
didn't match the default behavior of MPD, which is to log to systemd or syslog
unless a log file is specified.

* gnu/services/audio.scm (mpd-log-file-sanitizer): New procedure.
(mpd-configuration) [log-file]: Remove default maybe value.  Add sanitizer.
(mpd-shepherd-service): Validate the log file parent directory exists and has
the right permissions.  Conditionally add syslogd to requirements.
(mympd-log-to-sanitizer): New procedure.
(mympd-configuration) [log-to]: Change type to maybe-string.  Update doc and
add sanitizer.
(mympd-shepherd-service) [requirement]: Fix to use syslogd.  Adjust
accordingly.
[start] Adjust accordingly.
(mympd-log-rotation): Check log-to via maybe-value-set?.
* doc/guix.texi (Audio Services): Update doc.
2023-07-26 10:40:15 -04:00
Maxim Cournoyer a5d611c19b
services: mpd; Refactor start slot directory initialization.
* gnu/services/audio.scm (mpd-shepherd-service): Standardize the way the log
file parent and other directories are initialized in the start slot.
(mympd-shepherd-service): Likewise.
2023-07-26 10:40:15 -04:00
Maxim Cournoyer 98a46c9da6
services: mpd: List log-level in decreasing verbosity order in doc.
* gnu/services/audio.scm (mpd-configuration) [log-level]: List log-level in
decreasing verbosity order in doc.
* doc/guix.texi (Audio Services): Update doc.
2023-07-26 10:40:15 -04:00
Christopher Baines a8b4ab61f3
services: guix-data-service: Unlink the two shepherd services.
So that they can be restarted in dependently.

* gnu/services/guix.scm (guix-data-service-shepherd-services): Don't require
the main service from the jobs service.
2023-07-26 10:31:58 +01:00
Maxim Cournoyer 005912c595
services: mpd: Rename %set-user-group to set-user-group.
The convention to use % as a prefix is for "special" variables rather than
procedures.

* gnu/services/audio.scm (%set-user-group): Rename to...
(set-user-group): ... this.
2023-07-25 13:04:18 -04:00
Maxim Cournoyer 42c8a2e296
services: mpd: Streamline mpd-user-sanitizer and mympd-user-sanitizer.
* gnu/services/audio.scm (mpd-user-sanitizer, %mympd-user): Remove extraneous
group field, already inherited.
(%mpd-user, %mympd-user): Clarify %lazy-group explanatory comment.  Fix
indentation.
2023-07-25 13:04:18 -04:00
Maxim Cournoyer e1070ee160
services: mpd: Add an 'update' action to trigger a database update.
* gnu/services/audio.scm (mpd-shepherd-service): Register a new update action.
* doc/guix.texi (Audio Services): Document it.
2023-07-25 13:04:17 -04:00
Maxim Cournoyer 6a57bf9612
services: mpd: Add auto-update? field to mpd-configuration.
* gnu/services/audio.scm (mpd-configuration) [auto-update?]: New field.
* doc/guix.texi (Audio Services): Update doc.
2023-07-25 13:04:12 -04:00
Maxim Cournoyer bdcf23cf69
services: wireguard: Add a 'configuration' action.
* gnu/services/vpn.scm (wireguard-shepherd-service) [actions]: New field.
2023-07-21 11:58:45 -04:00
Maxim Cournoyer d2385da87e
services: wireguard: Clean-up configuration file serializer.
Previously, the generated config file would contain arbitrary whitespace that
made it look ugly.

* gnu/services/vpn.scm (<wireguard-configuration>) [dns]: Change default value
from #f to '().
(wireguard-configuration-file): Use match-record.  Format each line
individually, assembling the lines at the end to avoid extraneous white space.
* doc/guix.texi (VPN Services): Update doc.
2023-07-21 11:58:44 -04:00
Maxim Cournoyer 8d785c43ba
services: wireguard: Implement a dynamic IP monitoring feature.
* gnu/services/vpn.scm (<wireguard-configuration>)
[monitor-ips?, monitor-ips-internal]: New fields.
* gnu/services/vpn.scm (define-with-source): New syntax.
(wireguard-service-name, strip-port/maybe)
(ipv4-address?, ipv6-address?, host-name?)
(endpoint-host-names): New procedure.
(wireguard-monitoring-jobs): Likewise.
(wireguard-service-type): Register it.
* tests/services/vpn.scm: New file.
* Makefile.am (SCM_TESTS): Register it.
* doc/guix.texi (VPN Services): Update doc.

Reviewed-by: Bruno Victal <mirai@makinata.eu>
2023-07-21 11:58:44 -04:00
Maxim Cournoyer f15c5edb1a
services: herd: Add a new 'current-service' procedure.
* gnu/services/herd.scm (current-service): New procedure, mostly reusing the
existing current-services.
(current-services): Implement in terms of the above procedure.
2023-07-21 11:58:44 -04:00
Janneke Nieuwenhuizen 9c1957921a
services: static-networking: Support netdde for the Hurd.
As suggested by Sergey Bugaev on bug-hurd

    https://lists.gnu.org/archive/html/bug-hurd/2023-05//msg00455.html

* gnu/services/base.scm (static-networking->hurd-pfinet-options): Use
/DEV/ethX.  Use long options for settrans.

Signed-off-by: Josselin Poiret <dev@jpoiret.xyz>
2023-07-13 19:00:05 +02:00
Janneke Nieuwenhuizen 09657f3ee7
services: childhurd: Bump default qemu memory to 2048MB.
When booting with pci-arbiter and rumpdisk and using 1024MB of memory for
qemu, booting hangs, or seems to hang, at the end of the rumpdisk boot
messages.  At least 1200MB is required, currently.

* gnu/services/virtualization.scm (<hurd-vm-configuration>)[memory-size]: Bump
to 2048.
* gnu/system/examples/bare-hurd.tmpl: Suggest using 2048 here too.  Update
example `guix system image' and "qemu" command lines too.

Signed-off-by: Josselin Poiret <dev@jpoiret.xyz>
2023-07-13 18:59:02 +02:00
Tobias Geerinckx-Rice 820e32b556
services: cgit: Remove ‘cgit-repo’ left-overs.
This follows up on commit 16d77b31c5.

* gnu/services/cgit.scm (cgit-configuration): Use extant
repository-cgit-configuration variable name.
2023-07-02 02:00:09 +02:00
Josselin Poiret 612399df3e
services: libvirt: Add requirement on dbus.
* gnu/services/virtualization.scm (libvirt-shepherd-service): Add requirement
on dbus.
2023-07-07 21:14:10 +02:00
Josselin Poiret 4722496292
gnu: gnome: Remove gnome-boxes from default GNOME apps.
* gnu/packages/gnome.scm (gnome): Remove gnome-boxes from propagated-inputs,
since it is no longer a Core App in 42.
2023-07-07 21:14:09 +02:00
Bruno Victal cbc14b3bae
services: nginx: Harden php-location settings.
* gnu/services/web.scm (nginx-php-location): Only pass existing PHP files
to the back end.  Mitigate httpoxy vulnerability.
2023-07-02 02:00:01 +02:00
John Kehayias 63660f0feb
services: pam-limits: Add lightdm.
Without this a user's pam-limits-service-type configuration does not have an
effect when using lightdm.

* gnu/services/base.scm (pam-limits-service-type): Add "lightdm" to the list.
2023-06-27 15:43:27 -04:00
Ludovic Courtès 6c0e7b2665
services: Validate 'provision' field of <shepherd-service>.
Fixes <https://issues.guix.gnu.org/63979>.

* gnu/services/shepherd.scm (validate-provision): New procedure.
(<shepherd-service>)[provision]: Use it.

Co-authored-by: Bruno Victal <mirai@makinata.eu>
2023-06-25 23:46:03 +02:00
Ludovic Courtès deeee98a50
services: dicod: Use one inetd endpoint per interface.
* gnu/services/dict.scm (dicod-shepherd-service): Remove
the (= 1 (length interfaces)) restriction by adding one endpoint per
interface.
2023-06-24 16:11:07 +02:00
Saku Laesvuori a82130de50
services: certbot: Fix nginx crash when certbot is used without domains.
* gnu/services/certbot.scm (certbot-nginx-server-configurations):
Don't return a broken nginx-server-configuration with empty server_name
when no certificate domains are configured. Instead add a separate
server for every certificate, so 0 certificates adds 0 servers.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Reviewed-by: Bruno Victal <mirai@makinata.eu>
2023-06-18 23:12:10 +02:00
Ludovic Courtès c27479a739
services: qemu-guest-agent: Add dependency on udev.
Fixes <https://issues.guix.gnu.org/64057>.

* gnu/services/virtualization.scm (qemu-guest-agent-shepherd-service):
Add 'requirement' field.

Reported-by: Yann Dupont <yann.dupont@univ-nantes.fr>
2023-06-16 00:14:52 +02:00
Ludovic Courtès 26602f4063
services: static-netwoking: Wait for devices to show up.
Fixes <https://issues.guix.gnu.org/63516>.

* gnu/services/base.scm (network-set-up/linux): Add call to
'wait-for-link'.
2023-06-14 23:48:01 +02:00
muradm f4f5ee6ad6
services: screen-locker-service-type: Configurable PAM and setuid.
screen-locker-service-type by default does both define PAM entry
and make program setuid binary. Normally both methods are
mutually exclusive, if binary has setuid set it does not really
needs PAM, otherway around also similar, if PAM is enabled
binary should not relay on setuid.

Recent swaylock package now compiled with PAM support. When PAM
support is compiled in, swaylock rejects executing if binary is
also setuid program.

This change turns screen-locker-configuration from strict
PAM AND setuid to more flexible PAM AND/OR setuid. Allowing
swaylock to be configured properly while supporting other
screen locker preferences.

* gnu/services/xorg.scm (screen-locker-configuration): Switch from
define-record-type to define-configuration.
[using-pam?]: New field to control PAM entry existence.
[using-setuid?]: New field to control setuid binary existence.
(screen-locker-pam-services): Should not make unix-pam-service if
using-pam? is set to #f.
(screen-locker-setuid-programs): Should not make program setuid
program if using-setuid? is set to #f.
(screen-locker-generate-doc): Internal function to generate
configuration documentation.
(screen-locker-service): Adapt to new screen-locker-configuration.
* gnu/services/desktop.scm (desktop-services-for-system): Adapt to
new screen-locker-configuration.
* doc/guix.texi: Reflect new changes to screen-locker-configuration.

Signed-off-by: Josselin Poiret <dev@jpoiret.xyz>
2023-06-04 10:33:55 +02:00
Ludovic Courtès d23d8fcee9
services: herd: "Resolve" transient services only when needed.
This allows us to get rid of the "eval root" actions, which in turn
would lead to confusing "Evaluating user expression" messages.

Fixes <https://issues.guix.gnu.org/55857>.

* gnu/services/herd.scm (resolve-transients): In 'values', avoid
'eval-there' call when UNRESOLVED is empty.
2023-05-30 00:15:29 +02:00
Ludovic Courtès 689460f82a
services: guix: Depend on 'avahi-daemon' when 'discover?' is set.
Previously, with shepherd 0.10.0, guix-daemon would start quickly,
possibly before avahi-daemon is running.  Consequently, its "guix
discover" child process would exit immediately with a warning saying
"Avahi daemon is not running".

* gnu/services/base.scm (guix-shepherd-service): When DISCOVER? is true,
add 'avahi-daemon' to 'requirement'.
2023-05-24 15:04:00 +02:00
muradm e02584b456
services: cups: Add cups PAM service.
Fixes <https://issues.guix.gnu.org/63198>.

Have the CUPS service extend pam-root-service-type providing minimal
configuration to authenticate users.  Since PAM authentication is provided,
the regular cups package can be used as default instead of the minimal,
PAM-lacking variant.

* gnu/services/cups.scm (cups-configuration)
[cups]: Replace cups-minimal with cups.
[allow-empty-password?]: PAM service configuration permitting empty passwords.
(opaque-cups-configuration): Likewise.
(cups-pam-service): New procedure.
(cups-service-type): Extend pam-root-service-type with cups-pam-service.

Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
2023-05-23 20:26:19 -04:00
Ludovic Courtès 896a51258a
services: Transient inetd services inherit requirements.
That way, per-connection transient services such as 'sshd-123' inherit
dependencies of their "parent" ('sshd' in this example), which is more
consistent than not depending on anything.

* gnu/services/dict.scm (dicod-shepherd-service): Pass #:requirements to
'make-inetd-constructor'.
* gnu/services/messaging.scm (bitlbee-shepherd-service): Likewise.
* gnu/services/ssh.scm (openssh-shepherd-service): Likewise.
* gnu/services/vnc.scm (xvnc-shepherd-service): Likewise.
2023-05-21 01:04:39 +02:00
Ludovic Courtès d0168e1895
services: root-file-system: Remove reference to 'stop-logging'.
* gnu/services/base.scm (%root-file-system-shepherd-service): In 'stop'
method, remove reference to 'stop-logging'.  That procedure is gone in
Shepherd 0.10.0, leading to an unbound-variable exception.
Additionally, calling is unnecessary since 0.4.0, where shepherd logs to
syslog (thus the open file descriptor is not backed by an on-disk file).
2023-05-21 01:04:39 +02:00
Ludovic Courtès d99a4c4cb3
services: agetty: 'stop' method does nothing when running is 'idle.
This is a followup to 57e731c358.

* gnu/services/base.scm (agetty-shepherd-service): Change 'stop' method
to return #f immediately when the running value is 'idle.
2023-05-21 01:04:39 +02:00
Maxim Cournoyer d43d8377c7
services: rsync: Use least authority wrapper.
* gnu/services/rsync.scm (rsync-shepherd-service) Wrap rsync command in a
least-authority-wrapper.

Reviewed-by: Ludovic Courtès <ludo@gnu.org>
2023-05-18 23:11:19 -04:00
Maxim Cournoyer 03e601da49
services: rsync: Use make-inetd-constructor.
* gnu/services/rsync.scm (rsync-shepherd-service): Use make-inetd-constructor
if available in start slot.
* gnu/tests/rsync.scm (run-rsync-test): Delete "PID file" test.

Reviewed-by: Ludovic Courtès <ludo@gnu.org>
2023-05-18 23:10:56 -04:00
Maxim Cournoyer 5b700945fb
services: ssh: Really rename openssh-challenge-response-authentication?
Fixes up 9c161c1f0d, which renamed the accessor of <openssh-configuration> but
failed to adjust the single usage.

* gnu/services/ssh.scm (openssh-config-file): Rename
openssh-challenge-response-authentication? call to
openssh-configuration-challenge-response-authentication?.
2023-05-17 22:26:41 -04:00
Maxim Cournoyer 9c161c1f0d
services: ssh: Rename openssh-challenge-response-authentication?
This is a follow-up commit to the preceding commit, which exported all
<openssh-configuration> accessors.

* gnu/services/ssh.scm (<openssh-configuration>): Rename
openssh-challenge-response-authentication? to
openssh-configuration-challenge-response-authentication?.  It's a mouthful,
but is at least consistent with the rest.
2023-05-17 21:45:08 -04:00
Maxim Cournoyer 760fadec15
services: openssh: Export openssh-configuration accessors.
* gnu/services/ssh.scm: Export openssh-configuration accessors.
2023-05-17 21:37:03 -04:00
Ludovic Courtès 134c10241a
services: shepherd: Default to 0.10.
* gnu/services/shepherd.scm (<shepherd-configuration>)[shepherd]:
Default to SHEPHERD-0.10.
* gnu/home/services/shepherd.scm (<home-shepherd-configuration>)[shepherd]:
Likewise.
2023-05-13 16:27:55 +02:00
Christopher Baines 9a6bbea9d4
services: nar-herder: Support extra environment vars.
* gnu/services/guix.scm (nar-herder-configuration-extra-environment-variables):
New procedure.
(nar-herder-shepherd-services): Pass the environment variables to the
shepherd.
* doc/guix.texi (Guix Services): Document it.
2023-05-13 11:26:37 +01:00