[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
04/21: home-services: Add fold-home-service-types function.
From: |
guix-commits |
Subject: |
04/21: home-services: Add fold-home-service-types function. |
Date: |
Thu, 9 Sep 2021 13:33:34 -0400 (EDT) |
wigust pushed a commit to branch wip-guix-home
in repository guix.
commit 05093ffda2a6d07593958cb0dc8ea4406e52094c
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 6b5ff71), guix-commits, 2021/09/09
- 01/21: home-services: Add most essential home services., guix-commits, 2021/09/09
- 02/21: home-services: Add home-run-on-change-service-type., guix-commits, 2021/09/09
- 06/21: home-services: Add fontutils., guix-commits, 2021/09/09
- 04/21: home-services: Add fold-home-service-types function.,
guix-commits <=
- 14/21: gnu: home: Add doc comment about the module., guix-commits, 2021/09/09
- 17/21: scripts: home: Add import subcommand., guix-commits, 2021/09/09
- 07/21: home-services: Add helper functions for service configurations., guix-commits, 2021/09/09
- 16/21: scripts: Add 'guix home'., guix-commits, 2021/09/09
- 08/21: home-services: Add shells., guix-commits, 2021/09/09
- 19/21: home-services: run-on-change: Handle first generation case., guix-commits, 2021/09/09
- 13/21: home-services: activation: Add support for multiline env vars., guix-commits, 2021/09/09
- 05/21: home-services: Add symlink-manager., guix-commits, 2021/09/09
- 09/21: home-services: Add xdg., guix-commits, 2021/09/09
- 11/21: home-services: Add utils module., guix-commits, 2021/09/09