Subject: bug#49549: closed (Re: bug#49419: [PATCH 0/4] Essential home services)

From: [email-masked] (GNU bug Tracking System)
Date: Tue, 24 Aug 2021 12:15:03 +0000

Your bug report

#49419: [PATCH v2 4/4] home-services: Add fold-home-service-types function

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
49419: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=49419
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#49419: [PATCH 0/4] Essential home services
From: Oleg Pykhalov <[email-masked]>
To: Andrew Tropin <[email-masked]>
Cc: [email-masked]
Date: Tue, 24 Aug 2021 15:14:25 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

Andrew Tropin <[email-masked]> writes:

[…]

>> As Ludovic suggested, we could move modules to another namespace for
>> code sharing, but it is not a blocker from merging changes and we could
>> do it later when we need to share the code.  I think we should go
>> forward and push to the master.  WDYT?
>
> Yep, let's postpone moving modules to another namespace until it will be
> needed. Later, when the necessity appears, we will decide how to better
> organize the code.
>
> We can push it to master, but I planned to keep it in wip-guix-home for
> a while to bring all related stuff like documentation and cli to the
> branch and merge it to the master after everything is complete.
>
> Also, merging only part of Guix Home to the master will arise conflicts
> for users of rde channel (which contains current implementation of Guix
> Home).  However, it is solvable by removing already merged parts from
> rde repository, so, it's not a big deal and I'm fine with both merging
> options.

OK, pushed to the wip-guix-home.

https://git.savannah.gnu.org/cgit/guix.git/?h=wip-guix-home

Subject: [PATCH v2 4/4] home-services: Add fold-home-service-types function
From: Andrew Tropin <[email-masked]>
To: [email-masked]
Date: Mon, 5 Jul 2021 18:41:45 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

* gnu/home-services.scm (parent-directory, %guix-home-root-directory,
%service-type-path, all-home-service-modules, fold-home-service-types): New
variables.
---
 gnu/home-services.scm | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/gnu/home-services.scm b/gnu/home-services.scm
index ffcee22bb8..78e5603edf 100644
--- a/gnu/home-services.scm
+++ b/gnu/home-services.scm
@@ -444,3 +444,29 @@ environment, and its configuration file, when available.")))
 
 (define sexp->home-provenance sexp->system-provenance)
 (define home-provenance system-provenance)
+
+
+;;;
+;;; Searching
+;;;
+
+(define (parent-directory directory)
+  "Get the parent directory of DIRECTORY"
+  (string-join (drop-right (string-split directory #\/) 1) "/"))
+
+(define %guix-home-root-directory
+  ;; Absolute file name of the module hierarchy.
+  (parent-directory (dirname (search-path %load-path "gnu/home-services.scm"))))
+
+(define %service-type-path
+  ;; Search path for service types.
+  (make-parameter `((,%guix-home-root-directory . "gnu/home-services"))))
+
+(define (all-home-service-modules)
+  "Return the default set of home-service modules."
+  (cons (resolve-interface '(gnu home-services))
+        (all-modules (%service-type-path)
+                     #:warn warn-about-load-error)))
+
+(define* (fold-home-service-types proc seed)
+  (fold-service-types proc seed (all-home-service-modules)))
-- 
2.32.0