GNU bug report logs - #49549
[PATCH v2 4/4] home-services: Add fold-home-service-types function

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix-patches; Reported by: Andrew Tropin <andrew@HIDDEN>; Keywords: patch; merged with #49419, #49546, #49547, #49548; dated Tue, 13 Jul 2021 18:19:03 UTC; Maintainer for guix-patches is guix-patches@HIDDEN.
Merged 49419 49546 49547 49548 49549. Request was from Andrew Tropin <andrew@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 13 Jul 2021 18:18:27 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jul 13 14:18:27 2021
Received: from localhost ([127.0.0.1]:41964 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1m3MzD-0000UK-8B
	for submit <at> debbugs.gnu.org; Tue, 13 Jul 2021 14:18:27 -0400
Received: from lists.gnu.org ([209.51.188.17]:40890)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <andrew@HIDDEN>) id 1m3MzA-0000U5-LA
 for submit <at> debbugs.gnu.org; Tue, 13 Jul 2021 14:18:24 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:36720)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <andrew@HIDDEN>) id 1m3MzA-0004OY-Fm
 for guix-patches@HIDDEN; Tue, 13 Jul 2021 14:18:24 -0400
Received: from mail-lj1-x22e.google.com ([2a00:1450:4864:20::22e]:41664)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <andrew@HIDDEN>) id 1m3Mz9-0007Ik-4W
 for guix-patches@HIDDEN; Tue, 13 Jul 2021 14:18:24 -0400
Received: by mail-lj1-x22e.google.com with SMTP id e20so31326261ljn.8
 for <guix-patches@HIDDEN>; Tue, 13 Jul 2021 11:18:22 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=trop-in.20150623.gappssmtp.com; s=20150623;
 h=from:to:subject:in-reply-to:date:message-id:mime-version;
 bh=yrAKTn9umLbx/fYv7ew4SyzS2m+ivTBR/NGZXsOMMRg=;
 b=vWxv2PrMkfPi8SzgAh3q979pD8VaJ0zvW+2iHrDiovUeuTYpayoiLvhZ86pkZuu0+8
 6uVAthw3U5+VEJ2UpasxIN0t3Pa/yiahnXH1eRDSBuSAFP+wtA5RCDV804n7tTEhqKKX
 KDiv7dyraguy2Q7Tr0nEon3bWhhqzeimbl3WAln+zHS/io2vghBs9IhhSOD26Q18s9OB
 ipYsKmxtchzXTz04s9W6x/6Tb+L/P7beHxDAuJWM84H8YLj2obdbNKpJPuYWXnNRnSQg
 IPKBB49crFdElskuvu4iwCL4n18bFSq1suvyfy8ad8/cidch1l+v095JrYscYPv5Vhpi
 Z6Cw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:subject:in-reply-to:date:message-id
 :mime-version;
 bh=yrAKTn9umLbx/fYv7ew4SyzS2m+ivTBR/NGZXsOMMRg=;
 b=X3jWPxgU7M+IoCgSGNjPGdc4cA0PAaWSFqu+0Bp03tpIG3+NfXif841Q5Dwa5iMlsf
 UUS1KZ1IaW2kCsckUB8jQfICn0el/OdQWpDn/ds01ZHj/q2Zub9p7uiANIY9mxoh/o6N
 hXuz7w5iG5yhfL3WAPU/dpa1rnSkjna6no67SMG1y9rcLv4Z37jC89d5r4hF0JnVTKyu
 VT38eRBVApa/ZoRD04Ez47gRfQQUdVa0l+84ta/EUgbCLETSuInq5/99+sAOD9V5RcQe
 JxdXXvlb8XkDFFnK7PZHpQook46ozyvpyRgbzhGe4ThcI9963n2YBo0wl5jpmFKRhnF+
 cpMg==
X-Gm-Message-State: AOAM5314i5pNpUDSSs1okyWEaV1Hh2SeWPkTeTtv+TS3pSaNoo9+dWOh
 leQGOpqeR3zGz3vCYapKkjOKAA2HjkDtKg==
X-Google-Smtp-Source: ABdhPJx9B0/fenFXkw54J6IAM8jhJXeuG7N+PAqmP05+nAHX0hFyp1U3WBTlsiDNVpWED+6a9VpECw==
X-Received: by 2002:a2e:9090:: with SMTP id l16mr3185209ljg.275.1626200301397; 
 Tue, 13 Jul 2021 11:18:21 -0700 (PDT)
Received: from localhost (109-252-93-92.nat.spd-mgts.ru. [109.252.93.92])
 by smtp.gmail.com with ESMTPSA id c9sm2001116ljb.22.2021.07.13.11.18.20
 for <guix-patches@HIDDEN>
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 13 Jul 2021 11:18:21 -0700 (PDT)
From: Andrew Tropin <andrew@HIDDEN>
To: guix-patches@HIDDEN
Subject: [PATCH v2 4/4] home-services: Add fold-home-service-types function
In-Reply-To: <87bl76m6b7.fsf@HIDDEN>
Date: Mon, 5 Jul 2021 18:41:45 +0300
Message-ID: <87y2aakrly.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
Received-SPF: none client-ip=2a00:1450:4864:20::22e;
 envelope-from=andrew@HIDDEN; helo=mail-lj1-x22e.google.com
X-Spam_score_int: 15
X-Spam_score: 1.5
X-Spam_bar: +
X-Spam_report: (1.5 / 5.0 requ) BAYES_00=-1.9, DATE_IN_PAST_96_XX=3.405,
 DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001,
 SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=no autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -0.2 (/)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.2 (-)


* 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





Acknowledgement sent to Andrew Tropin <andrew@HIDDEN>:
New bug report received and forwarded. Copy sent to guix-patches@HIDDEN. Full text available.
Report forwarded to guix-patches@HIDDEN:
bug#49549; Package guix-patches. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Tue, 13 Jul 2021 18:30:01 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.