From patchwork Mon Jul 5 15:37:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Tropin X-Patchwork-Id: 31506 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id A99C627BC6B; Mon, 19 Jul 2021 18:16:31 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS, T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 8516127BC6B for ; Mon, 19 Jul 2021 18:16:30 +0100 (BST) Received: from localhost ([::1]:51854 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m5WsX-0000yT-Kx for patchwork@mira.cbaines.net; Mon, 19 Jul 2021 13:16:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42802) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m5WsC-0000FI-0J for guix-patches@gnu.org; Mon, 19 Jul 2021 13:16:09 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:48671) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m5Ws6-0004bC-6U for guix-patches@gnu.org; Mon, 19 Jul 2021 13:16:07 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m5Ws6-0000uo-2Y for guix-patches@gnu.org; Mon, 19 Jul 2021 13:16:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49419] [PATCH v3 1/4] home-services: Add most essential home services References: <87y2akhiz1.fsf@trop.in> Resent-From: Andrew Tropin Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 19 Jul 2021 17:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49419 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49419@debbugs.gnu.org Received: via spool by 49419-submit@debbugs.gnu.org id=B49419.16267149331648 (code B ref 49419); Mon, 19 Jul 2021 17:16:02 +0000 Received: (at 49419) by debbugs.gnu.org; 19 Jul 2021 17:15:33 +0000 Received: from localhost ([127.0.0.1]:60207 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m5Wrc-0000Pk-16 for submit@debbugs.gnu.org; Mon, 19 Jul 2021 13:15:32 -0400 Received: from mail-lf1-f46.google.com ([209.85.167.46]:35478) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m5Wra-0000Hk-5J for 49419@debbugs.gnu.org; Mon, 19 Jul 2021 13:15:31 -0400 Received: by mail-lf1-f46.google.com with SMTP id i5so31484648lfe.2 for <49419@debbugs.gnu.org>; Mon, 19 Jul 2021 10:15:30 -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=mGKammPXpQo7ZmQA4JaaWKm3bImCdj++E7lhep3Q1Zk=; b=y5QoMyr5diYodXu2q8Cw/Y+WZuJn9T75eE3En52oLPvNsR1wP8LhnitZrG70+mT2c6 LM8d8EpSqwtS4lgSV4RqP+qH37efTaEfI3wXcpHd2kV9vHyI9gpaaUA5m96BSdu9XaZl NItf8JnX8gqCh7S6yqEqScOTXL9OIo0spcGET+DH+UXL08wbDF9h4zodJ8XrlXhIW0kZ 9hWvU7BZgG8czKITRqH5L0vxPqx1DoVJVGc2nNZus3WyK4mJl09tg7RvH7XThz1k+90f xB6XhXQ8KNxMXmgcEFunGVdhgYk2X5GrDZCUw2uzTNOXE+KbVPLANPB8B5B2G8gC7N1Y TjLQ== 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=mGKammPXpQo7ZmQA4JaaWKm3bImCdj++E7lhep3Q1Zk=; b=ZbRaD24esdVm1E8csVwmZcKqmZ9/u6XEojWmd3XuwY1XOEoXnBjtzH5UjjtYn+bEDw Y3zDePG4vINJrXyqATcNngWwo1HcVQiDhGnHyqLBXWcvCYXIZFLqwKQHHJD9EFYvA8Rn SOzyhEB7fDkCSmkpR8Vgy3U7+LB0NQE2WhiCrySnXqY98lOrvVrSDI1GtXqTdXainZwS lrI7BoGkQneJ76wU72SjgZfN0BB0qi7wQsMnsTzsEmtpSarEPf9paVI64BXiY13xcMmQ Afr0Iv1yst+he+p2beijJv2l6I2OFM8bzumIoT3a/CRmZmAxsMpQD7XW3HeTIBLAJyTu vpjQ== X-Gm-Message-State: AOAM530WnRVWuJpqRweuRNPxIoID7YS+AUynB9Y5l5FRHLuF5rXRJmjb 2Odb0lHbT8ypNfUtHlXb//MsILq5borLmA== X-Google-Smtp-Source: ABdhPJyqQuop3rDZ+RzazCQDc67a7qXEbVGwhUi7LVoTudAFdrKKgdZrZZzVP3+flIE0ANZfOtRY9A== X-Received: by 2002:a05:6512:1517:: with SMTP id bq23mr6342528lfb.48.1626714923963; Mon, 19 Jul 2021 10:15:23 -0700 (PDT) Received: from localhost ([85.249.24.60]) by smtp.gmail.com with ESMTPSA id s14sm2166019ljj.88.2021.07.19.10.15.22 for <49419@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Jul 2021 10:15:23 -0700 (PDT) From: Andrew Tropin In-Reply-To: <87v956g1g5.fsf@trop.in> Date: Mon, 5 Jul 2021 18:37:13 +0300 Message-ID: <87tukqg1am.fsf@trop.in> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches home-service-type is a root of home services DAG. home-profile-service-type is almost the same as profile-service-type, at least for now. home-environment-variables-service-type generates a @file{setup-environment} shell script, which is expected to be sourced by login shell or other program, which starts early and spawns all other processes. Home services for shells automatically add code for sourcing this file, if person do not use those home services they have to source this script manually in their's shell *profile file (details described in the manual). home-files-service-type is similar to etc-service-type, but doesn't extend home-activation, because deploy mechanism for config files is pluggable and can be different for different home environments: The default one is called symlink-manager (will be introudced in a separate patch series), which creates links for various dotfiles (like $XDG_CONFIG_HOME/$APP/...) to store, but is possible to implement alternative approaches like read-only home from Julien's guix-home-manager. home-run-on-first-login-service-type provides an @file{on-first-login} guile script, which runs provided gexps once, when user makes first login. It can be used to start user's Shepherd and maybe some other process. It relies on assumption that /run/user/$UID will be created on login by some login manager (elogind for example). home-activation-service-type provides an @file{activate} guile script, which do three main things: - Sets environment variables to the values declared in @file{setup-environment} shell script. It's necessary, because user can set for example XDG_CONFIG_HOME and it should be respected by activation gexp of symlink-manager. - Sets GUIX_NEW_HOME and possibly GUIX_OLD_HOME vars to paths in the store. Later those variables can be used by activation gexps, for example by symlink-manager or run-on-change services. - Run all activation gexps provided by other home services. --- gnu/home-services.scm | 328 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 328 insertions(+) create mode 100644 gnu/home-services.scm diff --git a/gnu/home-services.scm b/gnu/home-services.scm new file mode 100644 index 0000000000..a89a061a81 --- /dev/null +++ b/gnu/home-services.scm @@ -0,0 +1,328 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2021 Andrew Tropin +;;; Copyright © 2021 Xinglu Chen +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu home-services) + #:use-module (gnu services) + #:use-module (guix channels) + #:use-module (guix monads) + #:use-module (guix store) + #:use-module (guix gexp) + #:use-module (guix profiles) + #:use-module (guix sets) + #:use-module (guix ui) + #:use-module (guix discovery) + #:use-module (guix diagnostics) + + #:use-module (srfi srfi-1) + #:use-module (ice-9 match) + + #:export (home-service-type + home-profile-service-type + home-environment-variables-service-type + home-files-service-type + home-run-on-first-login-service-type + home-activation-service-type) + + #:re-export (service + service-type + service-extension)) + +;;; Comment: +;;; +;;; This module is similar to (gnu system services) module, but +;;; provides Home Services, which are supposed to be used for building +;;; home-environment. +;;; +;;; Home Services use the same extension as System Services. Consult +;;; (gnu system services) module or manual for more information. +;;; +;;; Code: + + +(define (home-derivation entries mextensions) + "Return as a monadic value the derivation of the 'home' +directory containing the given entries." + (mlet %store-monad ((extensions (mapm/accumulate-builds identity + mextensions))) + (lower-object + (file-union "home" (append entries (concatenate extensions)))))) + +(define home-service-type + ;; This is the ultimate service type, the root of the home service + ;; DAG. The service of this type is extended by monadic name/item + ;; pairs. These items end up in the "home-environment directory" as + ;; returned by 'home-environment-derivation'. + (service-type (name 'home) + (extensions '()) + (compose identity) + (extend home-derivation) + (default-value '()) + (description + "Build the home environment top-level directory, +which in turn refers to everything the home environment needs: its +packages, configuration files, activation script, and so on."))) + +(define (packages->profile-entry packages) + "Return a system entry for the profile containing PACKAGES." + ;; XXX: 'mlet' is needed here for one reason: to get the proper + ;; '%current-target' and '%current-target-system' bindings when + ;; 'packages->manifest' is called, and thus when the 'package-inputs' + ;; etc. procedures are called on PACKAGES. That way, conditionals in those + ;; inputs see the "correct" value of these two parameters. See + ;; . + (mlet %store-monad ((_ (current-target-system))) + (return `(("profile" ,(profile + (content (packages->manifest + (map identity + ;;(options->transformation transformations) + (delete-duplicates packages eq?)))))))))) + +;; MAYBE: Add a list of transformations for packages. It's better to +;; place it in home-profile-service-type to affect all profile +;; packages and prevent conflicts, when other packages relies on +;; non-transformed version of package. +(define home-profile-service-type + (service-type (name 'home-profile) + (extensions + (list (service-extension home-service-type + packages->profile-entry))) + (compose concatenate) + (extend append) + (description + "This is the @dfn{home profile} and can be found in +@file{~/.guix-home/profile}. It contains packages and +configuration files that the user has declared in their +@code{home-environment} record."))) + +(define (environment-variables->setup-environment-script vars) + "Return a file that can be sourced by a POSIX compliant shell which +initializes the environment. The file will source the home +environment profile, set some default environment variables, and set +environment variables provided in @code{vars}. @code{vars} is a list +of pairs (@code{(key . value)}), @code{key} is a string and +@code{value} is a string or gexp. + +If value is @code{#f} variable will be omitted. +If value is @code{#t} variable will be just exported. +For any other, value variable will be set to the @code{value} and +exported." + (define (warn-about-duplicate-defenitions) + (fold + (lambda (x acc) + (when (equal? (car x) (car acc)) + (warning + (G_ "duplicate definition for `~a' environment variable ~%") (car x))) + x) + (cons "" "") + (sort vars (lambda (a b) + (stringsetup-environment-script))) + (compose concatenate) + (extend append) + (default-value '()) + (description "Set the environment variables."))) + +(define (files->files-directory files) + "Return a @code{files} directory that contains FILES." + (define (assert-no-duplicates files) + (let loop ((files files) + (seen (set))) + (match files + (() #t) + (((file _) rest ...) + (when (set-contains? seen file) + (raise (formatted-message (G_ "duplicate '~a' entry for files/") + file))) + (loop rest (set-insert file seen)))))) + + ;; Detect duplicates early instead of letting them through, eventually + ;; leading to a build failure of "files.drv". + (assert-no-duplicates files) + + (file-union "files" files)) + +(define (files-entry files) + "Return an entry for the @file{~/.guix-home/files} +directory containing FILES." + (with-monad %store-monad + (return `(("files" ,(files->files-directory files)))))) + +(define home-files-service-type + (service-type (name 'home-files) + (extensions + (list (service-extension home-service-type + files-entry))) + (compose concatenate) + (extend append) + (default-value '()) + (description "Configuration files for programs that +will be put in @file{~/.guix-home/files}."))) + +(define (compute-on-first-login-script _ gexps) + (gexp->script + "on-first-login" + #~(let* ((xdg-runtime-dir (or (getenv "XDG_RUNTIME_DIR") + (format #f "/run/user/~a" (getuid)))) + (flag-file-path (string-append + xdg-runtime-dir "/on-first-login-executed")) + (touch (lambda (file-name) + (call-with-output-file file-name (const #t))))) + ;; XDG_RUNTIME_DIR dissapears on logout, that means such trick + ;; allows to launch on-first-login script on first login only + ;; after complete logout/reboot. + (when (not (file-exists? flag-file-path)) + (begin #$@gexps (touch flag-file-path)))))) + +(define (on-first-login-script-entry m-on-first-login) + "Return, as a monadic value, an entry for the on-first-login script +in the home environment directory." + (mlet %store-monad ((on-first-login m-on-first-login)) + (return `(("on-first-login" ,on-first-login))))) + +(define home-run-on-first-login-service-type + (service-type (name 'home-run-on-first-login) + (extensions + (list (service-extension + home-service-type + on-first-login-script-entry))) + (compose identity) + (extend compute-on-first-login-script) + (default-value #f) + (description "Run gexps on first user login. Can be +extended with one gexp."))) + + +(define (compute-activation-script init-gexp gexps) + (gexp->script + "activate" + #~(let* ((he-init-file (lambda (he) (string-append he "/setup-environment"))) + (he-path (string-append (getenv "HOME") "/.guix-home")) + (new-home-env (getenv "GUIX_NEW_HOME")) + (new-home (or new-home-env + ;; Path of the activation file if called interactively + (dirname (car (command-line))))) + (old-home-env (getenv "GUIX_OLD_HOME")) + (old-home (or old-home-env + (if (file-exists? (he-init-file he-path)) + (readlink he-path) + #f)))) + (if (file-exists? (he-init-file new-home)) + (let* ((port ((@ (ice-9 popen) open-input-pipe) + (format #f "source ~a && env" + (he-init-file new-home)))) + (result ((@ (ice-9 rdelim) read-delimited) "" port)) + (vars (map (lambda (x) + (let ((si (string-index x #\=))) + (cons (string-take x si) + (string-drop x (1+ si))))) + ((@ (srfi srfi-1) remove) + string-null? + (string-split result #\newline))))) + (close-port port) + (map (lambda (x) (setenv (car x) (cdr x))) vars) + + (setenv "GUIX_NEW_HOME" new-home) + (setenv "GUIX_OLD_HOME" old-home) + + #$@gexps + + ;; Do not unset env variable if it was set outside. + (unless new-home-env (setenv "GUIX_NEW_HOME" #f)) + (unless old-home-env (setenv "GUIX_OLD_HOME" #f))) + (format #t "\ +Activation script was either called or loaded by file from this direcotry: +~a +It doesn't seem that home environment is somewhere around. +Make sure that you call ./activate by symlink from -home store item.\n" + new-home))))) + +(define (activation-script-entry m-activation) + "Return, as a monadic value, an entry for the activation script +in the home environment directory." + (mlet %store-monad ((activation m-activation)) + (return `(("activate" ,activation))))) + +(define home-activation-service-type + (service-type (name 'home-activation) + (extensions + (list (service-extension + home-service-type + activation-script-entry))) + (compose identity) + (extend compute-activation-script) + (default-value #f) + (description "Run gexps to activate the current +generation of home environment and update the state of the home +directory. @command{activate} script automatically called during +reconfiguration or generation switching. This service can be extended +with one gexp, but many times, and all gexps must be idempotent."))) + From patchwork Mon Jul 5 15:39:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Tropin X-Patchwork-Id: 31507 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 1783027BC78; Mon, 19 Jul 2021 18:17:11 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS, T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 9110F27BC6B for ; Mon, 19 Jul 2021 18:17:10 +0100 (BST) Received: from localhost ([::1]:53164 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m5WtB-0001qT-Jp for patchwork@mira.cbaines.net; Mon, 19 Jul 2021 13:17:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42806) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m5WsC-0000FK-0t for guix-patches@gnu.org; Mon, 19 Jul 2021 13:16:09 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:48672) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m5Ws6-0004bD-NQ for guix-patches@gnu.org; Mon, 19 Jul 2021 13:16:07 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m5Ws6-0000vO-GQ for guix-patches@gnu.org; Mon, 19 Jul 2021 13:16:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49419] [PATCH v3 2/4] home-services: Add home-run-on-change-service-type References: <87y2akhiz1.fsf@trop.in> Resent-From: Andrew Tropin Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 19 Jul 2021 17:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49419 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49419@debbugs.gnu.org Received: via spool by 49419-submit@debbugs.gnu.org id=B49419.16267149371936 (code B ref 49419); Mon, 19 Jul 2021 17:16:02 +0000 Received: (at 49419) by debbugs.gnu.org; 19 Jul 2021 17:15:37 +0000 Received: from localhost ([127.0.0.1]:60210 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m5Wrh-0000Ud-0M for submit@debbugs.gnu.org; Mon, 19 Jul 2021 13:15:37 -0400 Received: from mail-lf1-f51.google.com ([209.85.167.51]:45719) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m5Wre-0000Mo-S1 for 49419@debbugs.gnu.org; Mon, 19 Jul 2021 13:15:35 -0400 Received: by mail-lf1-f51.google.com with SMTP id s13so9973956lfi.12 for <49419@debbugs.gnu.org>; Mon, 19 Jul 2021 10:15:34 -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=4T1NvBI/PBjgT7dYtoDFyHLWKROkJqiISaqS3KrtH4M=; b=byObvKyvh7JyRQIf7jIgzzgCkdixnJuN8fgL960XfnKaKwwqiz/x2BAjEUVh4/7Dad 6FEqotJBJa+uTEatR46eVhhNkS5eEKGbxJCD88iWLH45jNx0GKMzisJZE6YO4FF7/CqH Yr8uR/ivaEd3fhbDjqxr5qSYoXuvX+/k4F696APGrICzdPCERwTh4oL2BXQ427fhjiuH Val6Vc2W3V/YCuZuERFhBg1U1Ea0UkYn8eyMRKiRsH+VZjBnkWxl6ovPrAlC+zJTguqM TTB2h18l59MFOMOem4RmeuY7dXRadQ0AhTZLWy6yj17OugxBenQOo9HtLLTvpfvIObhE r8/g== 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=4T1NvBI/PBjgT7dYtoDFyHLWKROkJqiISaqS3KrtH4M=; b=iu8MEYcqaE8N0bn8EmWAWnZyVeETLi/Q3/2+ULRN0/97bgwdRCKUCXk9nnd/EEGftf 20fKl8dlV0C0YMAlKbNUFQtdUv0xbAP3piEs0yc8OVyMFkYR6s3rwVMxH3W9LTdPe2Y3 sRi4KEqRlZ73z8eHf+V73bGYz3WI4s7Jh3xEo20bO8Di1etNYjaBPxVgROWGzrBsqO8s ETyWzfmZ/S8AoFz+N779Z3H2nZfeH6TbGc6FGERx2rjFZmBR5e+nxpz4L1qcE1521XyL etaLaAII7dSL6O7Mw694zncaiRRNC/A07nO+4gKr/8mPSNjMmxnI80JsS1qYIxUpADer mEDA== X-Gm-Message-State: AOAM531hyhH1XpGAoJ3Pp6cohcZT/Nxkj5oUK4N8RC/6C8EtmhCB4Jli sUQKKAbH60aaB2yQenHOKa2vgfGHBguD9g== X-Google-Smtp-Source: ABdhPJwpPVOQc5sovcU4Xyma7Rq5M1me3at9F/mwKO2OEQckIQcDqvzYamGDoYbzhfkThjt1jwPmoA== X-Received: by 2002:ac2:4187:: with SMTP id z7mr18572970lfh.574.1626714928816; Mon, 19 Jul 2021 10:15:28 -0700 (PDT) Received: from localhost ([85.249.24.60]) by smtp.gmail.com with ESMTPSA id x19sm1331004lfd.275.2021.07.19.10.15.27 for <49419@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Jul 2021 10:15:28 -0700 (PDT) From: Andrew Tropin In-Reply-To: <87v956g1g5.fsf@trop.in> Date: Mon, 5 Jul 2021 18:39:44 +0300 Message-ID: <87sg0ag19m.fsf@trop.in> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches Service allows to trigger actions during activation if file or directory specified by pattern is changed. --- gnu/home-services.scm | 100 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 99 insertions(+), 1 deletion(-) diff --git a/gnu/home-services.scm b/gnu/home-services.scm index a89a061a81..bcb6dd80df 100644 --- a/gnu/home-services.scm +++ b/gnu/home-services.scm @@ -37,7 +37,8 @@ home-environment-variables-service-type home-files-service-type home-run-on-first-login-service-type - home-activation-service-type) + home-activation-service-type + home-run-on-change-service-type) #:re-export (service service-type @@ -326,3 +327,100 @@ directory. @command{activate} script automatically called during reconfiguration or generation switching. This service can be extended with one gexp, but many times, and all gexps must be idempotent."))) + +;;; +;;; On-change. +;;; + +(define (compute-on-change-gexp eval-gexps? pattern-gexp-tuples) + #~(begin + (define (equal-regulars? file1 file2) + "Check if FILE1 and FILE2 are bit for bit identical." + (let* ((cmp-binary #$(file-append + (@ (gnu packages base) diffutils) "/bin/cmp")) + (stats1 (lstat file1)) + (stats2 (lstat file2))) + (cond + ((= (stat:ino stats1) (stat:ino stats2)) #t) + ((not (= (stat:size stats1) (stat:size stats2))) #f) + + (else (= (system* cmp-binary file1 file2) 0))))) + + (define (equal-symlinks? symlink1 symlink2) + "Check if SYMLINK1 and SYMLINK2 are pointing to the same target." + (string=? (readlink symlink1) (readlink symlink2))) + + (define (equal-directories? dir1 dir2) + "Check if DIR1 and DIR2 have the same content." + (define (ordinary-file file) + (not (or (string=? file ".") + (string=? file "..")))) + (let* ((files1 (scandir dir1 ordinary-file)) + (files2 (scandir dir2 ordinary-file))) + (if (equal? files1 files2) + (map (lambda (file) + (equal-files? + (string-append dir1 "/" file) + (string-append dir2 "/" file))) + files1) + #f))) + + (define (equal-files? file1 file2) + "Compares files, symlinks or directories of the same type." + (case (file-type file1) + ((directory) (equal-directories? file1 file2)) + ((symlink) (equal-symlinks? file1 file2)) + ((regular) (equal-regulars? file1 file2)) + (else + (display "The file type is unsupported by on-change service.\n") + #f))) + + (define (file-type file) + (stat:type (lstat file))) + + (define (something-changed? file1 file2) + (cond + ((and (not (file-exists? file1)) + (not (file-exists? file2))) #f) + ((or (not (file-exists? file1)) + (not (file-exists? file2))) #t) + + ((not (eq? (file-type file1) (file-type file2))) #t) + + (else + (not (equal-files? file1 file2))))) + + (define expressions-to-eval + (map + (lambda (x) + (let* ((file1 (string-append (getenv "GUIX_OLD_HOME") "/" (car x))) + (file2 (string-append (getenv "GUIX_NEW_HOME") "/" (car x))) + (_ (format #t "Comparing ~a and\n~10t~a..." file1 file2)) + (any-changes? (something-changed? file1 file2)) + (_ (format #t " done (~a)\n" + (if any-changes? "changed" "same")))) + (if any-changes? (cadr x) ""))) + '#$pattern-gexp-tuples)) + + (if #$eval-gexps? + (begin + (display "Evaling on-change gexps.\n\n") + (for-each primitive-eval expressions-to-eval) + (display "On-change gexps evaluation finished.\n\n")) + (display "\ +On-change gexps won't evaluated, disabled by service configuration.\n")))) + +(define home-run-on-change-service-type + (service-type (name 'home-run-on-change) + (extensions + (list (service-extension + home-activation-service-type + identity))) + (compose concatenate) + (extend compute-on-change-gexp) + (default-value #t) + (description "\ +G-expressions to run if the specified files have changed since the +last generation. The extension should be a list of lists where the +first element is the pattern for file or directory that expected to be +changed, and the second element is the G-expression to be evaluated."))) From patchwork Mon Jul 5 15:41:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Tropin X-Patchwork-Id: 31505 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 5B2DA27BC78; Mon, 19 Jul 2021 18:16:23 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS, T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 23F5327BC6B for ; Mon, 19 Jul 2021 18:16:23 +0100 (BST) Received: from localhost ([::1]:51316 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m5WsQ-0000c2-6d for patchwork@mira.cbaines.net; Mon, 19 Jul 2021 13:16:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42808) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m5WsC-0000FL-0K for guix-patches@gnu.org; Mon, 19 Jul 2021 13:16:09 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:48673) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m5Ws7-0004bG-4v for guix-patches@gnu.org; Mon, 19 Jul 2021 13:16:07 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m5Ws7-0000w1-15 for guix-patches@gnu.org; Mon, 19 Jul 2021 13:16:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49419] [PATCH v3 3/4] home-services: Add home-provenance-service-type References: <87y2akhiz1.fsf@trop.in> Resent-From: Andrew Tropin Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 19 Jul 2021 17:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49419 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49419@debbugs.gnu.org Received: via spool by 49419-submit@debbugs.gnu.org id=B49419.16267149412246 (code B ref 49419); Mon, 19 Jul 2021 17:16:02 +0000 Received: (at 49419) by debbugs.gnu.org; 19 Jul 2021 17:15:41 +0000 Received: from localhost ([127.0.0.1]:60213 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m5Wrl-0000Zp-FJ for submit@debbugs.gnu.org; Mon, 19 Jul 2021 13:15:41 -0400 Received: from mail-lj1-f174.google.com ([209.85.208.174]:33589) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m5Wrj-0000S1-IC for 49419@debbugs.gnu.org; Mon, 19 Jul 2021 13:15:39 -0400 Received: by mail-lj1-f174.google.com with SMTP id u14so27428649ljh.0 for <49419@debbugs.gnu.org>; Mon, 19 Jul 2021 10:15:39 -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=a/lytMsQTL/htua872I/xvcPbS8lCGq8gJM10eGky7s=; b=T82znJX8JdtklC7TfbGZ2Zy2j87YQqaih6YsZydELQ4uLG3z01jT6zFTTFywNnTesL S8CxKNpL4+0uvR9BkWIUj/McLJR0UDC3bbeC4K/K5AYPYURzkPTwcZXBW7mD+PHPBiBs AdPMnEpZQHvc8WT4ELlC2JEeN/eRLEoN+puJnHbJduFgpvGrXq3px8LTTfbR5jtn2pfV IuDD7hJfb43gFiplwMKh0tsvd/m7AcSxWogeuE0yAug/R9e9LSmz7t062cOhm+B8gCFv eE3kiPCV4ohkqqLR2FXWBPwmwqSmlGosFNCCIa1RxsTBNP3GAPWhQjc7ZJemHPSC4e5O PKsw== 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=a/lytMsQTL/htua872I/xvcPbS8lCGq8gJM10eGky7s=; b=aMvGxuOJVmEgAJHvEZLz1gX5JSLc5HVphmPX2NZOKSvC9VNRSomUOya5GloloAN8Zh JNkhPuhRgyE9upSrWBLWknyEoq80znS05Em00SJSQfrokIjzhXCz3w0YjVpK19WtBy+O pLAl4ESvY33jfDFVlPiOVlrkJ+ZV8Fr4Qc37teNj+4fyKOsePkpTD7QwEuHikJGR4wgI aHiXJ7AHi86zvSbZdBIkhs/vHA9oRcCpnV/AwOQCer2tJYIxMIBqm3OriKczhiAwPtlj takywOkRZxFnptTGGErezGf5n2H3fJIpOjU7cvWYTb+HkvpZzmJ4GgZZmLsyysqMquyL CyeA== X-Gm-Message-State: AOAM5322dowmOoPzBxtjs1GfQ4l93tOjGLffib8BJFowSwmpB1X0utWM 3Y1wUiospkf+3Usu3fK1qNRCFaSgHggdJQ== X-Google-Smtp-Source: ABdhPJzunp2iNMuxxslQkuLfknJatkrIexBf53E+zbv7usaQJGdwwzpekouBWATJS4OD+yhujGUvgw== X-Received: by 2002:a2e:9a8e:: with SMTP id p14mr12927665lji.69.1626714933401; Mon, 19 Jul 2021 10:15:33 -0700 (PDT) Received: from localhost ([85.249.24.60]) by smtp.gmail.com with ESMTPSA id p13sm1337910lfr.7.2021.07.19.10.15.32 for <49419@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Jul 2021 10:15:32 -0700 (PDT) From: Andrew Tropin In-Reply-To: <87v956g1g5.fsf@trop.in> Date: Mon, 5 Jul 2021 18:41:07 +0300 Message-ID: <87r1fug18l.fsf@trop.in> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/home-services.scm (home-provenance-service-type, sexp->home-provenance, home-provenance): New variables. --- gnu/home-services.scm | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/gnu/home-services.scm b/gnu/home-services.scm index bcb6dd80df..8aa9adeaaf 100644 --- a/gnu/home-services.scm +++ b/gnu/home-services.scm @@ -38,7 +38,10 @@ home-files-service-type home-run-on-first-login-service-type home-activation-service-type - home-run-on-change-service-type) + home-run-on-change-service-type + home-provenance-service-type + + fold-home-service-types) #:re-export (service service-type @@ -424,3 +427,25 @@ G-expressions to run if the specified files have changed since the last generation. The extension should be a list of lists where the first element is the pattern for file or directory that expected to be changed, and the second element is the G-expression to be evaluated."))) + + +;;; +;;; Provenance tracking. +;;; + +(define home-provenance-service-type + (service-type + (name 'home-provenance) + (extensions + (list (service-extension + home-service-type + (service-extension-compute + (first (service-type-extensions provenance-service-type)))))) + (default-value #f) ;the HE config file + (description "\ +Store provenance information about the home environment in the home +environment itself: the channels used when building the home +environment, and its configuration file, when available."))) + +(define sexp->home-provenance sexp->system-provenance) +(define home-provenance system-provenance) From patchwork Mon Jul 5 15:41:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Tropin X-Patchwork-Id: 31504 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 96D7627BC78; Mon, 19 Jul 2021 18:16:18 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS, T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 65F0227BC6B for ; Mon, 19 Jul 2021 18:16:18 +0100 (BST) Received: from localhost ([::1]:50920 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m5WsL-0000Id-E8 for patchwork@mira.cbaines.net; Mon, 19 Jul 2021 13:16:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42804) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m5WsC-0000FJ-0i for guix-patches@gnu.org; Mon, 19 Jul 2021 13:16:09 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:48674) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m5Ws7-0004be-HY for guix-patches@gnu.org; Mon, 19 Jul 2021 13:16:07 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m5Ws7-0000wb-EG for guix-patches@gnu.org; Mon, 19 Jul 2021 13:16:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49419] [PATCH v3 4/4] home-services: Add fold-home-service-types function References: <87y2akhiz1.fsf@trop.in> Resent-From: Andrew Tropin Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 19 Jul 2021 17:16:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49419 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49419@debbugs.gnu.org Received: via spool by 49419-submit@debbugs.gnu.org id=B49419.16267149472601 (code B ref 49419); Mon, 19 Jul 2021 17:16:03 +0000 Received: (at 49419) by debbugs.gnu.org; 19 Jul 2021 17:15:47 +0000 Received: from localhost ([127.0.0.1]:60216 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m5Wrq-0000fb-PA for submit@debbugs.gnu.org; Mon, 19 Jul 2021 13:15:47 -0400 Received: from mail-lj1-f179.google.com ([209.85.208.179]:34735) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m5Wro-0000XA-M0 for 49419@debbugs.gnu.org; Mon, 19 Jul 2021 13:15:45 -0400 Received: by mail-lj1-f179.google.com with SMTP id y7so26961257ljm.1 for <49419@debbugs.gnu.org>; Mon, 19 Jul 2021 10:15:44 -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=E1FcXcmKek67yaPkdPAw2a7MKWy1GQT4CM0PuDuKADY=; b=dmZAXJBrYH8bT0hbf87mCXq4XWeKleg7otUefIXTEgomEZqg0aO9cIiJkc4UpyRtOU Z6fJgSp/mX2Qgo9TVpIDgIfBCfd5CWLWLg0a6Yg5VOVspxnjLBJ6otYuYic//MfA7UUD NWae1Zk5A+ZhKssG247S8/tnqQ8e+UudrJLwhUIZRy/KIHaYEjOdi+qp3IQl5SCpRG0m 8k139AoV7vnI0+mLYrMeZImDbQCd+Xo74HFxMGG7oxoBsiPNeB11ajoxjg6uZcXt8BjA 3zWcqoYEtN/9lHc7fc02rm/vHQGMSnkLC5ybPuesyV5JjavoYXavk3/rbQ7/YgMCGwa/ UkEA== 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=E1FcXcmKek67yaPkdPAw2a7MKWy1GQT4CM0PuDuKADY=; b=Ikbn5ILg4WGtBZCaENeyxPOBouO6tuHYt110z4KQt8V6bFy7GaPB4dsOCEAwpJD2qb A0KRuRFrYJQBDKOerLGLL+olRRq3xSsbO1jJEKL4XkcjcCttSNNHt57+JvUJIOfJ0/LD CMtnxrUoHwPWzhQtHWWVEP9hvvkspSMCs40y+kJ+SCnksUerMv3d70/InWnZV+fl2QKV OkcElX+2CKmqPZ/TrrIz5FsZOXaxcgDXo/ZJOZWNVRUDHroJuztGC7Kez4ygKA92gR/T S9GqWZJTnInH1qOK7cK8i7FpK7dHVzeVxOWIuzGXEsCReDYeze+qio8hO0TLKEqzKnvD HuTA== X-Gm-Message-State: AOAM531sDWmcFjTiox+/rilvMZxhGstPJb8Nvju+dLeWm8wW7zGQguD4 PkvPlJR00KPZCCfzydZMiHaDKvb/GwQnaQ== X-Google-Smtp-Source: ABdhPJxfTfiLY71FMRk6YgoXzhqqpDGHC+LZCfpHZkjtNaJGolWGCEbtgXmzIOxAK1IG+sdMEHYSag== X-Received: by 2002:a2e:3508:: with SMTP id z8mr23100604ljz.7.1626714938371; Mon, 19 Jul 2021 10:15:38 -0700 (PDT) Received: from localhost ([85.249.24.60]) by smtp.gmail.com with ESMTPSA id j15sm2156159lja.21.2021.07.19.10.15.37 for <49419@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Jul 2021 10:15:37 -0700 (PDT) From: Andrew Tropin In-Reply-To: <87v956g1g5.fsf@trop.in> Date: Mon, 5 Jul 2021 18:41:45 +0300 Message-ID: <87pmveg17l.fsf@trop.in> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * 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 8aa9adeaaf..9afb70f0a7 100644 --- a/gnu/home-services.scm +++ b/gnu/home-services.scm @@ -449,3 +449,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)))