BBruno Victal wrote on 8 Jan 13:31 +0100
(name . bug-guix)(address . firstname.lastname@example.org)
The current situation with services in Guix is that service extensions do not care about dependencies.
This can result in cryptic errors as seen in .
In , the issue arises from using activation-service-type to create files/directories for services
when these should be either (1) shepherd one-shot services or moved into the 'start' procedure of the service.
'activation-service-type' should only be used for doing things "listed on its label", that is, performing
actions at boot-time or after a system reconfigure.
But both solutions (1) and (2) are still not enough as the directories themselves might not yet
be available and the services must be aware of this fact and wait for them to be ready. One example
would be a network dependent mount or a simple service that mounts a volume such as:
Toggle snippet (18 lines)
(simple-service 'mount-overlayfs shepherd-root-service-type
(list (shepherd-service (requirement '(foo-mount))
(documentation "Mount OverlayFS.")
(start (let ((util-linux (@ (gnu packages linux) util-linux)))
(system* #$(file-append util-linux "/bin/mount")
"-o" (string-append "noatime,nodev,noexec,ro,"
"none" "/media/foo" )))))))
This example also means that it's untenable to just look into the file-systems field entries and attempt
to intelligently discover which paths are required for the services and add them as dependencies (another hole to this idea
is that overlayfs and some fuse filesystems can mount over the same path).
I've proposed in  for the service procedure to accept optional arguments, these could be of interest in solving this problem.
Another place we should look at is how systemd manages its service dependencies, with the 'Wants', 'After', 'Before', 'RequiresMountsFor', etc. 
directives. These could potentially be implemented and used alongside .
Such changes might also imply that a UI change in herd is required to handle the structured information or to avoid cluttering it with too