Commit Graph

93 Commits

Author SHA1 Message Date
Nicolas Graves e73db355b1
services: activation: Ensure /var/run existence.
* gnu/services.scm (activation-script): Ensure /var/run existence.
* gnu/build/install.scm (evaluate-populate-directive)
[directives]: Remove directory /var/run.

Change-Id: I5fb93d33b6b1f045f1e5ba206b9b0b74b5184260
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2024-02-19 18:41:47 +01:00
Janneke Nieuwenhuizen b0715d7cd2
gnu: Use ‘libc-utf8-locales-for-target’.
* guix/packages.scm (%standard-patch-inputs): Use
‘libc-utf8-locales-for-target’ instead of ‘glibc-utf8-locales’.
* guix/self.scm (%packages): Likewise.
* gnu/home/services/ssh.scm (file-join): Likewise
* gnu/installer.scm (build-compiled-file): Likewise.
* gnu/packages/chromium.scm (ungoogled-chromium/wayland): Likewise.
* gnu/packages/gnome.scm (libgweather4, tracker): Likewise.
* gnu/packages/javascript.scm (js-mathjax): Likewise.
* gnu/packages/package-management.scm (guix, flatpak): Likewise.
* gnu/packages/raspberry-pi.scm (raspi-arm64-chainloader): Likewise.
* gnu/packages/suckless.scm (svkbd): Likewise.
* gnu/services.scm (cleanup-gexp): Likewise.
* gnu/services/base.scm (guix-publish-shepherd-service): Likewise.
* gnu/services/guix.scm (guix-build-coordinator-shepherd-services)
(guix-build-coordinator-agent-shepherd-services): Likewise.
* gnu/services/guix.scm (guix-build-coordinator-queue-builds-shepherd-services):
(guix-data-service-shepherd-services)
(nar-herder-shepherd-services)
(bffe-shepherd-services): Likewise.
* gnu/services/web.scm (anonip-shepherd-service)
(mumi-shepherd-services): Likewise.
* gnu/system/image.scm (system-disk-image, system-iso9660-image)
(system-docker-image, system-tarball-image): Likewise.
* gnu/system/install.scm (%installation-services): Likewise.
* guix/profiles.scm (info-dir-file): Likewise.
(ca-certificate-bundle, profile-derivation): Likewise.
* guix/scripts/pack.scm (store-database, set-utf8-locale): Likewise.
* tests/pack.scm: Likewise.
* tests/profiles.scm ("profile-derivation, cross-compilation"):
Likewise.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
Co-authored-by: Christopher Baines <mail@cbaines.net>
Change-Id: I24239f427bcc930c29d2ba5d00dc615960a6c374
2023-12-02 12:25:45 +01:00
Brian Cully f66fa5f917
gnu: services: Revert to deleting and updating all matching services
This patch reverts the behavior introduced in
1819512073 which caused ‘modify-services’
clauses to only match a single instance of a service.

We will now match all service instances when doing a deletion or update, while
still raising an exception when trying to match against a service that does
not exist in the services list, or which was deleted explicitly by a ‘delete’
clause (or an update clause that returns ‘#f’ for the service).

Fixes: #64106

* gnu/services.scm (%modify-services): New procedure.
(modify-services): Use it.
(apply-clauses): Add DELETED-SERVICES argument, change to modify one service
at a time.
* tests/services.scm
("modify-services: delete then modify")
("modify-services: modify then delete")
("modify-services: delete multiple services of the same type")
("modify-services: modify multiple services of the same type"): New tests.

Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Modified-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
2023-08-31 23:31:50 -04:00
Ludovic Courtès dff7d2468f
services: Define 'for-home'.
* gnu/services.scm (remove-service-extensions): New procedure.
(for-home?): New syntax parameter.
(for-home): New macro.
2023-08-20 22:48:47 +02:00
Josselin Poiret 1a2eb26286
services: Check if service is #f before applying clause.
* gnu/services.scm (apply-clauses): Check if service is #f before trying to
apply clause.  Follow up of 1819512073.
2023-06-06 13:38:35 +02:00
Ludovic Courtès 1819512073
services: 'modify-services' preserves service ordering.
Fixes <https://issues.guix.gnu.org/63921>.

The regression was introduced in
dbbc7e9461, which changed the order of
services.  As a result, someone using 'modify-services' could find
themselves with incorrect ordering of expressions in the "boot" script,
whereby the cleanup expressions would come after (execl ".../shepherd").
This, in turn, would lead shepherd to error out at boot with EADDRINUSE
on /var/run/shepherd/socket.

* gnu/services.scm (%delete-service, %apply-clauses): Remove.
(clause-alist): New macro.
(apply-clauses): New procedure.
(modify-services): Use it.  Adjust docstring.
* tests/services.scm ("modify-services: do nothing"): Remove 'sort' call.
("modify-services: delete service"): Likewise, and add 't4' service.
("modify-services: change value"): Remove 'sort' call and fix expected value.
2023-06-06 11:54:39 +02:00
Brian Cully dbbc7e9461
services: Error in MODIFY-SERVICES when services don't exist
This patch causes MODIFY-SERVICES to raise an error if a reference is made to
a service which isn't in its service list. This it to help users notice if
they have an invalid rule, which is currently silently ignored.

* gnu/services.scm (%delete-service):  new procedure
(%apply-clauses): new syntax rule
(%modify-service): remove syntax rule

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2023-06-02 16:23:03 +02:00
Andrew Tropin 66ecffbeba
services: Add default values.
* gnu/services.scm (boot-service-type, activation-service-type,
etc-service-type, profile-service-type): Add default-value.
* gnu/system/shadow.scm (account-service-type): Add default-value.
2023-05-16 19:45:27 +04:00
Bruno Victal 93918c67c5
services: etc-service: Deprecate etc-service procedure.
* gnu/services.scm (etc-service): Deprecate procedure.
* gnu/system.scm (operating-system-etc-service): Replace etc-service
with etc-service-type.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2023-03-16 12:37:03 +01:00
Ludovic Courtès 9096bc28a3
services: provenance: Use 'current-channels' to obtain provenance data.
Previously, build-time metadata from (guix config) would be ignored when
available--e.g., when running /run/current-system/profile/bin/guix.

This is a followup to 316fc2acbb.

* gnu/services.scm (provenance-entry): Use 'current-channels' instead of
'current-profile' + 'profile-channels'.
2022-08-30 00:40:04 +02:00
Tobias Geerinckx-Rice 4cb6994790
gnu: services: Update setuid service description.
* gnu/services.scm (setuid-program-service-type)[description]:
Remove ‘root’, add ‘setgid’.
2022-05-29 02:00:19 +02:00
Ludovic Courtès 3948ac25b1
services: Make <service-type> 'description' field mandatory.
* gnu/services.scm (<service-type>)[description]: Remove default value.
* tests/services.scm: Add 'description' field to each 'service-type' form.
2022-05-18 22:29:54 +02:00
Ludovic Courtès 9a5d686923
services: Add more description fields.
* gnu/services.scm (simple-service): Add 'description' field.
* gnu/services/base.scm (udev-rules-service): Likewise.
* gnu/system/install.scm (configuration-template-service-type): Likewise.
* gnu/tests.scm (marionette-service-type): Likewise.
2022-05-18 22:29:54 +02:00
Ludovic Courtès 1b8f6a4cad
services: startup: Add description.
* gnu/services.scm (hurd-startup-service-type)[description]: New field.
2022-03-10 23:46:51 +01:00
Ludovic Courtès 61ad9bc2ad
services: Document the 'delete' clause of 'modify-services'.
* doc/guix.texi (Service Reference): Mention the 'delete' clause of
'modify-services'.
* gnu/services.scm (modify-services): Likewise in docstring.
2021-11-27 23:06:17 +01:00
Ludovic Courtès e0bd47b4fd
system: Handle 'setuid-programs' deprecation handling as a field sanitizer.
Previously, evaluating an OS configuration with a childhurd (for
instance) would produce tens of lines like:

  guix system: warning: representing setuid programs with '#<file-append #<package shadow@4.8.1 gnu/packages/admin.scm:798 7ff97f6f7640> "/bin/passwd">' is deprecated; use 'setuid-program' instead

Now, it prints this one line:

  gnu/system/hurd.scm:105:2: warning: representing setuid programs with file-like objects is deprecated; use 'setuid-program' instead

This change also means that extensions of 'setuid-program-service-type'
now have to provide a list of <setuid-program>, so it's stricter in this
sense.

* gnu/services.scm (setuid-program-file-like-deprecated): Remove.
(setuid-program-service-type)[extend]: Remove
'setuid-program-file-like-deprecated' call.  Assume CONFIG and
EXTENSIONS are already lists of <setuid-program> records.
* gnu/system.scm (<operating-system>)[setuid-programs]: Add 'sanitize'
property.  Change accessor name from '%operating-system-setuid-programs'
to 'operating-system-setuid-programs'.
(operating-system-default-essential-services)
(hurd-default-essential-services): Adjust accordingly.
(ensure-setuid-program-list): New macro.
(%ensure-setuid-program-list): New procedure, based on
'setuid-program-file-like-deprecated'.
2021-08-12 12:34:13 +02:00
Chris Lemmer-Webber a7ac19851b
services: setuid: More configurable setuid support.
New record <setuid-program> with fields for setting the specific user
and group, as well as specifically selecting the setuid and setgid bits,
for a program within the setuid-program-service.

* gnu/services.scm (setuid-program-file-like-deprecated): New function.
  (setuid-program-service-type): Make use of
  setuid-program->activation-gexp.  Adjust the extend property to handle
  <setuid-program>.
* gnu/build/activation.scm (activate-setuid-programs): Update to expect a
  <setuid-record> list for each program entry.
* gnu/system.scm: (operating-system-setuid-programs): Renamed to
  %operating-system-setuid-programs and replace it with new procedure.
  (operating-system-default-essential-services,
  hurd-default-essential-services): Replace
  operating-system-setuid-programs with
  %operating-system-setuid-programs.
* gnu/system/setuid.scm: New file.
* doc/guix.texi (Setuid Programs): Document <setuid-program>.

Co-authored-by: Brice Waegeneire <brice@waegenei.re>
2021-07-29 11:32:08 -04:00
raid5atemyhomework a3df382525
gnu: Allow services to install kernel-loadable modules.
* gnu/system.scm (operating-system-directory-base-entries): Remove code
to handle generation of "kernel" for linux-libre kernels.
(operating-system-default-essential-services): Instantiate
linux-builder-service-type.
(package-for-kernel): Move ...
* gnu/services.scm: ... to here.
(linux-builder-service-type): New variable.
(linux-builder-configuration): New type.
(linux-loadable-module-service-type): New variable.
* gnu/tests/linux-modules.scm (run-loadable-kernel-modules-test): Move
code to ...
(run-loadable-kernel-modules-test-base): ... new procedure here.
(run-loadable-kernel-modules-service-test): New procedure.
(%test-loadable-kernel-modules-service-0): New variable.
(%test-loadable-kernel-modules-service-1): New variable.
(%test-loadable-kernel-modules-service-2): New variable.
* doc/guix.texi: Document linux-loadable-module-service-type.

Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org>
2021-05-11 16:13:48 +02:00
Ricardo Wurmus a247f5c753
services: Support DELETE in MODIFY-SERVICES macro.
* gnu/services.scm (%modify-service): Add clause for DELETE syntax.
(modify-services): Use FILTER-MAP; adjust docstring.
* doc/guix.texi (System Services): Mention alternative syntax.
(X Window): Use MODIFY-SERVICES syntax.
2021-04-12 17:49:07 +02:00
Brice Waegeneire df138dc208
gnu: services: Add activate script to the profile system directory.
* gnu/services.scm (activation-profile-entry): New procedure...
(activation-service-type): ... use it.
2021-03-09 06:56:12 +01:00
Ludovic Courtès 07a33b1d21
services: profile: Create manifest at monadic-bind time.
Fixes <https://bugs.gnu.org/44952>.
Reported by Mathieu Othacehe <othacehe@gnu.org>.

* gnu/services.scm (packages->profile-entry): Change 'with-monad' to
'mlet' with one binding.
2020-12-01 00:10:48 +01:00
Ludovic Courtès 5dbfdf8be4
services: provenance: Wrap config file name in 'assume-valid-file-name'.
This gets rid of a pointless 'local-file' warning when running
'guix system reconfigure FILE' and FILE is a relative file name.

* gnu/services.scm (provenance-entry): Wrap CONFIG-FILE in
'assume-valid-file-name'.
2020-10-16 15:00:50 +02:00
Mathieu Othacehe dac7dd1b0b
Remove "guile-zlib" extension when unused.
This is a follow-up of 755f365b02.

As (zlib) is autoloaded in (gnu build linux-modules), "guile-zlib" is needed
as an extension only when it is effectively used.

* gnu/installer.scm (installer-program): Remove "guile-zlib" from the extensions.
* gnu/machine/ssh.scm (machine-check-initrd-modules): Ditto.
* gnu/services.scm (activation-script): Ditto.
* gnu/services/base.scm (default-serial-port): Ditto,
(agetty-shepherd-service): ditto,
(udev-service-type): ditto.
* gnu/system/image.scm (gcrypt-sqlite3&co): Ditto.
* gnu/system/shadow.scm (account-shepherd-service): Ditto.
2020-08-25 12:39:11 +02:00
Mathieu Othacehe 755f365b02
linux-libre: Support module compression.
This commit adds support for GZIP compression for linux-libre kernel
modules. The initrd modules are kept uncompressed as the initrd is already
compressed as a whole.

The linux-libre kernel also supports XZ compression, but as Guix does not have
any available bindings for now, and the compression time is far more
significant, GZIP seems to be a better option.

* gnu/build/linux-modules.scm (modinfo-section-contents): Use
'call-with-gzip-input-port' to read from a module file using '.gz' extension,
(strip-extension): new procedure,
(dot-ko): adapt to support compression,
(ensure-dot-ko): ditto,
(file-name->module-name): ditto,
(find-module-file): ditto,
(load-linux-module*): ditto,
(module-name->file-name/guess): ditto,
(module-name-lookup): ditto,
(write-module-name-database): ditto,
(write-module-alias-database): ditto,
(write-module-device-database): ditto.
* gnu/installer.scm (installer-program): Add "guile-zlib" to the extensions.
* gnu/machine/ssh.scm (machine-check-initrd-modules): Ditto.
* gnu/services.scm (activation-script): Ditto.
* gnu/services/base.scm (default-serial-port): Ditto,
(agetty-shepherd-service): ditto,
(udev-service-type): ditto.
* gnu/system/image.scm (gcrypt-sqlite3&co): Ditto.
* gnu/system/linux-initrd.scm (flat-linux-module-directory): Add "guile-zlib"
to the extensions and make sure that the initrd only contains
uncompressed module files.
* gnu/system/shadow.scm (account-shepherd-service): Add "guile-zlib" to the
extensions.
* guix/profiles.scm (linux-module-database): Ditto.
2020-08-25 11:53:20 +02:00
Ludovic Courtès a396dd01bc
machine: ssh: Check for potential system downgrades.
This is a followup to 8e31736b0a.

* guix/scripts/system/reconfigure.scm (check-forward-update): Add
 #:current-channels.  Use it instead of OLD.
* gnu/services.scm (sexp->system-provenance): New procedure.
(system-provenance): Use it.
* gnu/machine/ssh.scm (<machine-ssh-configuration>)[allow-downgrades?]:
New field.
(machine-check-forward-update): New procedure.
(check-deployment-sanity)[assertions]: Call it.
* doc/guix.texi (Invoking guix deploy): Document 'allow-downgrades?'
field.
2020-07-27 12:06:35 +02:00
Ludovic Courtès d51bfe242f
Use 'formatted-message' instead of '&message' where appropriate.
* gnu.scm (%try-use-modules): Use 'formatted-message' instead of
'&message'.
* gnu/machine/digital-ocean.scm (maybe-raise-unsupported-configuration-error):
Likewise.
* gnu/machine/ssh.scm (machine-check-file-system-availability): Likewise.
(machine-check-building-for-appropriate-system): Likewise.
(deploy-managed-host): Likewise.
(maybe-raise-unsupported-configuration-error): Likewise.
* gnu/packages.scm (search-patch): Likewise.
* gnu/services.scm (%service-with-default-value): Likewise.
(files->etc-directory): Likewise.
(fold-services): Likewise.
* gnu/system.scm (locale-name->definition*): Likewise.
* gnu/system/mapped-devices.scm (check-device-initrd-modules): Likewise.
(check-luks-device): Likewise.
* guix/channels.scm (latest-channel-instance): Likewise.
* guix/cve.scm (json->cve-items): Likewise.
* guix/git-authenticate.scm (commit-signing-key): Likewise.
(commit-authorized-keys): Likewise.
(authenticate-commit): Likewise.
(verify-introductory-commit): Likewise.
* guix/remote.scm (remote-pipe-for-gexp): Likewise.
* guix/scripts/graph.scm (assert-package): Likewise.
* guix/scripts/offload.scm (private-key-from-file*): Likewise.
* guix/ssh.scm (authenticate-server*): Likewise.
(open-ssh-session): Likewise.
(remote-inferior): Likewise.
* guix/ui.scm (matching-generations): Likewise.
* guix/upstream.scm (package-update): Likewise.
* tests/channels.scm ("latest-channel-instances, missing introduction for 'guix'"):
Catch 'formatted-message?'.
("authenticate-channel, wrong first commit signer"): Likewise.
* tests/lint.scm ("patches: not found"): Adjust message string.
* tests/packages.scm ("patch not found yields a run-time error"): Catch
'formatted-message?'.
* guix/lint.scm (check-patch-file-names): Handle 'formatted-message?'.
(check-derivation): Ditto.
2020-07-25 19:11:37 +02:00
Ludovic Courtès b91a73a6a4
services: Add 'system-provenance' procedure.
* gnu/services.scm (sexp->channel, system-provenance): New procedures.
* guix/scripts/system.scm (sexp->channel): Remove.
(display-system-generation): Use 'system-provenance' instead of parsing
the "provenance" file right here.
2020-07-15 01:36:24 +02:00
Ludovic Courtès eb5cf39e66
services: provenance: Save channel introductions.
* gnu/services.scm (channel->code): Include CHANNEL's introduction, if
any, unless CHANNEL is the singleton %DEFAULT-CHANNELS.
(channel->sexp): Add comment.
* guix/scripts/system.scm (sexp->channel): Change pattern to allow for
extensibility.
2020-07-01 23:34:51 +02:00
Jan (janneke) Nieuwenhuizen 68d8c09465
gnu: services: Add %hurd-startup-service.
This decouples startup of the Hurd from the "hurd" package, moving the RC
script into SYSTEM.

* gnu/packages/hurd.scm (hurd)[inputs]: Remove hurd-rc-script.
[arguments]: Do not substitute it.  Update "runsystem.sh" to parse kernel
arguments and exec into --system=SYSTEM/rc.
(hurd-rc-script): Move to...
* gnu/services.scm (%hurd-rc-file): ...this new variable.
(hurd-rc-entry): New procedure.
(%hurd-startup-service): Use it in new variable.
* gnu/system.scm (hurd-default-essential-services): Use it.
2020-06-08 14:26:14 +02:00
Jan (janneke) Nieuwenhuizen 59bcffa314
system: examples: Add bare-hurd.tmpl.
* gnu/system/hurd.scm (%hurd-def%hurd-default-operating-system-kernel,
%hurd-default-operating-system): New exported variables.
* gnu/system/examples/bare-hurd.tmpl: New file.
* Makefile.am (EXAMPLES): Add it.
* tests/guix-system.sh: Add --target=i586-pc-gnu when testing it.
2020-06-08 13:51:19 +02:00
Ludovic Courtès 0e5c2d5e14
services: system: Initial entries are non-monadic.
* gnu/system.scm (operating-system-directory-base-entries): Return a
regular, non-monadic value.
* gnu/services.scm (system-derivation): Adjust accordingly.
* gnu/system/linux-container.scm (container-essential-services): Likewise.
2020-04-26 22:49:49 +02:00
Ludovic Courtès 45bd91334f
services: profile: Use a declarative profile.
* gnu/services.scm (packages->profile-entry): Use 'profile' instead of
'profile-derivation'.
2020-04-26 22:49:48 +02:00
Ludovic Courtès a322e9d16b
services: etc: Detect and report duplicate entries.
Fixes <https://bugs.gnu.org/40729>.
Reported by Christopher Baines <mail@cbaines.net>.

* gnu/services.scm (files->etc-directory)[assert-no-duplicates]: New
procedure.
Use it.
2020-04-21 00:06:40 +02:00
Brice Waegeneire 8c88e24229
services: Allow modprobe to use "/etc/modprobe.d".
* gnu/services.scm (%modprobe-wrapper): Set 'MODPROBE_OPTIONS'
environment variable.

Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org>
2020-04-05 12:12:07 +02:00
Ludovic Courtès 223ede4e15
services: Accumulate builds for 'system' entries.
That way, more build requests are accumulated when running "guix system
build".

* gnu/services.scm (system-derivation): Use 'mapm/accumulate-builds'
rather than 'sequence'.
2020-04-02 11:48:24 +02:00
Ludovic Courtès 33b7cb7a59
services: Add 'provenance-service-type'.
* gnu/services.scm (object->pretty-string)
(channel->code, channel->sexp, provenance-file)
(provenance-entry): New procedures.
(provenance-service-type): New variable.
* gnu/system.scm (operating-system-with-provenance): New procedure.
* doc/guix.texi (Service Reference): Document 'provenance-service-type'.
2019-12-07 00:59:56 +01:00
Ludovic Courtès 2a4309de43
services: 'fold-services' memoizes service values.
Previously 'fold-services' could end up traversing the same services in
the graph several times, which is what this change addresses.

The hit rate on the 'add-data-to-store' cache goves from 9% to 8% on
"guix system build desktop.tmpl -nd", and the number of lookups in that
cache goes from 4458 to 4383.

* gnu/services.scm (fold-services): Turn 'loop' into a monadic procedure
in %STATE-MONAD and use it to memoize values of visited services.
2019-11-09 23:04:14 +01:00
Jakob L. Kreuze 03cbd94d48
remote: Remove '--system' argument.
* gnu/services.scm (activation-script): Return a <program-file> rather
than a <scheme-file>.
* gnu/deploy.scm (guix-deploy): Remove handling for '--system'.
(show-help): Remove documentation for '--system'.
(%default-options): Remove default setting for 'system'.
2019-08-14 15:38:13 -04:00
Ludovic Courtès dc5729a8e0
services: 'gc-root-service-type' now has a default value.
* gnu/services.scm (gc-root-service-type)[default-value]: New field.
2019-05-10 23:29:18 +02:00
Ludovic Courtès 9b6c435564
services: 'instantiate-missing-services' reaches fixed point.
Fixes a bug whereby services indirectly depended on would not be
automatically instantiated.

* gnu/services.scm (instantiate-missing-services): Loop back when the
length of ADJUSTED is greater than that of INSTANCES.
* tests/services.scm ("instantiate-missing-services, indirect"): New test.
2018-09-07 23:00:39 +02:00
Ludovic Courtès 378daa8cb6
services: boot: Take gexps instead of monadic gexps.
* gnu/services.scm (compute-boot-script): Rename 'mexps' to 'gexps' and
remove 'mlet' form.
(boot-service-type): Update comment.
(cleanup-gexp): Remove 'with-monad' and 'return'.
(activation-script): Rewrite in non-monadic style: use 'scheme-file'
instead of 'gexp->file'.
(gexps->activation-gexp): Remove 'mlet', return a gexp.
* gnu/services/shepherd.scm (shepherd-boot-gexp): Remove 'with-monad'
and 'return'.
* gnu/system.scm (operating-system-boot-script): Remove outdated comment.
* gnu/tests/base.scm (%cleanup-os): For 'dirty-service', remove
'with-monad' and 'return'.
2018-06-20 23:47:08 +02:00
Ludovic Courtès 636bb2b5e3
services: Add description to core services.
* gnu/services.scm (system-service-type, boot-service-type)
(cleanup-service-type, activation-service-type)
(special-files-service-type, etc-service-type)
(setuid-program-service-type, profile-service-type)
(firmware-service-type, gc-root-service-type): Add 'description' field.
2018-06-20 23:47:07 +02:00
Ludovic Courtès 76c321d8e8
services: cleanup: Expect file names to be UTF-8-encoded.
Fixes <https://bugs.gnu.org/26353>.
Reported by Danny Milosavljevic <dannym@scratchpost.org>.

* gnu/services.scm (cleanup-gexp): Add 'setenv' and 'setlocale' calls
before 'delete-file-recursively'.
* gnu/tests/base.scm (%cleanup-os, %test-cleanup): New variables.
(run-cleanup-test): New procedure.
2018-06-20 10:05:18 +02:00
Ludovic Courtès 661c237b4d
services: boot: Reverse the order of boot expressions.
* gnu/services.scm (compute-boot-script): Reverse MEXPS.
* gnu/system.scm (essential-services): Reverse order of
%SHEPHERD-ROOT-SERVICE, %ACTIVATION-SERVICE, and CLEANUP-SERVICE-TYPE.
2018-06-20 10:05:18 +02:00
Ludovic Courtès 3c0128b035
discovery: Remove dependency on (guix ui).
This reduces the closure of (guix discovery) from 28 to 8 modules.

* guix/discovery.scm (scheme-files): Use 'format' instead of 'warning'.
(scheme-modules): Add #:warn parameter.  Use it instead of
'warn-about-load-error'.
(fold-modules): Add #:warn and pass it to 'scheme-modules'.
(all-modules): Likewise.
* gnu/bootloader.scm (bootloader-modules): Pass #:warn to 'all-modules'.
* gnu/packages.scm (fold-packages): Likewise.
* gnu/services.scm (all-service-modules): Likewise.
* guix/upstream.scm (importer-modules): Likewise.
2018-04-08 17:48:33 +02:00
Chris Marusich 7874e9e047
gnu: Refactor boot-service-type and activation-service-type.
* gnu/services.scm (boot-service-type) <compose>: Use the "identity"
  procedure instead of the "append" procedure because it more accurately
  reflects the intent, which is to simply return the single list of
  extensions to which fold-services applies the "compose" procedure.
  (activation-service-type) <compose>: Likewise.
2018-03-29 08:38:49 +02:00
Ludovic Courtès d466b1fc82
services: Missing services are automatically instantiated.
This simplifies OS configuration: users no longer need to be aware of
what a given service depends on.

See the discussion at
<https://lists.gnu.org/archive/html/guix-devel/2018-01/msg00114.html>.

* gnu/services.scm (missing-target-error): New procedure.
(service-back-edges): Use it.
(instantiate-missing-services): New procedure.
* gnu/system.scm (operating-system-services): Call
'instantiate-missing-services'.
* tests/services.scm ("instantiate-missing-services")
("instantiate-missing-services, no default value"): New tests.
* gnu/services/version-control.scm (cgit-service-type)[extensions]: Add
FCGIWRAP-SERVICE-TYPE.
* gnu/tests/version-control.scm (%cgit-os): Remove NGINX-SERVICE-TYPE
and FCGIWRAP-SERVICE-TYPE instances.
* doc/guix.texi (Log Rotation): Remove 'mcron-service-type' in example.
(Miscellaneous Services): Remove 'nginx-service-type' and
'fcgiwrap-service-type' in Cgit example.
2018-01-21 00:24:03 +01:00
Danny Milosavljevic e25ca462e5
services: cleanup: Remove "/run/udev/watch.old" directory.
* gnu/services.scm (cleanup-gexp): Remove "/run/udev/watch.old" directory.
2017-12-17 08:32:37 +01:00
Ludovic Courtès 49483f7138
services: Add 'lookup-service-types'.
* gnu/services.scm (lookup-service-types): New procedure.
* tests/services.scm ("lookup-service-types"): New test.
2017-11-08 22:31:58 +01:00
Ludovic Courtès 3943913fac
services: 'fold-service-types' includes (gnu services).
* gnu/services.scm (all-service-modules): New procedure.
(fold-service-types): Use it for the default MODULES value.
2017-11-08 22:31:58 +01:00