[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
08/14: home-services: Add fold-home-service-types function.
From: |
guix-commits |
Subject: |
08/14: home-services: Add fold-home-service-types function. |
Date: |
Fri, 27 Aug 2021 15:08:30 -0400 (EDT) |
wigust pushed a commit to branch wip-guix-home
in repository guix.
commit 079f2784dbcb2ac03ba544697dbb503ad0b1a90d
Author: Andrew Tropin <andrew@trop.in>
AuthorDate: Thu Aug 5 08:47:40 2021 +0300
home-services: Add fold-home-service-types function.
* gnu/home-services.scm (parent-directory, %guix-home-root-directory,
%service-type-path, all-home-service-modules, fold-home-service-types): New
variables.
Signed-off-by: Oleg Pykhalov <go.wigust@gmail.com>
---
gnu/home-services.scm | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/gnu/home-services.scm b/gnu/home-services.scm
index d320d3a..16b9736 100644
--- a/gnu/home-services.scm
+++ b/gnu/home-services.scm
@@ -492,3 +492,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)))
- branch wip-guix-home created (now f82a0ac), guix-commits, 2021/08/27
- 03/14: gnu: emacs-org-appear: Update to 0.2.4., guix-commits, 2021/08/27
- 01/14: gnu: python-duniterpy: Update to 1.0.0., guix-commits, 2021/08/27
- 06/14: home-services: Add home-run-on-change-service-type., guix-commits, 2021/08/27
- 04/14: gnu: emacs-elfeed-score: Update to 0.8.4., guix-commits, 2021/08/27
- 08/14: home-services: Add fold-home-service-types function.,
guix-commits <=
- 10/14: home-services: Add fontutils., guix-commits, 2021/08/27
- 05/14: home-services: Add most essential home services., guix-commits, 2021/08/27
- 07/14: home-services: Add home-provenance-service-type., guix-commits, 2021/08/27
- 11/14: home-services: Add helper functions for service configurations., guix-commits, 2021/08/27
- 12/14: home-services: Add shells., guix-commits, 2021/08/27
- 13/14: home-services: Add xdg., guix-commits, 2021/08/27
- 02/14: ci: Add jobs history support., guix-commits, 2021/08/27
- 09/14: home-services: Add symlink-manager., guix-commits, 2021/08/27
- 14/14: home: Add home-environment., guix-commits, 2021/08/27