From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 05 11:35:26 2021 Received: (at submit) by debbugs.gnu.org; 5 Jul 2021 15:35:26 +0000 Received: from localhost ([127.0.0.1]:46496 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0Qd4-0006aj-8G for submit@debbugs.gnu.org; Mon, 05 Jul 2021 11:35:26 -0400 Received: from lists.gnu.org ([209.51.188.17]:49092) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0Qd3-0006ac-7b for submit@debbugs.gnu.org; Mon, 05 Jul 2021 11:35:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56712) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m0Qd0-0005UV-04 for guix-patches@gnu.org; Mon, 05 Jul 2021 11:35:24 -0400 Received: from mail-lj1-x236.google.com ([2a00:1450:4864:20::236]:45873) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m0Qcy-0004D9-2i for guix-patches@gnu.org; Mon, 05 Jul 2021 11:35:21 -0400 Received: by mail-lj1-x236.google.com with SMTP id b40so5374391ljf.12 for ; Mon, 05 Jul 2021 08:35:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop-in.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:mime-version; bh=AqJjcBG2FHSqRnB2NMcOV4eW/nrRReajiMUiXV62Uk4=; b=l8/XG17RX4sxdJoILvubs6KdomC6edkp3H3WXwCXABm+ayiBV/+o+eH8dvW7I9zzAw IetUQjayqhkhUZp3JfGXy7yvgnr77Yfya4BbUnNVcgAPaGvf5UQDsOmED3T1boG/1/8n 0b7GV6tQRN4C47XQSXgyYjruO07j8JdJJMCbFM5wTQuSHUiy8KTUiF4zWb5/MYNeKAYN 8N1zPeo3nojF+70qE+UwoNx2C4bGpVCB5l380G9ZngK3UGXMqRGPRhdyY59tO4Ri1bQU 9oIPoMGq8MPVnaZjUfmZYW6P/LtLViZtSXYwPDGrA6fP0YVzEPY1C3NQ7uEsEAHft8EZ Z7GQ== 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:date:message-id:mime-version; bh=AqJjcBG2FHSqRnB2NMcOV4eW/nrRReajiMUiXV62Uk4=; b=taud6/ncxtxjnF8LetIJRSA/AauwO9JBDSvAPMGHzTwUspjSHZEOHWFqq2Jovc+G2P bDM3KKJjXBfD7GqZgfvsw9dQ5Y4ljDRIqv/GvzuLZmOp0KSSMIqRkiV7fR0BeJq3yQkP 9J0WdL+cTsOWqfpdR9CGo/g+oZ9ABMfW7EKBzF1Q84VFYTyen5FNgl2BqLeTkPNBWUDf Hjr9Uk8BxfsoDT8m8rkA7QbvOnig2sAhgYUyr5FEGZUKe5B9t0rhFYeoQhhRFFRuPtfD 4Llr8QOW8ENm7O125G6aixYfPGMKOfpMrcbxrNEPOmPif4Gnq3T5P5VCfja7TLIY1tSj i2Pw== X-Gm-Message-State: AOAM533yLD4HGykS0FsxFacntYXGXhDEhNIQJgZF3vJY5+dAQNEwpqdL sD5i/8ZXuM/M+cl+bkOB74Mzm6Myfa2XxQ== X-Google-Smtp-Source: ABdhPJzpfy2yPL6knzsTfmjmsgf7IxKaU2MIGt/zFScuH+Q5I6BN0+FidgiPuPvIeqwnX358qSI/1g== X-Received: by 2002:a2e:8e21:: with SMTP id r1mr7638025ljk.356.1625499317869; Mon, 05 Jul 2021 08:35:17 -0700 (PDT) Received: from ixy ([109.252.117.164]) by smtp.gmail.com with ESMTPSA id c5sm1120366lff.86.2021.07.05.08.35.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Jul 2021 08:35:16 -0700 (PDT) From: Andrew Tropin To: guix-patches@gnu.org Subject: [PATCH 0/4] Essential home services Date: Mon, 05 Jul 2021 18:35:14 +0300 Message-ID: <87y2akhiz1.fsf@trop.in> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Received-SPF: none client-ip=2a00:1450:4864:20::236; envelope-from=andrew@trop.in; helo=mail-lj1-x236.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable This patch series contains most crucial home services and few helper functi= ons required for Guix Home. Andrew Tropin (4): home-services: Add most essential home services home-services: Add home-run-on-change-service-type home-services: Add home-provenance-service-type home-services: Add fold-home-service-types function gnu/home-services.scm | 472 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 472 insertions(+) create mode 100644 gnu/home-services.scm =2D-=20 2.32.0 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJDBAEBCgAtFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmDjJrIPHGFuZHJld0B0 cm9wLmluAAoJECII0glYwd6wHSgP/iGWNsxcvgbodO7ee4UwF8pTKG24ulIlYHC/ AJ2ifrYwaX+EcrBS9nZ2/PkQZR6a+/+YEUXmS5Ys1akuDNbyQLRL+F6YXyyjsIH1 2Ko4mg0QpppSwpTOtwFzQSv0HYH7PURh8cjDeD63qKvzKhhrH59nyrBf/ePeWW14 KSap8Ant7ULNUM1kp86bFBbXGeEh7wf7NH9ftsBnpp947xUKc4RnhOeQyC/wg7Xl zHSOY2ACJ/0hbt+i0nzM/yNqnINaSYkAxQga0M4g2sRYbIskcvdwVgonGDkaaCjV qHp9a3Ugru5oKVGNlf52E4PkdVMIIctAmHGL7Eh1yyl11FZNUvtjoShYQCAcYOBd bjpwq2O4UX+0CU+SnBw++2KWNj+j3ENdWW27fpPYo7/KUrFUIRTSVa6vodOXw1q3 nvMHv+Cqz6fcZeWHwHLoPIcwcjk76kPNplIvAlImva/BpY4cwdU5/ptzuSGH2dsn AwIpue1PE5gWDVLfv2Lu7QUqOTQvcfaI+yOtEWwuvjt788XwsOcB6C3oWJIb+nsV qr/A9SKdgT5/VVKMy1kaJCKVyuFxpqP6XzzBVsfSjVp8qlM7399EUr6IKVXxldTJ qAmvUYBHajBP0YyGs8dX/yWSfJMnQurtUlpnQ/kMKpMtetjE0luFL2VVB8KnEqth H6tLhYZx =T9SZ -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 05 11:37:26 2021 Received: (at 49419) by debbugs.gnu.org; 5 Jul 2021 15:37:26 +0000 Received: from localhost ([127.0.0.1]:46502 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0Qez-0006eF-IU for submit@debbugs.gnu.org; Mon, 05 Jul 2021 11:37:26 -0400 Received: from mail-lf1-f41.google.com ([209.85.167.41]:46628) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0Qex-0006e0-EG for 49419@debbugs.gnu.org; Mon, 05 Jul 2021 11:37:24 -0400 Received: by mail-lf1-f41.google.com with SMTP id p21so11394538lfj.13 for <49419@debbugs.gnu.org>; Mon, 05 Jul 2021 08:37:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop-in.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:mime-version; bh=iyJgr5O2mkA2akelmDVgRasC8dLxHj56J3bChxqZo0g=; b=m6CoXxGwRUyFJiVM9vk3TWmiuGmujHMdqfL/jYYfWF5+OgTLnwpH0UfIBRCwgml3Ma /yF/J4hiTDa+WaEL1A4OuUusfCRounceMQvFKUolQbeAu8L4gBXn9d079e/rwY1CL5d6 lMMiduBDcGPTlK9brPphRq2CKFRXy8J+X1h5VGgKUKRZ+sWjOvmBV8VhIvI4vHwhYl+Z oBfMHqjA/0s2etAPXtDRjFbjQmMkt16zzGXZwMSxLkF4uO9x6h9nw0omXOH8hWrQGVty T5LwAzNnypU1AW9WX5LYWmEUz8nsgpJmGM7iQPIDeqgFv7oa76PTKLMJuygBwXUm7ljs 4Z2g== 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:date:message-id:mime-version; bh=iyJgr5O2mkA2akelmDVgRasC8dLxHj56J3bChxqZo0g=; b=pqwWv1Oe35eBxr5+v3lfmS3G4BSP53AQFS46p3kKqy72ASFlGmZC0kRYOnAI81CUjj lDrVOh72Ko/nHvw79fFc8T+U76s9sfdtJYji5dnQyFrH4qodw7yt8ia0niCzq61zmN1W vFmNMIxaro7SdTo5CQBmmzq7jv3YXH3qVYTaqO6ZPDMAAiAQNff2mFquDzXRU9dgtb78 WOKpYnyQhy02wF24Qb37PmX9uae2B8DDzVOuD7QR6M3rUOmWn5dnzQHw7Q1kDwujR0lR mOB7VpV9xol7B9JrpGuvcB/ziZP3Lwzo0J7Dq6YMedp27SAx6tUbyMbcdlv3IlYu0qo+ ii8g== X-Gm-Message-State: AOAM53277UTkEtinUvSELSfAy4m4zJjxoaFiNs5vJ8FvOu8o0tMVPV+F LjCA+F9I3ehjZpkckTee7za3UH2Tm3vfIA== X-Google-Smtp-Source: ABdhPJw3wkgbKtETRvOFpi15aAvxLqPpQIU+zj3kvFdPAuLp1b2ykJOsTWaAG+i7U1irkpFwCgiflg== X-Received: by 2002:a05:6512:23a6:: with SMTP id c38mr11363573lfv.78.1625499436903; Mon, 05 Jul 2021 08:37:16 -0700 (PDT) Received: from ixy ([109.252.117.164]) by smtp.gmail.com with ESMTPSA id f2sm1069763lft.225.2021.07.05.08.37.15 for <49419@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Jul 2021 08:37:16 -0700 (PDT) From: Andrew Tropin To: 49419@debbugs.gnu.org Subject: [PATCH 1/4] home-services: Add most essential home services Date: Mon, 05 Jul 2021 18:37:13 +0300 Message-ID: <87wnq4hivq.fsf@trop.in> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: 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 proc [...] Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: yoctocell.xyz (xyz)] 0.0 SPF_NONE SPF: sender does not publish an SPF Record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.167.41 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.167.41 listed in list.dnswl.org] X-Debbugs-Envelope-To: 49419 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable home-service-type is a root of home services DAG. home-profile-service-type is almost the same as profile-service-type, at le= ast 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 progr= am, 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 h= ome 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 crea= tes links for various dotfiles (like $XDG_CONFIG_HOME/$APP/...) to store, but is possible to implement alternative approaches like read-only home from Julie= n'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: =2D 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. =2D Sets GUIX_NEW_HOME and possibly GUIX_OLD_HOME vars to paths in the stor= e. Later those variables can be used by activation gexps, for example by symlink-manager or run-on-change services. =2D Run all activation gexps provided by other home services. =2D-- 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..44a7e68934 =2D-- /dev/null +++ b/gnu/home-services.scm @@ -0,0 +1,328 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright =C2=A9 2021 Andrew Tropin +;;; Copyright =C2=A9 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 th= ose + ;; 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 transforma= tions) + (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-environme= nt"))) + (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 interac= tively + (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 #\=3D))) + (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."))) + =2D-=20 2.32.0 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJDBAEBCgAtFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmDjJykPHGFuZHJld0B0 cm9wLmluAAoJECII0glYwd6wEhQP/jgDYw5Erlq3nGRdfwKsKGBLkdYphrx1CE+5 qqdZ3u4IGd66O9gKskHtz9BR1Hr8rY/DPc8ZpUYob7TrmwCPgDRv8GWqnzYAaIBh cr0ga65Do5mBWNUqGbvV/m95qdXcxMhgx0A6sMjNmvI9y5/TMP1HSN+IXZh4AfUe db//TBBOhK1hGOkHhepPzekJkOYlz0JYMgsTwYJ6kFMx7tKMI3nawMcEjZBBQ48R 24gvmgKfaGrtnmdpR8EcUqC/odRzo9TEabIDhH9rQefW8JAbq8+G8WltLqfckeZQ /u3MFov2fulXHvEwc5GhKCiRfqrJEc2rVvVJJKJjW1NYkHeJ8ad/6Kd58j7N1tzF iyMoVZq2e4B207064pIoj3vA4ZepJ3BG5c81HBvBNFjuKJtKRaAACdtNIhJvwFtX YR/M243/lvBbkk+Ms2it73k1xBfvr0YEpC2A13E6AEd8XgP9+kDauydy4x4396lW OqbI5nTW39vb+jCfkCxoUWTaTeBqFxq6RkUps1lsKw0K2aXaQKbwldvB5c2BGuhm 1pqCn7ty2tjUu/g8e+t0MLOP6OFAG/9otrREouFs2Q2YC86vEtdrvYqZoFTpBsC5 7PKkNmopJZP/w2dNXI7pKml3T7Z5NfsVah1uM9ewGUYBjc3bLDE4HVja2kesXngB Kf+rUERt =bWHO -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 05 11:39:54 2021 Received: (at 49419) by debbugs.gnu.org; 5 Jul 2021 15:39:54 +0000 Received: from localhost ([127.0.0.1]:46506 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0QhO-0006hw-HS for submit@debbugs.gnu.org; Mon, 05 Jul 2021 11:39:54 -0400 Received: from mail-lf1-f45.google.com ([209.85.167.45]:47101) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0QhN-0006hj-Aa for 49419@debbugs.gnu.org; Mon, 05 Jul 2021 11:39:53 -0400 Received: by mail-lf1-f45.google.com with SMTP id p21so11405270lfj.13 for <49419@debbugs.gnu.org>; Mon, 05 Jul 2021 08:39:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop-in.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:mime-version; bh=olmO8mEMNwH4BVsJGexsIySLLrOtlHomIvmMBQz/qWo=; b=ucVJhbYCfmkKeVxCGSZFV64NTvUTibFoDAcun5FDSjX0wkRj3d/YypGva/TAe0Tj3v /bOJRNBGYux3ECCXNS3chjxK0t3V1tEloSnVPMix78BbermrY6S9JCmhUHwTAqqjQvoP Irww3vdndUiiJXumJCUr86x3K3SOrgm34M93cGyjGhfWrcilFqNK6lcHPVwWo8Q5EUpr G1fUFLsixtnXJXSOLntZ1GD/gj3cq4XmiJEHUj9VNy/6FJk45ki0KRjPAOvqVHcPS43b kPuiVzjwTFSEufif9Tu4XBZO5lE8Ce7e8LAmd3797gg7Xye/lhkKUkVeFilUsYff2yhp OV0g== 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:date:message-id:mime-version; bh=olmO8mEMNwH4BVsJGexsIySLLrOtlHomIvmMBQz/qWo=; b=hdiOLJgVmG6eFP6jomCxcvzWiUiEeNfSOR4ISMnkjPxi9DSPimZLPPATPE3AcI+5aY SR6iNrrxauf5Y6xHoZzslPflq0sm3oMttce+hmYa/J2t+WGNQbXqoYr2cUWcH9qbDYC/ zag00ucqDi9Tx8Vk46C3qkId9yJnBd5fDkOufRjDP0cADVY2iNoiIisIMPkiLIb5WbZ/ c/k9aPxzxTQKecWSBIEAyJEaoLJYQzMOsZKTESxhqPb5JVCxAP1EB9xJ9HGjLKiKh6vi jjSo+hKMdEqPObk/TiDL4G3msxjX9OOsguLznCnI/fJ/OQUhcV0fNyqzKOgpOlC/6Ey9 Sbag== X-Gm-Message-State: AOAM532y1+WvYxzs9MrLxYe1OG5kdUTSQ0X1gE/DEvPuxj5ZZ2vDzbnE 1P9wEHJbOeFBBayZ8mksbJQSABBdlVG6Cw== X-Google-Smtp-Source: ABdhPJxmQJ+1EqoPiIjE6I8Oe/pgroF+qdPArWhwATYNKEFFP/BhLB0kD5lSIMKnTILeG4Hpqrf/9Q== X-Received: by 2002:ac2:5a4c:: with SMTP id r12mr9475789lfn.498.1625499586863; Mon, 05 Jul 2021 08:39:46 -0700 (PDT) Received: from ixy ([109.252.117.164]) by smtp.gmail.com with ESMTPSA id u3sm212824lfu.241.2021.07.05.08.39.45 for <49419@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Jul 2021 08:39:46 -0700 (PDT) From: Andrew Tropin To: 49419@debbugs.gnu.org Subject: [PATCH 2/4] home-services: Add home-run-on-change-service-type Date: Mon, 05 Jul 2021 18:39:44 +0300 Message-ID: <87v95ohirj.fsf@trop.in> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 49419 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Service allows to trigger actions during activation if file or directory specified by pattern is changed. =2D-- gnu/home-services.scm | 95 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 94 insertions(+), 1 deletion(-) diff --git a/gnu/home-services.scm b/gnu/home-services.scm index 44a7e68934..002a003d65 100644 =2D-- 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 =2D home-activation-service-type) + home-activation-service-type + home-run-on-change-service-type) =20 #:re-export (service service-type @@ -326,3 +327,95 @@ directory. @command{activate} script automatically ca= lled during reconfiguration or generation switching. This service can be extended with one gexp, but many times, and all gexps must be idempotent."))) =20 + +;;; +;;; 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= ")) + (status (system* cmp-binary file1 file2))) + (=3D status 0))) + + (define (equal-symlinks? symlink1 symlink2) + "Check if SYMLINK1 and SYMLINK2 are pointing to the same target." + (string=3D? (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=3D? file ".") + (string=3D? 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."))) =2D-=20 2.32.0 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJDBAEBCgAtFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmDjJ8APHGFuZHJld0B0 cm9wLmluAAoJECII0glYwd6waMIP/iftqlC/BHYKJZUXuGla6gqEyIZy495xHJGq ZPHSZaIcqnGjTx2A7J5+w6xTsDgnRzTAzXtJ+7Wx31sS3mk1noVSBDVxA7HGsFu4 KUP/gjjRxm9qsegRtWWrvHjDrRpmTfG460/HOvS5b80gVlr0o8A1UL/O7fElPqk9 rr0vbx18f/FB+m0EwiApk2g26ORrHEDL4YhIT+fvW3JxgGTCTVUF+T6DyiRa2wKa cIH6pVi2DFzNEIECfbi6adWkNNLgX/PY+shrQJZTVopDPRu0oND04wL/TZWvryfK BW9Gigi6Ma2iSj47qn1+RicUKNZi6NJgnv+jUBngSxhFDWfQBLJgMJKgGB6agNFW gLcwFTe6KHdgrOu2oiH9Cc4uhUQw+g3ddCR8mfkSvST/RafMWgOrptFWspHrLfMH F3uTMGlUJ76m+9sjdFkgI4vdvzWSX96M94ddkWFJFSG0KhRtqQ9kCf01MM7bRDFL QRtQ7zhgUOoAQlz5xSs5aTh+2FkGf0Xdd5itUP8IGXzYhtQLvm2/HhaRF035YoDu c4qWmvS5454VG152u1Bz/QsM95uxZSEPChqEIyquSFcyX5WUQHDVa2e6RoO1DmFY EBYy4XwnzCKaLpWvarC3z9E7SCYJIBkSqb4oV3OLtklHiADFSu8LD7UdYmK8vKFU JytNaSV7 =Zq/L -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 05 11:41:18 2021 Received: (at 49419) by debbugs.gnu.org; 5 Jul 2021 15:41:18 +0000 Received: from localhost ([127.0.0.1]:46511 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0Qij-0006ku-WA for submit@debbugs.gnu.org; Mon, 05 Jul 2021 11:41:18 -0400 Received: from mail-lj1-f171.google.com ([209.85.208.171]:37430) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0Qii-0006kh-PO for 49419@debbugs.gnu.org; Mon, 05 Jul 2021 11:41:17 -0400 Received: by mail-lj1-f171.google.com with SMTP id k8so25141055lja.4 for <49419@debbugs.gnu.org>; Mon, 05 Jul 2021 08:41:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop-in.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:mime-version; bh=bdHvBm0ThHKYKK9a/VSWh3+Kmiw7MCeF7dEvTLC4654=; b=fxbFZOm13fbaTFuGbxMle/FePkrbLm4YDSrGO7dsXaqlJw+UHdfNSI+D0lVxZmRqZH SPiSgXjboPsZeK/b+po65BpGNsb1J6PTtOQF5qEoZfljsWUGUmpTj2A40XyGb9P/reXJ GwV58MZlIjUZmX/hlvb1cC7l2y02ScstZZyPg5Fny+fMz6kX0gr1URCFv26youbcpc6/ UAsbT/3b5Gsws0I5SRmyqqaWWikOiWWV4zHBb3b6+mht4+WKMJBAQTdZxesS88AfKlBS 3DFclBRLMmEfCuCHtT9BnTUxvBFVSWUKVEnhApZJGYk8OUyqEi4jiqlfw23iws7QRC4p iOtA== 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:date:message-id:mime-version; bh=bdHvBm0ThHKYKK9a/VSWh3+Kmiw7MCeF7dEvTLC4654=; b=GrFJ9z+pt6mnYVGHSocH/RlStoakVt3yTNSLsvlPHm0SCihZRhxvLYd9/WnOQjCS+P wVORAEX3ui7wNwbhkbKdNJ37uaZ71SY74s2s7umWeZuYOfUlVI+fTIdaU2+8stJEOwbX IO9zIR4pW1Lr4WH56S1O7bADS5+Lwo9/mEvNSbyGjy2fw3d9Oz2u37jjJ5W7uYTeGj64 NKkJDzFbRkq4qF6FrAx52vvrLi2PO/3gGb7JIlbOn4ddeDqo4w0sWQrf876UvXSFqlPn LzB8Z135gwjd3M9Vqbo/VSsr4bcGvlHTZZlOHvhjaxmx2BTbXNDGTeQ0KhsVpwdAGdRw IKnQ== X-Gm-Message-State: AOAM530Ur2idepbLeTAmJYTSvs3cLhu3TqdlQdAMnxxvcQJnmbmZpMTG OoL0SdTj2vWgCKfzEpu4x0ufrBoVkyS8Ew== X-Google-Smtp-Source: ABdhPJzI6pN7sspy+bXsrrketO/YK9Fbd8nEIWty4gWfH24c6Gn0j++XPkxXmEafV8cPYqdOkVpYGA== X-Received: by 2002:a2e:3e07:: with SMTP id l7mr11475368lja.131.1625499670354; Mon, 05 Jul 2021 08:41:10 -0700 (PDT) Received: from ixy ([109.252.117.164]) by smtp.gmail.com with ESMTPSA id u2sm1119646lff.37.2021.07.05.08.41.08 for <49419@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Jul 2021 08:41:09 -0700 (PDT) From: Andrew Tropin To: 49419@debbugs.gnu.org Subject: [PATCH 3/4] home-services: Add home-provenance-service-type Date: Mon, 05 Jul 2021 18:41:07 +0300 Message-ID: <87sg0ship8.fsf@trop.in> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 49419 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable * gnu/home-services.scm (home-provenance-service-type, sexp->home-provenanc= e, home-provenance): New variables. =2D-- 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 002a003d65..20a9537650 100644 =2D-- 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 =2D home-run-on-change-service-type) + home-run-on-change-service-type + home-provenance-service-type + + fold-home-service-types) =20 #:re-export (service service-type @@ -419,3 +422,25 @@ G-expressions to run if the specified files have chang= ed 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) =2D-=20 2.32.0 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJDBAEBCgAtFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmDjKBMPHGFuZHJld0B0 cm9wLmluAAoJECII0glYwd6wFgQP/25DCZPMwKYLNPaIz+QqKQODiND/L+UK+UMS arAdMlZIEQoDaUXU+5e7ekzxhIwOXcF1MIXAjeGX/VogNDRFmk8btSUndXlcBr4f bjpPn1DOof8QwZIZJ1/TKcC+pz7uNA4s0q6/MjZLn4XxJHz4eaqMip+CnKUBTIIQ FTO0Z9KMFUhwDNIprBCM1t/JpGlDLdCRAIxeV6LCoYCOWskEVLAa76JrrJ7kI9p3 U4uezVeLlVCET6RKgy8IkZM6w9e+Gk8VFz4nAwJ2FpdLxYir8J5wC0pCkImhrOR5 g2ksdmLLS7u88jKdIfHVCrGqRQ7kA4MLVhHzCXRnu9ZlZ/wm8gz4NYWVPeT173VK lFYcXTi83B4MCxuzj3JXijNcWDQK1Q814k6PwhqHoxLziRDCyvPgwwwRSpPTtZRQ ChC8FB8C4bc/vA4KEJA9wwJjydUMpkZ3q3dvzZBqKFpzbIJKygrTUToUk7dAjo96 fYBzqVwqfECvVNERnelc3Vrak4Ad55cZLWiQ/62U7pp2ZprlUJg4hjeycihmvK3Q ciQZ8G5gWGx8fhR8k/BUcZSAgp34wy4sRaXPU19irPgpuAWZPGub5DM2t5CIVJh3 hsF5RKJM5COmAB2XDnsppkSpdC6H/67jCT1aNUyqUBQ0wBMexMG26R+2nOdiSLGB KeqwmUsw =EObI -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 05 11:41:56 2021 Received: (at 49419) by debbugs.gnu.org; 5 Jul 2021 15:41:56 +0000 Received: from localhost ([127.0.0.1]:46514 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0QjM-0006lt-8r for submit@debbugs.gnu.org; Mon, 05 Jul 2021 11:41:56 -0400 Received: from mail-lf1-f48.google.com ([209.85.167.48]:40555) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0QjK-0006lb-5y for 49419@debbugs.gnu.org; Mon, 05 Jul 2021 11:41:54 -0400 Received: by mail-lf1-f48.google.com with SMTP id q18so33137168lfc.7 for <49419@debbugs.gnu.org>; Mon, 05 Jul 2021 08:41:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop-in.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:mime-version; bh=OTM/NfLS28K1HZuhTzrT9b9se42Y6/V4cVqAWD8LQag=; b=O4R7fUQHRH48IOHQfxpGOLIqoYae1jf+xaAxDm+m2femv/zRGVOjZXAtzs4285Fw2g 1x9d15Lrvzhg5VFBNt9QawrjQFCudu+aXwqRtPduTbx/QbBrok4c94ZoSG81NtuuaL9o yfnlVf82dg5TZXrrvZ5FP+NI5UlF2iMfo89c/4LeOpt3beSt4qcLLQ/7o8h8DCgTdFAx AP/xcia4XfcwKBRDJjYvWY+B1+BfxfrkUwWblWMI7aE9Ht7DTRV6sA1t1o6NkaVB8DJO 3uC8sGZwW7jTrIZOgzkRSMJLjvzy/G29lxtaIIEIqObAqTN3YzZqViJYlrn5tn0UqOX8 E7vw== 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:date:message-id:mime-version; bh=OTM/NfLS28K1HZuhTzrT9b9se42Y6/V4cVqAWD8LQag=; b=XhE9/a/7SwDcQtEhwspZCJh+lvRo5tZVXP/NnHvOUFH/g/anY4E5Y6ZF1LKeNEasdf kPgI3JY5n9bwi3fgGxJ/Y/1Y7EfxABizegTtwbUsz2uJ3UUPnh5zq51tce+9ysjtrMAR Gu09+iwC2whGdJpO6xRfUTF+cr2CiEVPAi4Ijf1mKMvTDeMdmg8b3F5OBsF0ntkQ/VyF aE73+D4GqA1qP113J9+J0HXiQA1uuLr7Hi/85EgG6Q4rijEO2TnnqOsOGXjVfR2YIqUZ 53on0EY4KUzu2rDF7gYAT1ciYKcNwdEiaTPe2lRHPAGSMgU7tOwuotIeXxPIN8lYk6ew e44g== X-Gm-Message-State: AOAM530/XgxIJ56tFECe+bIi1J58G0wtV2eOHnyZ9DJnlRZeANQ4aN44 JEiV/s6vZp8Q/jyWJ8UGHReyn/DxpFVfBQ== X-Google-Smtp-Source: ABdhPJyIIaYNAprn7ubbkL4iqg8fbImP7kG5ix0KgDcFbESGTfxh63+ugv9OKBRPBlXvE3Q8xxECNA== X-Received: by 2002:a19:f807:: with SMTP id a7mr11243949lff.149.1625499708129; Mon, 05 Jul 2021 08:41:48 -0700 (PDT) Received: from ixy ([109.252.117.164]) by smtp.gmail.com with ESMTPSA id y1sm1293242ljc.29.2021.07.05.08.41.47 for <49419@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Jul 2021 08:41:47 -0700 (PDT) From: Andrew Tropin To: 49419@debbugs.gnu.org Subject: [PATCH 4/4] home-services: Add fold-home-service-types function Date: Mon, 05 Jul 2021 18:41:45 +0300 Message-ID: <87pmvwhio6.fsf@trop.in> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 49419 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable * gnu/home-services.scm (parent-directory, %guix-home-root-directory, %service-type-path, all-home-service-modules, fold-home-service-types): New variables. =2D-- gnu/home-services.scm | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/gnu/home-services.scm b/gnu/home-services.scm index 20a9537650..a06cd72459 100644 =2D-- a/gnu/home-services.scm +++ b/gnu/home-services.scm @@ -444,3 +444,29 @@ environment, and its configuration file, when availabl= e."))) =20 (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.sc= m")))) + +(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))) =2D-=20 2.32.0 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJDBAEBCgAtFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmDjKDkPHGFuZHJld0B0 cm9wLmluAAoJECII0glYwd6wnIgP/isEncoPbwrs77ZNLilDgzqLXZzFPMsZembM kHKhSufjTTuDdvutWFZJGXPDjoGchJCp2/jIlQmQ2qRrZ2CfhLvUVnAnHQbt1oSI wh8XecyKY2ML4QjV1J9jkXH4XcLKkrAlqkbVeXNXcrtJFTZdPlbcUdsaR0PKJ5xC O2cb2+qcMGf6wof3tJjxkKzqS3wVEwOKRWHad5dik/F3FdYM6UcsRxNr9Qhcb8yM oqS3ccjAznkH+NZehl4JqeIUqVewlhQYb8gn8zTEA1paFLBfZxYFALjDxKhdB5MR kekSlIPRkDJavuQKNogL9Rui9N2dOiwuxWXCiPLdql8/mYTEazTFMm4Cm/1Kw6zt 4BouLKAVfRJpO5/bK6Z/eaKxRgf/fTsXQu+UM7G242ahR8oflAve9Txuno/TtDDJ tU0ZzHoY2jPfV8MCV8D8xGKudbjHSzunHlMfvUoLTiF4WLzhuEuX7eKgo0yP3IuZ T64LgwHzaKkDStMgYyomxVEJhSL4WWYZxYyFaftVGMj8RFhzvKlUySXZFF5tkLgw pxB2xgT50qaP+PMXePOorSyIgS6+IQveV+auRjbfCpaCjEriWnJk+4hYRHLyRPQr zTY9BrY5JV86PCn6YbAKqZaiFImM5CGZJFAx/7AQaheo5laeiv+Lt/n4dwv/lV9f ogLILU0w =L4cH -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 05 11:47:29 2021 Received: (at 49419) by debbugs.gnu.org; 5 Jul 2021 15:47:29 +0000 Received: from localhost ([127.0.0.1]:46525 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0Qoj-0006vg-8N for submit@debbugs.gnu.org; Mon, 05 Jul 2021 11:47:29 -0400 Received: from laurent.telenet-ops.be ([195.130.137.89]:42862) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0Qoh-0006vV-IX for 49419@debbugs.gnu.org; Mon, 05 Jul 2021 11:47:28 -0400 Received: from butterfly.local ([188.189.1.51]) by laurent.telenet-ops.be with bizsmtp id RTnR25005161ovQ01TnR2C; Mon, 05 Jul 2021 17:47:26 +0200 Message-ID: <9ee31c62aef0a42b15b48ece2c1d0fe765fdcc83.camel@telenet.be> Subject: Re: [bug#49419] [PATCH 1/4] home-services: Add most essential home services From: Maxime Devos To: Andrew Tropin , 49419@debbugs.gnu.org Date: Mon, 05 Jul 2021 17:47:25 +0200 In-Reply-To: <87wnq4hivq.fsf@trop.in> References: <87y2akhiz1.fsf@trop.in> <87wnq4hivq.fsf@trop.in> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-PBWylzHqCTQHaeEZzIQb" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1625500046; bh=41cgcUDeX9pbpD9BOUewqG0qYLWS8j4aMrWZ1r4Iy3k=; h=Subject:From:To:Date:In-Reply-To:References; b=r8+zbdjO9yZ5pUb5ad9QI5hJ1jHIF3lzaPJXe8eALzo1BvEhHKxgHFfbrAHLeFu/t mWOJgyefcvGEubOozcUDK3NV10SactJwPS1aDcdB1ujTOs9544zk5gPe1JQS3zuDRY BZtLRnX8BCe1Eq0tXz3mAMlgrwIlQSgBLF1j/VIu4ywVI8Li06KFvSS51bbJ533Qrz y5tTKzOg8QYA9QLFnrunRbW8xkiIOssyGQ9fDCoESaXeLrKKEN1FJIBztOubw3j+y5 1RTZfwK1T/1RPzdf/ie/W1lSPZRFiNY0WXc0P72Klp3GX/5rUMGiZ9GSGElwbDx56p thEL2+WwPAUdg== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 49419 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-PBWylzHqCTQHaeEZzIQb Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, Andrew Tropin schreef op ma 05-07-2021 om 18:37 [+0300]: > + (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 #\=3D))) > + (cons (string-take x si) > + (string-drop x (1+ si))))) > + ((@@ (srfi srfi-1) remove) > + string-null? > + (string-split result #\newline))))) Why are you using @@ here? 'open-input-pipe', 'read-delimited' and 'remove= ' are exported variables, so you can just use @ instead of the magic evil @@ operator. =46rom the guile manual: -- syntax: @ module-name binding-name Refer to the binding named BINDING-NAME in module MODULE-NAME. The binding must have been exported by the module. -- syntax: @@ module-name binding-name Refer to the binding named BINDING-NAME in module MODULE-NAME. The binding must not have been exported by the module. This syntax is only intended for debugging purposes or as a last resort. *Note Declarative Modules::, for some limitations on the use of =E2=80=98@@= =E2=80=99. Greetings, Maxime. --=-PBWylzHqCTQHaeEZzIQb Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYOMpjRccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7gQOAPsFGFgW0cLP4W/e7uwZbt03DBOA fxqtbIow4lZzBZnzuwEAudd2ldnndceENw+2HPKFVb7MVWUMg97zzFX4fXgADAc= =CSiP -----END PGP SIGNATURE----- --=-PBWylzHqCTQHaeEZzIQb-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 05 12:19:50 2021 Received: (at 49419) by debbugs.gnu.org; 5 Jul 2021 16:19:50 +0000 Received: from localhost ([127.0.0.1]:46577 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0RK2-0007u1-Iu for submit@debbugs.gnu.org; Mon, 05 Jul 2021 12:19:50 -0400 Received: from mail-lj1-f179.google.com ([209.85.208.179]:33673) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0RK1-0007tk-6E for 49419@debbugs.gnu.org; Mon, 05 Jul 2021 12:19:49 -0400 Received: by mail-lj1-f179.google.com with SMTP id w11so25399102ljh.0 for <49419@debbugs.gnu.org>; Mon, 05 Jul 2021 09:19:49 -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:references:date:message-id:mime-version; bh=s5XcUS/JJ2v5gY5QMB17hYsmnMdlc1qPu3b35EeibjM=; b=xisbRjggTb67FhaAZ/gGjGAJMq+UBbwkNTCgpvr98LxBjp4EAs0+J8wA11jLirOL5e w4JED2odX4dJdxZZfxH096v9+di4u8/8QNWCI7YGHSJC4MK7QgNvN+pME+n6J39eXTBC HfQVfhzVebZI1JplkepPeHv3qMKpt5dFUej+ry3r+Kys8NiuewOw8r7ev1LjkhqldKBF uqSSFfXlj5iKKLt8PbfhLYIcr9Wh2GgdPnUgozlQBp9G/CpzATomta66YqB3vEtNCimZ QRUWYRMJLWIIVW8yotcxtUe8rVvf1yOWzgVLU/YsGOkTG5MMrUokXAPbuRLH1V0bENIj ipbA== 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:references:date :message-id:mime-version; bh=s5XcUS/JJ2v5gY5QMB17hYsmnMdlc1qPu3b35EeibjM=; b=rB+tkiEjx+TxkMJPKtsQhUrGGiaQ9rifNdC0gCML+NtU4wfvKVDYhF8vuYI62t42iE q2sT3llRYLr6D+njtVavFwmktS8z9Aa5k2lRvniNolV1m4xF8zUYSbc+fUtAZchLSDV1 XKVuJ4KWUPAzJgO6mn3X2zBvNNiciM6/28nHI3/zlFBn3XTpa/jXA65aJWpChpLtVCtu YjW4JyXYNKhnzEY3UBE8H3wFLWXyvgei+45vbIy1IcAqw3JUMpqdJ2J4OGf8rCDtPajx WWNumE9h5igrAhJJpJmqGh5mjqxEbJtl2saVG22NBw+NDI31jYZYAJUz0+CIncdq5iar z1WQ== X-Gm-Message-State: AOAM5300UU1CfeVqcFEf4PyVC0Rrm644WwRHe0RDwm5C/Wzs61uwy6qP S5UT3nMoS5lR0kbObR/x4cn0E1KOxRytoA== X-Google-Smtp-Source: ABdhPJziGjBhHdkc1eVNsCNFRt7JLwBavKYRG3Qxsdl8k376RhEmcOdh+BMu/qmkTYmByvccA9iRCw== X-Received: by 2002:a2e:7602:: with SMTP id r2mr11651247ljc.271.1625501982500; Mon, 05 Jul 2021 09:19:42 -0700 (PDT) Received: from ixy (109-252-117-164.nat.spd-mgts.ru. [109.252.117.164]) by smtp.gmail.com with ESMTPSA id p3sm1208597lfa.100.2021.07.05.09.19.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Jul 2021 09:19:41 -0700 (PDT) From: Andrew Tropin To: Maxime Devos , 49419@debbugs.gnu.org Subject: Re: [bug#49419] [PATCH 1/4] home-services: Add most essential home services In-Reply-To: <9ee31c62aef0a42b15b48ece2c1d0fe765fdcc83.camel@telenet.be> References: <87y2akhiz1.fsf@trop.in> <87wnq4hivq.fsf@trop.in> <9ee31c62aef0a42b15b48ece2c1d0fe765fdcc83.camel@telenet.be> Date: Mon, 05 Jul 2021 19:19:39 +0300 Message-ID: <87mtr0hgx0.fsf@trop.in> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 49419 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Maxime Devos writes: > Hi, > > Andrew Tropin schreef op ma 05-07-2021 om 18:37 [+0300]: >> + (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))))) > > Why are you using @@ here? 'open-input-pipe', 'read-delimited' and 'remove' > are exported variables, so you can just use @ instead of the magic evil @@ > operator. Because of a bad habbit, I needed it once and after that started to use it uncoditionally. It should be @, thanks for pointing! BTW, how to add changes to the patches? Do I need to resend a particular patch with required updates or have to wait other reviews and send a v2 patch series? --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJDBAEBCgAtFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmDjMRsPHGFuZHJld0B0 cm9wLmluAAoJECII0glYwd6wZT4QAJEov57pZfK3lU4JxmmbjrSO8VcmU9d2OmDw 8u4ZFeYOgC+U+QJjGEzXnZNW4QuxZGfOwtC9oxCyAqMXFwMc+hKUL28BG1fBRDH9 kl6Gpn5NzARZt6Ou1xfBYXyqO+iTYzjYo8mKfdKDDI9PAi2dVSeAvkAVZ69QCm/f K5AuJnZGpfRceGs60p85i88T8IsSWXC72RnJ9osYYCHosvboNCv5YE5UxLbXH/8T PYMI6tqZvRg6UNtpPUiwLNocLDDghM62Zyb2Q+5iDGcX8ZOkiYLKqq7CgLZBK0kY Khv4wjJHjFIr7g3/1dFrWQqXzW8uJsGZZY5OvG5cPrcdX3hjFnf4WWPRYxwi+/JK afyejohUi45464OO8lo0hy+eouE4PcDSwFu4vJhLZORr49zCzIueMXhcBLk/M7++ 3CGd4ow30StzUnm/YBxyhh+dku9YXJHXsJNxQV5Wi8q5Nsuk13B1MGLoek054FJt bD5otRkNqW1gBQLRhles4znt05fLYHKlMESRXRSwUtiTEeO7KEnLyRyRIE6ewk++ l/et9h/fnyHECpvk+imvn2PmVwKyhWtSKyE0/WBxchVCrUnZJwB5bGQJ11XuWM8Y P5MjEXvboCVwwI5cV6wTInCVRbTqpbQgHxUx3F7itoIqwlLNhky3cbUDLkqg+IS4 Och3Ic1x =dxhj -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 05 15:19:23 2021 Received: (at 49419) by debbugs.gnu.org; 5 Jul 2021 19:19:23 +0000 Received: from localhost ([127.0.0.1]:46678 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0U7n-0003tS-1g for submit@debbugs.gnu.org; Mon, 05 Jul 2021 15:19:23 -0400 Received: from baptiste.telenet-ops.be ([195.130.132.51]:50062) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0U7j-0003tI-Tq for 49419@debbugs.gnu.org; Mon, 05 Jul 2021 15:19:21 -0400 Received: from butterfly.local ([188.189.37.160]) by baptiste.telenet-ops.be with bizsmtp id RXKH2500K3TK16401XKJFm; Mon, 05 Jul 2021 21:19:18 +0200 Message-ID: <6b465d9991c15eb9fc9f8def6aa3293a872352c1.camel@telenet.be> Subject: Re: [bug#49419] [PATCH 1/4] home-services: Add most essential home services From: Maxime Devos To: Andrew Tropin , 49419@debbugs.gnu.org Date: Mon, 05 Jul 2021 21:19:08 +0200 In-Reply-To: <87mtr0hgx0.fsf@trop.in> References: <87y2akhiz1.fsf@trop.in> <87wnq4hivq.fsf@trop.in> <9ee31c62aef0a42b15b48ece2c1d0fe765fdcc83.camel@telenet.be> <87mtr0hgx0.fsf@trop.in> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-H9RfrdrPeTU78y1htctg" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1625512758; bh=pq7CCp8JsaNK220A9jHMRfFxF8ebQjQGoGOKnPgr1ok=; h=Subject:From:To:Date:In-Reply-To:References; b=cIC05MIWOEeSFAWcJPBCEm5V71kEGSiU4zSCh3dVhidaY53NJS11HfI/8+KO0tvZd brKGy30FBBl2c9vtLDliqYrb7KBBnWN3mz516Bdy+ipX5NSrIXID/15lmm+nD2zFnQ iuB+YFt+bwcjmkqPd8a1a/1oKwEA3NwIkRbfw3i/DfKS+iMRm6ZgQT0S67zVrv5DKA 5SifUEyU5fbJYqCT4K5rbhrAl8Y7UvkC3Yb4qxrj908z9UIpgICoD7ILG/JRTYY6oH m5J00piSDhkN/nM1vxkmMBB9z0Cex1g8/mvZFfwWkXitniBWp4Y4CQnFZWZcm6kAdS oCdv9T0c2gH1g== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 49419 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-H9RfrdrPeTU78y1htctg Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Andrew Tropin schreef op ma 05-07-2021 om 19:19 [+0300]: > Maxime Devos writes: >=20 > [...] > > BTW, how to add changes to the patches? Do I need to resend a > particular patch with required updates or have to wait other reviews and > send a v2 patch series? I would do a combination of those: reply to the mail of the reviewer with a revised patch attached. When you have received a =E2=80=98sufficient=E2=80= =99 number of reviews from others on the other patches in the series as well, send a v2. Some benefits of this method: (1) it should be clear which patches should be applied, as the number of 'revised patches' without sending a new series version is limited. This is also the case if you send a new version after each little cha= nge, but can easily become _not_ the cas if you always respond with a revi= sed patch without starting a new series version. (2) you don't clutter the mailboxes with new version after new version after each little change. This is particularily important if you have large patch series (say 1= 3 or more patches), which doesn't seem to apply here. WDYT? Greetings, Maxime. --=-H9RfrdrPeTU78y1htctg Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYONbLRccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7rqyAQCmkk6yS83y0pMlfQLcCbtOBXhB ftqfGvZNgXttITIrmwD+OUdsc1bXq9uZ5vjhSY45kTNzNBtwhiYB5tQMTCMzDA4= =Y7+e -----END PGP SIGNATURE----- --=-H9RfrdrPeTU78y1htctg-- From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 06 03:10:04 2021 Received: (at 49419) by debbugs.gnu.org; 6 Jul 2021 07:10:04 +0000 Received: from localhost ([127.0.0.1]:47148 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0fDY-0004vq-2G for submit@debbugs.gnu.org; Tue, 06 Jul 2021 03:10:04 -0400 Received: from mail-lf1-f44.google.com ([209.85.167.44]:33570) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0fDV-0004vG-Jy for 49419@debbugs.gnu.org; Tue, 06 Jul 2021 03:10:02 -0400 Received: by mail-lf1-f44.google.com with SMTP id t17so36650136lfq.0 for <49419@debbugs.gnu.org>; Tue, 06 Jul 2021 00:10:01 -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:references:date:message-id:mime-version; bh=EtZjUjIZ6TFs0wFNroqBvc/oncyppmt1ks0yKhftJwo=; b=dHS4OeY6rT4oKdv08REv4dth5uzqQlt0AgK0wHiKj8DOq7Wa8Z7nB/gAyGKKSpFD3W LdkEIdtF8m6s3ZMXyahEe3dr5K8i4yB1xN3H6xWOcY6V/jlxSxH6f23aEf8DT7mYSSzG y4FOPHvlscpMicziHidW903Uh3trNALK1PqHbIzWhdiiR+sevNm/H9sbBvcnJ4sP2ADi CSKuluiIM1FJEpedebYNj+ljX3aq4xon9I3q/sWgNoC8HWdsH/LD6qhDM05xndv7DrY+ yib0INCGE08sIsqQy8fulnyhzdiYaQWlJoK+oB3VnotMVN7NO6MK3p6HO17+3xP4shiT EO0g== 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:references:date :message-id:mime-version; bh=EtZjUjIZ6TFs0wFNroqBvc/oncyppmt1ks0yKhftJwo=; b=LkIS+uyx0eycaaBS5yVk/ejPVDaupWR6clf04dYNhuBhy+ebHb9pYLQFzDm7eGDRn6 3kZACx2KSiqGT/mOK6Y4qc6enE/aI+eqLTFWo7NfsgDUH4zDTObEuGbdZr1Q6oBs3sZe WthhkOqQlA25aG+KVqNUa04GltZk8Y9UUOlG6Id/KbQcun3fB9BcviPu4rKplCVK2tCl bctqTqpLBvYgS3MN31YtCv+Epn8G2CvioQlqZn8uuFbmccDvy70UHr3PihofQOme2XVG a6pr3mviDsLD7X4CqfURCZYOn+yjof9uVtsZ/NHWq6OH1YimvaYrC3Ce7/O3pUphTxYd aHDw== X-Gm-Message-State: AOAM532HcG5+r/0F/tbv/LNh8MM53YynP+H4MbHiYkqf8jmM+pI3n73D kmQq0enoynTtkIbZpD8j/oD/DxipuYMvYA== X-Google-Smtp-Source: ABdhPJxnZ2obTi1AXQGtyt1ng20ukrdn2GM5RECFtfRMP37c1mWuBH+Q6QQEj9st8ILd6vG2PvaR3A== X-Received: by 2002:a05:6512:1056:: with SMTP id c22mr1622551lfb.187.1625555394166; Tue, 06 Jul 2021 00:09:54 -0700 (PDT) Received: from ixy (109-252-117-164.nat.spd-mgts.ru. [109.252.117.164]) by smtp.gmail.com with ESMTPSA id m6sm1304669lfu.238.2021.07.06.00.09.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jul 2021 00:09:53 -0700 (PDT) From: Andrew Tropin To: Maxime Devos , 49419@debbugs.gnu.org Subject: Re: [bug#49419] [PATCH 1/4] home-services: Add most essential home services In-Reply-To: <6b465d9991c15eb9fc9f8def6aa3293a872352c1.camel@telenet.be> References: <87y2akhiz1.fsf@trop.in> <87wnq4hivq.fsf@trop.in> <9ee31c62aef0a42b15b48ece2c1d0fe765fdcc83.camel@telenet.be> <87mtr0hgx0.fsf@trop.in> <6b465d9991c15eb9fc9f8def6aa3293a872352c1.camel@telenet.be> Date: Tue, 06 Jul 2021 10:09:50 +0300 Message-ID: <87im1nhq9t.fsf@trop.in> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 49419 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Maxime Devos writes: > Andrew Tropin schreef op ma 05-07-2021 om 19:19 [+0300]: >> Maxime Devos writes: >>=20 >> [...] >> >> BTW, how to add changes to the patches? Do I need to resend a >> particular patch with required updates or have to wait other reviews and >> send a v2 patch series? > > I would do a combination of those: reply to the mail of the reviewer with= a > revised patch attached. When you have received a =E2=80=98sufficient=E2= =80=99 number of reviews > from others on the other patches in the series as well, send a v2. > > Some benefits of this method: > > (1) it should be clear which patches should be applied, > as the number of 'revised patches' without sending a new series > version is limited. > > This is also the case if you send a new version after each little c= hange, > but can easily become _not_ the cas if you always respond with a re= vised > patch without starting a new series version. > > (2) you don't clutter the mailboxes with new version after new version > after each little change. > > This is particularily important if you have large patch series (say= 13 or > more patches), which doesn't seem to apply here. > > WDYT? I came up with one more approach: I can send a patch, which address the issues reviewer mentioned and after getting more reviews from other peers I can rebase my original commits and incorparate all the later patches to them and prepare v2 series. [PATCH 0/4] [PATCH 1/4] fix1 to address issue from subthread1 reported by r1 fix2 to address issue from subthread2 reported by r2 fix3 to address issue from subthread2 came during discussion with r1 and r2 [PATCH 2/4] ... Such approach makes it clear how the comments were addressed, because now you see a diff, not the whole new patch. On the other hand it can be a little harder to reply, because you don't have the latest version of the patch, but have only original patch and updates to it, so you need to pick, which one you want to reply to. I will try this one, to find its weak points. It's better to practice on this small patch series, rather something huge) Another question: Is it better to inline or attach patches? --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJDBAEBCgAtFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmDkAb4PHGFuZHJld0B0 cm9wLmluAAoJECII0glYwd6wjAMP/3HfCFMBPLkyY3E8LrGZ5y9Y5x4ezbdnvC+I GeVjML5vMzVQ1RI/eIvtzfF2pCxN1ID+41gFvRv+fJ6JWceu0uwMWhOK9mktkKBG V5+gB6aX1CuCoVh4ekIt1DcT6TeQlUvE06y6196xspCeCI0OpnH2FJNfvU3Y+reC 1wK6oL5ch9kKjyF+09U/U8DRWyEc1GSrETM7DQ6i5dYiy7l8KVNgbj7THRHI36as ia5Fw8axZ1uoXPFDqmnbuHuCuGP5ch98e+0K2jJL7+1cysPjtbkzzeXAHKNsVo/l AH5DhN38zy/Jnsyv55Kdkb6MF9BR+Dehm8aRJoFrAoFzBTgJw7zGRSB4OvwLLdSg +n7hy8+EGmX8XU4psLS4r1isXTScCiela1rNq/P6t3xmOlP8xNkZ2t/VAg9qeqca c3pkXtOHjTYlp5eyo1/jPr6Uto2uJL6CkPAJZyyeX8VT7wRvduYLratJ3c33xYnH tjLVOqdoJwOEPcEu0rnt05y/VbSNsUSz7P/RO9YUDqBI/w913EgN8hz3uR5f8L2/ fZpUfdnUYlcQ1LH2Vbj8UIEIf7c65To+14dQUunoN3z8nwR2pPfO5SCbmjZBFzii /2IG36ozJ1XL6x9lu79hDkkXJkVQkW50kGuDsM89j86AASgThs4AtWusSma2nqrm oBqdTYd4 =ePjX -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 06 03:23:28 2021 Received: (at 49419) by debbugs.gnu.org; 6 Jul 2021 07:23:29 +0000 Received: from localhost ([127.0.0.1]:47162 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0fQW-0005JH-Lg for submit@debbugs.gnu.org; Tue, 06 Jul 2021 03:23:28 -0400 Received: from mail-lf1-f44.google.com ([209.85.167.44]:33481) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0fQU-0005J1-21 for 49419@debbugs.gnu.org; Tue, 06 Jul 2021 03:23:26 -0400 Received: by mail-lf1-f44.google.com with SMTP id t17so36706809lfq.0 for <49419@debbugs.gnu.org>; Tue, 06 Jul 2021 00:23:25 -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:references:date:message-id:mime-version; bh=7lUQP/fpEOKv5wVmwNGt1oRKRbD56nqF/IDoIFiqVp8=; b=ftP3bYWwppQ2zx8VL4cpzmBfkhGoLq20G1S3Wpj8dimiN8piu7OLvi4Dg+C3dWwFz+ WlHoGDhAk5Mkqx8uJVre/XeM8JBP37yim3DCeDJvuvAN8oysvhrXB2xq0jATQxTdiJGW bWApb7rSXJiZ0gq20g3HrpBu12MW2efZ+pycvZo5hBoH5nVUeedZXg9D11n7ebU4UMwr +gzb0WTW0z2M0fE/A2wz1bdIFglvm0X6JeUQLGkgSH89hk9LyLT/MfwxLlQlv5wE5FmW ZxKcJAf2dx2yEHCc7IbhxSDHW/nlW8OhtXZ1f9e3Z37ftD3a62a7s1cDZrUUehNymiSU g5og== 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:references:date :message-id:mime-version; bh=7lUQP/fpEOKv5wVmwNGt1oRKRbD56nqF/IDoIFiqVp8=; b=SEfY7PJXk5dyRydqz3yy9RjA16ZCNPMNPnpendWg5EzZ8dWWOTuXXayIdaGEd59ddM R4dgcKZTDdaZepeSzAsLDNAEmh94lXXW7vWZGmF0sYYjZQedWcg1qOkNLBR/HMPMnUnb pPrra4QrAEhPu9av9czQKIkTjv1ywHKx1dBgzJ/RpH6jt9LMu+yp9Xj/H2pB8JNboeGS GrLnCFVcT+yDLlzmeRJwvCsk0fe2OWmH9wT/pG6G70WN6LvDn6TJzAIEpsWPKul3TMGK YfJpxa+k4f8P64FpifoTgCJlj9i4eUkBlaiBh4iXEOHBGgvqhupb2svJTkvNXImjra9d Hujw== X-Gm-Message-State: AOAM532qkTbm3mMHLAgEky7PYrjEqtdaWW2ZZjOqTFqqAe5IDQZIZc0k jfWI3nP7vNBE+tENUnMAbvsJnKtt6NtHbg== X-Google-Smtp-Source: ABdhPJyj45WrCT03llE9sGUxZAKTKxbswtuSQAx8muInqtypbnuTbcVKOKmeSmU6is6UyPS6Ent0TQ== X-Received: by 2002:ac2:43a9:: with SMTP id t9mr2742533lfl.568.1625556199657; Tue, 06 Jul 2021 00:23:19 -0700 (PDT) Received: from ixy ([109.252.117.164]) by smtp.gmail.com with ESMTPSA id b43sm1398208ljr.55.2021.07.06.00.23.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jul 2021 00:23:18 -0700 (PDT) From: Andrew Tropin To: Maxime Devos , 49419@debbugs.gnu.org Subject: Re: [bug#49419] [PATCH 1/4] home-services: Add most essential home services In-Reply-To: <9ee31c62aef0a42b15b48ece2c1d0fe765fdcc83.camel@telenet.be> References: <87y2akhiz1.fsf@trop.in> <87wnq4hivq.fsf@trop.in> <9ee31c62aef0a42b15b48ece2c1d0fe765fdcc83.camel@telenet.be> Date: Tue, 06 Jul 2021 10:23:15 +0300 Message-ID: <878s2jsy70.fsf@trop.in> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 49419 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain Maxime Devos writes: > Hi, > > Andrew Tropin schreef op ma 05-07-2021 om 18:37 [+0300]: >> + (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))))) > > Why are you using @@ here? 'open-input-pipe', 'read-delimited' and 'remove' > are exported variables, so you can just use @ instead of the magic evil @@ > operator. Addressed the issue with the following patch. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-toberebased-home-services-Use-instead-of.patch Content-Transfer-Encoding: quoted-printable Content-Description: patch changing @@ to @ From=2027998096bf5b4ccd1c66ef71c1280faf0e11be72 Mon Sep 17 00:00:00 2001 From: Andrew Tropin Date: Mon, 5 Jul 2021 19:22:40 +0300 Subject: [PATCH] (toberebased) home-services: Use @ instead of @@ =2D-- gnu/home-services.scm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gnu/home-services.scm b/gnu/home-services.scm index a06cd72459..78e5603edf 100644 =2D-- a/gnu/home-services.scm +++ b/gnu/home-services.scm @@ -280,15 +280,15 @@ extended with one gexp."))) (readlink he-path) #f)))) (if (file-exists? (he-init-file new-home)) =2D (let* ((port ((@@ (ice-9 popen) open-input-pipe) + (let* ((port ((@ (ice-9 popen) open-input-pipe) (format #f "source ~a && env" (he-init-file new-home)))) =2D (result ((@@ (ice-9 rdelim) read-delimited) "" port)) + (result ((@ (ice-9 rdelim) read-delimited) "" port)) (vars (map (lambda (x) (let ((si (string-index x #\=3D))) (cons (string-take x si) (string-drop x (1+ si))))) =2D ((@@ (srfi srfi-1) remove) + ((@ (srfi srfi-1) remove) string-null? (string-split result #\newline))))) (close-port port) @@ -340,7 +340,7 @@ with one gexp, but many times, and all gexps must be id= empotent."))) (define (equal-regulars? file1 file2) "Check if FILE1 and FILE2 are bit for bit identical." (let* ((cmp-binary #$(file-append =2D (@@ (gnu packages base) diffutils) "/bin/c= mp")) + (@ (gnu packages base) diffutils) "/bin/cmp"= )) (status (system* cmp-binary file1 file2))) (=3D status 0))) =20 =2D-=20 2.32.0 --=-=-= Content-Type: text/plain I can use different methods to attach/prepare/send patches and reply to the reviews, sorry for any inconveniences in advance) I'll stick to some approach, once I'll practice a few of them. --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJDBAEBCgAtFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmDkBOMPHGFuZHJld0B0 cm9wLmluAAoJECII0glYwd6wgsAP/2YH58b0q9Rwo1pA5CpCUrbFL5YdMvnt+Xxg KMssxCwcFWAdXj8sDGULjlU/QzyErBuFaCscUJN0pQNL1Ku3/+9oDVyAKNei94UN YMY5fX3Fa54VyU2IMItSN7n+fQM0BqEX9h0qplB+4V/NdIy5LedDz7N4WtNMY9B3 DH+co6rkaWWvzUnrUQigHSVzKLmqs4WWo+joa04RVumdmqiGCHAteNSS9dzaq28I PKVFBj5uW6e9BCWaj5rFYYJJ901NbYQ1LrN0OaIemDfxg1fOB1vZigbQdPMJHLlc Qy3rvXGG1WewT+fN5x+QUx2TpPIzmZvOh/UBjkGbJvmrxlSotMG+Ewyq1422VXGa zAoK8H+Pbi5VycffCLp4suKq/1m6TpRM6TFYOc+Toz2tRKKwzgVTq1Ry9ygwsYTz a8Ow/Apk+wS97iTztjrET0119AQG3yHAp4lhXctfHN3g18mw9wekebJnbGjdGi8E in/S3bhenElchbIHoujOOr5SjYdUX1H7EJZbaWizsFJLJJn9wl/AHgazxzFYRzfA pv6bZzFigWPeD+9Io9wKpLu69cp0i+kmqNWDVUNspyrGrUZJueXLzjnLpiOmkK/W xtMhPAfzw3UKecsq7fSl+O7vgS0opWsFHSB/I6hARxCWZHpe5koy0DqOB75GfbrJ YKB45Xfx =5gVZ -----END PGP SIGNATURE----- --==-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 06 04:26:36 2021 Received: (at 49419) by debbugs.gnu.org; 6 Jul 2021 08:26:37 +0000 Received: from localhost ([127.0.0.1]:47241 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0gPc-0006xM-Op for submit@debbugs.gnu.org; Tue, 06 Jul 2021 04:26:36 -0400 Received: from andre.telenet-ops.be ([195.130.132.53]:35564) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0gPa-0006xB-CL for 49419@debbugs.gnu.org; Tue, 06 Jul 2021 04:26:35 -0400 Received: from butterfly.local ([188.189.183.17]) by andre.telenet-ops.be with bizsmtp id RkSY250050NwAes01kSYdW; Tue, 06 Jul 2021 10:26:33 +0200 Message-ID: <886f64b82885530b655dbc619255a1a86eb15f8a.camel@telenet.be> Subject: Re: [bug#49419] [PATCH 1/4] home-services: Add most essential home services From: Maxime Devos To: Andrew Tropin , 49419@debbugs.gnu.org Date: Tue, 06 Jul 2021 10:26:31 +0200 In-Reply-To: <87im1nhq9t.fsf@trop.in> References: <87y2akhiz1.fsf@trop.in> <87wnq4hivq.fsf@trop.in> <9ee31c62aef0a42b15b48ece2c1d0fe765fdcc83.camel@telenet.be> <87mtr0hgx0.fsf@trop.in> <6b465d9991c15eb9fc9f8def6aa3293a872352c1.camel@telenet.be> <87im1nhq9t.fsf@trop.in> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-AKx809G3dPTIVijCuBcq" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1625559993; bh=Bj8W3kKa4h14StRMAZu93Kjxl9HGgygD6WVQ3ye5J8M=; h=Subject:From:To:Date:In-Reply-To:References; b=SP4l5gdEwUHcKyB/Wo+J6FYeEwc5epyVbJ6jlxZNIzGBqMFt9ExuzOiQ4LHV2Sdk9 DgNvmNAfuYOdUfurQCBRHndgUgzMkgL2YaANPPeTS6JB0dhr/Kd+xbR97JXBFSEHQd ngqOAfN5oVuJPxz9KVi6uXxZ2AfrFrlxcTKij7BSOx3tDLtxdvvoMSg58PXKxEiF6L Tj+D/TgMP+wGlhYYCJZU5h+4oD2K6/8/lop41eOsUsHElTjlbXeGEdx0Jeju5HWWgT rt/hRDENK122KiPi6lNtCaaIKnpHtmxNpWB8WRBMJNaZfW2B8b+Ejd6joN9hf0sLAg Jxym+AlAOc80A== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 49419 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-AKx809G3dPTIVijCuBcq Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Andrew Tropin schreef op di 06-07-2021 om 10:09 [+0300]: > Another question: Is it better to inline or attach patches? FWIW, I can read both just fine in my e-mail application (evolution). When it's inline, I can read the patch directly but also have an option to save it somewhere. When it is attached, there is some button for =E2=80=98expanding=E2=80=99 the attachement so I can read it. B= oth work for me. I don't know about other mail applications. Greetings, Maxime. --=-AKx809G3dPTIVijCuBcq Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYOQTtxccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7jwLAP0b/7TI/JGpTswqazHP6L/QRTBi QuRtl3l7ZqfFsGzDtQEA5/z56HnhMkpP648HcjzCgjrGU+uj+vJ3+GktqMPHQAs= =j9HV -----END PGP SIGNATURE----- --=-AKx809G3dPTIVijCuBcq-- From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 13 14:17:30 2021 Received: (at submit) by debbugs.gnu.org; 13 Jul 2021 18:17:30 +0000 Received: from localhost ([127.0.0.1]:41951 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m3MyI-0000Em-81 for submit@debbugs.gnu.org; Tue, 13 Jul 2021 14:17:30 -0400 Received: from lists.gnu.org ([209.51.188.17]:40640) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m3MyF-0000Cq-Ux for submit@debbugs.gnu.org; Tue, 13 Jul 2021 14:17:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36378) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3MyE-0004BM-KK for guix-patches@gnu.org; Tue, 13 Jul 2021 14:17:27 -0400 Received: from mail-lj1-x234.google.com ([2a00:1450:4864:20::234]:36610) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m3MyA-0006X8-J3 for guix-patches@gnu.org; Tue, 13 Jul 2021 14:17:26 -0400 Received: by mail-lj1-x234.google.com with SMTP id a6so31386465ljq.3 for ; Tue, 13 Jul 2021 11:17:19 -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=5g3HnwpxvdRiWwb9eSNSiDw4/E0PBJ/itynzSZzkrP4=; b=vP8bJKMmF4VxeDB351g4L2xDxiaDGICRRjQVi6mWhyQpP/5VBIpKWzVXdLugaJjSP6 LqA5aPHTQssFNGKFvTQuAVHfJcpNGZPeZV42Eo0EjeNL1UTvAsajsNI0wepxnNh3C7mL iuHZe0xpmiLSvLegRPu+6p7dO/K7Cc0J5l7jlhpESermn308Y6bNOCrDl9vuMsyKiyVH Lv+bGTwGvyqSeDCh0HJY5k9/UNOBi1xvS7hoCRbLtGMnwey43Xu8MKpmWuXY3bykxLw5 aWFbne5mFJ//Lx/gMFFOzUrsX44Wb/MoIi5uXqS3OymPVmhg763V4V8nxdkyUs7kt+3V Aukw== 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=5g3HnwpxvdRiWwb9eSNSiDw4/E0PBJ/itynzSZzkrP4=; b=uZIL4etD8U9NsCrTQghzUdLSDMpGKMBPbWHWZFmGgTVcSvvZXDhu6MGU7BZYVV+rye aYmfsRFyBh+Lnvzi15DlwRrIthaA3s7du4bFi3PXjBA7r6/rv4+AnRT4u4rd+rSYlWeR ChlwZIpTPiaDai6WrKpa9d/61K4y5UUh4pyihzuPZL2GrDCOJC54S5chOIcBAiMKDVo7 lxxA5ce0V3v0oo4OZtCH1M0x4zGFUgW91zic6NChoB9ZSYmGx06BVoAVm5xhbCwQeOIV viTdLjVDAfgQlysqj4MbI7okSpjNdAoa+SrDsUAcWYbQD7PNpWULEBogfIbRhNRAy92S n80Q== X-Gm-Message-State: AOAM5335yp4ZgiUrpD7CiaT+Gv+VvOHkKtch1EIVnssmI3RCvoEeizOd Kee11fyIYK/2p/DiGkk5qDxBrlsI0JcwqA== X-Google-Smtp-Source: ABdhPJyVb1pKG8BnNhhwjvbKUgghyXk2mb2ocR+6vEHk998RebgnNAfB1B1rKPZ09sFm4aMzwjHhUQ== X-Received: by 2002:a2e:2405:: with SMTP id k5mr5052743ljk.259.1626200237103; Tue, 13 Jul 2021 11:17:17 -0700 (PDT) Received: from localhost (109-252-93-92.nat.spd-mgts.ru. [109.252.93.92]) by smtp.gmail.com with ESMTPSA id l7sm1513081lfg.203.2021.07.13.11.17.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jul 2021 11:17:16 -0700 (PDT) From: Andrew Tropin To: guix-patches@gnu.org Subject: [PATCH v2 0/4] Essential home services In-Reply-To: <87y2akhiz1.fsf@trop.in> Date: Tue, 13 Jul 2021 19:17:20 +0300 Message-ID: <87bl76m6b7.fsf@trop.in> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: none client-ip=2a00:1450:4864:20::234; envelope-from=andrew@trop.in; helo=mail-lj1-x234.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Changes since v1: Use @ instead of @@ Andrew Tropin (4): home-services: Add most essential home services home-services: Add home-run-on-change-service-type home-services: Add home-provenance-service-type home-services: Add fold-home-service-types function gnu/home-services.scm | 472 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 472 insertions(+) create mode 100644 gnu/home-services.scm -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 13 14:27:17 2021 Received: (at control) by debbugs.gnu.org; 13 Jul 2021 18:27:18 +0000 Received: from localhost ([127.0.0.1]:42000 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m3N7l-0000n2-N1 for submit@debbugs.gnu.org; Tue, 13 Jul 2021 14:27:17 -0400 Received: from mail-lf1-f44.google.com ([209.85.167.44]:45779) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m3N7i-0000mj-N0 for control@debbugs.gnu.org; Tue, 13 Jul 2021 14:27:16 -0400 Received: by mail-lf1-f44.google.com with SMTP id 22so21736987lfy.12 for ; Tue, 13 Jul 2021 11:27:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop-in.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:mime-version; bh=xDsO7Vl9Dc1E46OwFe2aFH2eTkSzfGkavHD55mENqS4=; b=fjgcbpNmtNvwlYBFZ2/TV0aP+4tSoM5Yz1Ya6HSDqRKko9ME+KLNSvPjTwI8h6Gz2C w1903gicAP4BX32IZzttZt3ZIUlW+hD1cSmrOepid0E+TBaWZTxCDiL4D8qkqYrONHtY cBCq+3A6vJWcOkHC4a0LeEqtZkjo0gBCPpfMdcK+nJfD9yaJ+ftTs7bhCvUuDr58dwci BCxU6YqYVvR8a5sos8gNll1syKeX9PwXgAHnkDPY5c7C5V4bS1ez7FYuvlBxKfZtv63U 28IH1iPyMCtxz62+fswOd3YChsfv6U4RuUGO21jXLf9a5+qZc4sbVntwomP8ao+9YnqP hBvA== 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:date:message-id:mime-version; bh=xDsO7Vl9Dc1E46OwFe2aFH2eTkSzfGkavHD55mENqS4=; b=JKo3SbW5txl5ghuL0lG8MaHaXlAUFNYmoJwaMlEJpqinYhMMhWrCxmq7+A0vEDH4Zs ALEZTxO9diRYLxCQ+9hdrC874yZJ346OGI7I6wgs1Ey1gCItp4d2xHiwVo3NvEGpB6wm 8Hvuu1BLqUGMnRl/apNM84V/NKkpLWZRPHhMFGTEjmyP5CeH9iesEyZo53HYy4NIUMU5 4aVZZVvEi+x+Gv/AhGQsmK71UZpmKKb736W5LoL4ImARzWCWWkcnYv9fHBVPY7PZtBcS RcT/qEoe4wgzwAtCvh/TUMROlcaPyBvc1aENVdm91eYWKKWRBidOa6QxTR9PpwTRxIj6 CMrg== X-Gm-Message-State: AOAM5337bSQjeq9vaM/Y5olzw5eDJvSFnDw/OEKwn1P+eCwmgLRkMeUX YtuwwecyJu8zmvI0pJKeoDJPrRA/G0NH5A== X-Google-Smtp-Source: ABdhPJxQ64WNB+b4tsK2QJcgOPe9g9pc4PScR7J+nLkbSperNAWn01HDfJ54GpZx+emSaMsPiNhHQg== X-Received: by 2002:a05:6512:604:: with SMTP id b4mr4596735lfe.184.1626200828432; Tue, 13 Jul 2021 11:27:08 -0700 (PDT) Received: from localhost (109-252-93-92.nat.spd-mgts.ru. [109.252.93.92]) by smtp.gmail.com with ESMTPSA id h19sm1598146ljj.23.2021.07.13.11.27.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jul 2021 11:27:08 -0700 (PDT) From: Andrew Tropin To: control@debbugs.gnu.org Subject: Merging accidentially created tickets Date: Tue, 13 Jul 2021 21:26:59 +0300 Message-ID: <87pmvmkr2k.fsf@trop.in> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) merge 49419 49546 49547 49548 49549 From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 19 13:15:27 2021 Received: (at 49419) by debbugs.gnu.org; 19 Jul 2021 17:15:27 +0000 Received: from localhost ([127.0.0.1]:60204 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m5WrW-0000JZ-Oi for submit@debbugs.gnu.org; Mon, 19 Jul 2021 13:15:26 -0400 Received: from mail-lf1-f53.google.com ([209.85.167.53]:43607) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m5WrV-0000Cp-J9 for 49419@debbugs.gnu.org; Mon, 19 Jul 2021 13:15:26 -0400 Received: by mail-lf1-f53.google.com with SMTP id f30so24893629lfv.10 for <49419@debbugs.gnu.org>; Mon, 19 Jul 2021 10:15:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop-in.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:mime-version; bh=N0sIKiEZW9HwdEwp5vG0f6MyNB6YPhE7x20t9iW3g7A=; b=P2Nlb20fHGkRf5LZC+r5gEKTylfQReREpq0AT63viN9ZwV9CQEFbBAh/AHFAJjhDcN 8X1q8/WnWY/fsjZuuyVjgOLxbNrHch3pOPOKPoHvlDdYrv5yVnibl/JTtsBGJGkOzVm2 fRmMDTHFoJzea3GU3aBUEQiQLAUXi5dkTjj1Vcwb+yP0VIPA0OBhXHjo28Vql1QpaCPj ope29m6xyjeuxaPSZPcQoMXYjAsOxVOC4zItUiJhHicbg5JgnX/3z+86D63wXQDvLKZg LXVPLkAlaO9qeDbmth6/I2LboTqSV912Q9b1zWuuyaU9pqj0qUbhlX2E+hKZFd69FW6Z xxlQ== 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:date:message-id:mime-version; bh=N0sIKiEZW9HwdEwp5vG0f6MyNB6YPhE7x20t9iW3g7A=; b=ulyKXvFrkSAe3zz/4yGUOVH5tkXa7vAAxsD58BBD+RPtStSUtgj7xs95AkScvQpEZK kdM7stAUi4F68ljw+gXC8vuYSjuE7LyzfcrdJfpEWf0DsK+xGbSAkz42QLlT6wfDDVSX wvi+1Rj/maCuQk12KZg1vkdcfUj2CNqbVXUMuuW2icuDPyCTkJnZUnqiF5a8XZbY5Tp9 nKphyDvb5SMtSNuVPdOUDa5TFM/kwGIcLjcQofZhQ3xcW1l15mh6ATjMqFJmvZR9AeYO ptc/CjJ/zN0Z9NT7QVHmfys+77lHEWAborYSr3kIOxv7iUcSo9mRlKqqLTb3dVc30tN4 Jlew== X-Gm-Message-State: AOAM532fuIjyV6kz9QyLkZI6TyApF5vyLkfGU+gIIXpoNx5dn891/EaD 3Kx9ugMVcMxSS0vJVSjAHXX9fM3jlZlucQ== X-Google-Smtp-Source: ABdhPJy+bvr8h6Ai5QFnDgRQqXOrVtP2gwsIjNE+i0WVfombgDtQ6uhWpDxusAujOQ6htaDA7mnn8Q== X-Received: by 2002:a19:6d01:: with SMTP id i1mr18926886lfc.422.1626714919069; Mon, 19 Jul 2021 10:15:19 -0700 (PDT) Received: from localhost ([85.249.24.60]) by smtp.gmail.com with ESMTPSA id t18sm1345092lfk.54.2021.07.19.10.15.17 for <49419@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Jul 2021 10:15:18 -0700 (PDT) From: Andrew Tropin To: 49419@debbugs.gnu.org Subject: [PATCH v3 0/4] Essential home services Date: Mon, 19 Jul 2021 11:04:01 +0300 Message-ID: <87v956g1g5.fsf@trop.in> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: 1.1 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Diff with v2: Prevents unecessary calls to system* Please, when review finished, apply against guix-home-wip branch. Andrew Tropin (4): home-services: Add most essential home services home-services: Add home-run-on-change-service-type home-services: Add home-provenance-service-type home-services: Add fold-home-servi [...] Content analysis details: (1.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_NONE SPF: sender does not publish an SPF Record 1.1 DATE_IN_PAST_06_12 Date: is 6 to 12 hours before Received: date 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.167.53 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.167.53 listed in list.dnswl.org] X-Debbugs-Envelope-To: 49419 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.1 (/) --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Diff with v2: Prevents unecessary calls to system* Please, when review finished, apply against guix-home-wip branch. Andrew Tropin (4): home-services: Add most essential home services home-services: Add home-run-on-change-service-type home-services: Add home-provenance-service-type home-services: Add fold-home-service-types function gnu/home-services.scm | 477 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 477 insertions(+) create mode 100644 gnu/home-services.scm =2D-=20 2.32.0 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJDBAEBCgAtFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmD1NaoPHGFuZHJld0B0 cm9wLmluAAoJECII0glYwd6wwj8P/jeXT/IFM9lgtSkUcbFs+hEsgmTiwwolgNZq 5Uw8+r8gu+xBA6O3emVaDueU4EqQSpskgrYq7OQg0bu4nULvvDBMCC00pDpN+8zF X9JD28MBfN7s+bWcu3PgXYFuRBF/hr6S1Vq/HBUfdZUNWi6CUee/XvXWwsTY4Ob7 PBuD+tD2MMe8qNmHI/+wLDnKSCQTZK5j0oCNZtgPik8zjOx82FqEW5ahCrjjkWgC USe3RWTFLoNvjwAFP7lJS6EQvg0T3RL1dEYxul7qFXjyS+TMr2yW/vnBB9GpY0fC akD2g9dUoUB/HXKQpZVJP5HZzGfWuCMfNh2ja4YAdM9OkGYNAxWBRikdsOsyOuN7 syZLQRdOdWZol4isLYwWUfoeNu2EcYuw0XdmoUMM6jKwBqx/ybd8hNrHX7iHz7qu lYPyOJ3gLC82UC+7XiQZE5vZnw0DbOLvckd9LeeDiSQKwHWBb88ye4y7r9FlnI+S aU2Vd7SJ7Qdg4GSYmIA2Vz+G2CiUV3TM3vi0NYVziMSQIIvgLtkhA05gE44uUIm/ mlM94rKKoEeBni4DaHK1e+htJLRfwiMLJL4ODEG1T61NZVHnB+TExrHd6KYh96Eg kUL7DStwYJOR1qvFLu7uqLz9cQpCqNwtURBsWJJ/DmFhEMuKxqxNRfmJABbEzxjo IBucrAH9 =REso -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 19 13:15:33 2021 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 To: 49419@debbugs.gnu.org Subject: [PATCH v3 1/4] home-services: Add most essential home services 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 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: 4.1 (++++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: 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 proc [...] Content analysis details: (4.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 2.1 DATE_IN_PAST_96_XX Date: is 96 hours or more before Received: date 0.0 SPF_NONE SPF: sender does not publish an SPF Record 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: yoctocell.xyz (xyz)] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.167.46 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.167.46 listed in list.dnswl.org] X-Debbugs-Envelope-To: 49419 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 3.1 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: 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 proc [...] Content analysis details: (3.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.167.46 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.167.46 listed in list.dnswl.org] 2.1 DATE_IN_PAST_96_XX Date: is 96 hours or more before Received: date 0.0 SPF_NONE SPF: sender does not publish an SPF Record 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: yoctocell.xyz (xyz)] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable home-service-type is a root of home services DAG. home-profile-service-type is almost the same as profile-service-type, at le= ast 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 progr= am, 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 h= ome 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 crea= tes links for various dotfiles (like $XDG_CONFIG_HOME/$APP/...) to store, but is possible to implement alternative approaches like read-only home from Julie= n'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: =2D 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. =2D Sets GUIX_NEW_HOME and possibly GUIX_OLD_HOME vars to paths in the stor= e. Later those variables can be used by activation gexps, for example by symlink-manager or run-on-change services. =2D Run all activation gexps provided by other home services. =2D-- 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 =2D-- /dev/null +++ b/gnu/home-services.scm @@ -0,0 +1,328 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright =C2=A9 2021 Andrew Tropin +;;; Copyright =C2=A9 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 th= ose + ;; 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 transforma= tions) + (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-environme= nt"))) + (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 interac= tively + (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 #\=3D))) + (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."))) + =2D-=20 2.32.0 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJDBAEBCgAtFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmD1NnEPHGFuZHJld0B0 cm9wLmluAAoJECII0glYwd6wKj0P/1yJqD1Co76x/igTqNPHhMpJLsQKUHjm3CyD DsxZwnO+UuMA3by1lXaBTAyic66yHmnPgE7IPz4pozwAE2Xva8ABBqdPVaexMJzP 0/tQ/gCo3/QNhU1buCzh8NGVkXXiPhwl0m1mf0OGCRGokrR3igYOaFOpmhHxFqhk y6SBOu4/dtiIgtr2RpmXdqEQXz+PrPjDm45R2ECAKiPrMmxJ7gxEa9wg8j1f5MAV 2ZA6iibuOEszlxsmBS4BMCRy3bqxrX4PH5zGiUJpnTlE8adbYYszl8ZsWfv0uKeA EJ3jLxr5djLvKwWkNEHPsjP9LEoAdW5pkcz/5MYVu8vws7ipKuHJlG2BdNtjHKFz jbgQbPKkwJm9+W81rIUoOCUloe6rcfWYIE6UUH5xiMtd7xRv5xqyF60YUfLOgKKi KR5D6a+pFpZdErdfF3wLYTbdGkGEw+FdC7x8OWUmpXWWBoyX4V44Tqd5o5eQ7c7l OM2559idBWCNT7BV+ycYrpksV3YTUlK8qMk5vxO8MRKfhRGAOYN9sYwpziksjk0J ahaMNpcgaXlSbAHOlwUmdT6LuHCZsdm8r1cmN99ztQpnOlLPxB8/QXoTijNBb/ja NIVghlpSaTt6YItOV8gT5gWf5kKDpuVUs4CnezV+fzigQJhKGweel79ZtBHOA4ud LSK5fIIb =5c5Y -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 19 13:15:37 2021 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 To: 49419@debbugs.gnu.org Subject: [PATCH v3 2/4] home-services: Add home-run-on-change-service-type 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 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: 2.1 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: 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 [...] Content analysis details: (2.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 2.1 DATE_IN_PAST_96_XX Date: is 96 hours or more before Received: date 0.0 SPF_NONE SPF: sender does not publish an SPF Record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.167.51 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.167.51 listed in list.dnswl.org] X-Debbugs-Envelope-To: 49419 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.1 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: 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 [...] Content analysis details: (1.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.167.51 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.167.51 listed in list.dnswl.org] 2.1 DATE_IN_PAST_96_XX Date: is 96 hours or more before Received: date 0.0 SPF_NONE SPF: sender does not publish an SPF Record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Service allows to trigger actions during activation if file or directory specified by pattern is changed. =2D-- 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 =2D-- 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 =2D home-activation-service-type) + home-activation-service-type + home-run-on-change-service-type) =20 #:re-export (service service-type @@ -326,3 +327,100 @@ directory. @command{activate} script automatically c= alled during reconfiguration or generation switching. This service can be extended with one gexp, but many times, and all gexps must be idempotent."))) =20 + +;;; +;;; 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 + ((=3D (stat:ino stats1) (stat:ino stats2)) #t) + ((not (=3D (stat:size stats1) (stat:size stats2))) #f) + + (else (=3D (system* cmp-binary file1 file2) 0))))) + + (define (equal-symlinks? symlink1 symlink2) + "Check if SYMLINK1 and SYMLINK2 are pointing to the same target." + (string=3D? (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=3D? file ".") + (string=3D? 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."))) =2D-=20 2.32.0 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJDBAEBCgAtFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmD1NpUPHGFuZHJld0B0 cm9wLmluAAoJECII0glYwd6wl0QP/0TbNHav4kQ7KiQKF9M3HPWz3qNeLMO+SgBs MGx/1kApFVTrph8Ua2u17IRKlvxggxzrj2wOjHgs5z0pauMx7s2sdKQ4ficHIEqv wuTdo5xI0/eWkYY+fBVd3ErYtSUxv3uqZz5SgJUeq/rUtCul7u1EC0bTDn95aLwX 6NDcb9AwuWCdKUKF+VBODMvdsc4ve34oddlYbVFA7ct6SP8O7KclcUl/p69CHwND UCzSOrq6D3Nt2pOqbwjLnmhWQr+nJFIoLqRlqf0sBxZBMX6YNk37QqEygVuzvfCZ vuszh1yjfDggbgd0DeUqAiVI03KO9QgO1Xr1ZlmUOJsdhqy1xqdG8ifu4hoBc2Cb bcLxj/7Ei6/u3p8+Ls95n9i/C3ir/gGXtyBcNBnYJoPEL7rOEJGstv4VMNF8cMR1 12PAzO5edQbLFaMNLGhKyOncQPDQshQJWaAr7oybXG7GoyJ3uPmWLBSJi+8lLAUi jbmn8GIrY1x9KyFpVNznjkQ90FQpCAJQwCO0vKnPErhisA4FyKR7NA2d/1Z2djnX sGQNU04j1JA8TkYNsW6o+WKXkaUqugZGBfc3460MGFBaqA0DNqvj5lisXpRb3R7T xZIorW8/rojQGqNTQr4qogX5RTQo1I0FoUuHgLvDJ3BA+EAA33zgwlsXzkntXSC8 nU9CQUD/ =J3I4 -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 19 13:15:41 2021 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 To: 49419@debbugs.gnu.org Subject: [PATCH v3 3/4] home-services: Add home-provenance-service-type 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 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: 2.1 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * 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( [...] Content analysis details: (2.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 2.1 DATE_IN_PAST_96_XX Date: is 96 hours or more before Received: date 0.0 SPF_NONE SPF: sender does not publish an SPF Record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.208.174 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.208.174 listed in wl.mailspike.net] X-Debbugs-Envelope-To: 49419 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.1 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * 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( [...] Content analysis details: (1.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.208.174 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.208.174 listed in list.dnswl.org] 2.1 DATE_IN_PAST_96_XX Date: is 96 hours or more before Received: date 0.0 SPF_NONE SPF: sender does not publish an SPF Record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable * gnu/home-services.scm (home-provenance-service-type, sexp->home-provenanc= e, home-provenance): New variables. =2D-- 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 =2D-- 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 =2D home-run-on-change-service-type) + home-run-on-change-service-type + home-provenance-service-type + + fold-home-service-types) =20 #:re-export (service service-type @@ -424,3 +427,25 @@ G-expressions to run if the specified files have chang= ed 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) =2D-=20 2.32.0 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJDBAEBCgAtFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmD1NroPHGFuZHJld0B0 cm9wLmluAAoJECII0glYwd6wlcUP/jiO4UrQ/hKe0FdL7bJZ7m27MvvA1Kqudb6c LxDWsYDywZla8t9BSNhNZvH0iwKCnKuOr0mP4+aO1nGZ1qXSB1oQ+pLBw/kvXVAi DSxYFmo3YCZIvIxJLuewz7OlyoRsA7AHFMsgZIyATTbQKo2TggjM8IZwtEFRWqLP LI30Y1zutLyLrHP6t/1BGozam/wq7db03/UuBtngINP44EUhKc/yezDVUBcotila hKHqxJGHD6qniDZf77FZXiytjLRqlgQaEZQ8vMmwX6N5geDIfcnZNUoE+aZ4YQCS XDlW3Nq+J0MxMzqtu5maGF+LoQFJ0LDDao8ryw/qasUi0U0hrA0DGkKwDPlNCcer LaxEL3KbzjuFUC6cISzNUUd/HOt0Fl+Ri2oBjHWTGs7QTUKecu5Yj9zW47beAtaG pH9AQgUHu/rd95OrqOT+i+8AXRcaLAbXELAu1Lcgupdwmu/N6vHLV+f7W6CS7arx XXBhqv9hwmUs4VoYr8JRQt7JdAKaHhnqCicaqKZHAX+bhwxzKcQqyydSIvYrBpP3 1qiiMBJt7S4mHIDBorIw34gS9CasQPgkiU3ItPuVHFDm8lljYdIQ8p9hV6tlRzZZ M127UjSd8yhx/bSUMMF+WZMiYiJSo/Q4JSXkNigRYwakOvXFF5SnMcMw9QkjBZYy L9cuLKsp =bg7c -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 19 13:15:47 2021 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 To: 49419@debbugs.gnu.org Subject: [PATCH v3 4/4] home-services: Add fold-home-service-types function 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 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: 2.1 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * 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 ++++++++++++ [...] Content analysis details: (2.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 2.1 DATE_IN_PAST_96_XX Date: is 96 hours or more before Received: date 0.0 SPF_NONE SPF: sender does not publish an SPF Record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.208.179 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.208.179 listed in list.dnswl.org] X-Debbugs-Envelope-To: 49419 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.1 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * 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 ++++++++++++ [...] Content analysis details: (1.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.208.179 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.208.179 listed in list.dnswl.org] 2.1 DATE_IN_PAST_96_XX Date: is 96 hours or more before Received: date 0.0 SPF_NONE SPF: sender does not publish an SPF Record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable * gnu/home-services.scm (parent-directory, %guix-home-root-directory, %service-type-path, all-home-service-modules, fold-home-service-types): New variables. =2D-- 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 =2D-- a/gnu/home-services.scm +++ b/gnu/home-services.scm @@ -449,3 +449,29 @@ environment, and its configuration file, when availabl= e."))) =20 (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.sc= m")))) + +(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))) =2D-=20 2.32.0 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJDBAEBCgAtFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmD1Nt4PHGFuZHJld0B0 cm9wLmluAAoJECII0glYwd6wAa8P/iV63UYsf+PUc8z+kUAjP3jvCCEvF3SGuuw7 7eZEMFXScQThWecZYlaUlBKWZEizgWpYHbE3TEdqR2dltARWmsWyxsjZ8VkfCa3b 2PfVeVQfE4qBMqgjCmiNYYWpE8iuSi0Fm2TADrpOwXxjJbTZTAUVwX5+yQa1eiN5 mGjBbr0BTvm/dY84XzPcGmKczRX2xJ9xhh8JBR55PaGq1cyI4EIOLN/64sfS2jBv XwNHN1EBQJTGCPCcmqhbdU/x5Bsz+0p6FwJH+teZIhbjJhfQtaXfq7Cnr3Y5Rty5 ONigtsIMalKmZ0F94XDwlYoTTFpGdtTGK4kZQ4G2qVksWu28ERVIS/Xg5X/oLbpJ XIxpvg0KrKldoPciD7Vlqwh4fBC9YFWBggKh/iFWckjYsshoVNLbeTgyBDkDWMDO DOvyfY66LDXuUsLbaRVJ+eRqZlD/nWKWeYBVDLyLiXDtleDkny4Q7urd9sb4yf2C SZ4osEcT3I7zqYvUEVpecZI6E8BqUSs8RtSTvEWw0IG/CDf0y70AwTBR7ze+8Y5e R7J7Gs4Y8jDMK++Io885BCS++L+37oZwBxUo3quzxodbUn7im3w2CfZsReB3BxLc bFZYiErIa8uYQYIoFTpHDLL2a6mZi9/SUCvf8ZWhZqd0wKtryfaW49aPQr6ulob2 zNpJD4Q4 =0zO+ -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 21 11:09:24 2021 Received: (at 49419) by debbugs.gnu.org; 21 Jul 2021 15:09:24 +0000 Received: from localhost ([127.0.0.1]:38289 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m6Dqe-00085c-6r for submit@debbugs.gnu.org; Wed, 21 Jul 2021 11:09:24 -0400 Received: from eggs.gnu.org ([209.51.188.92]:58474) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m6Dqc-00085N-Gk for 49419@debbugs.gnu.org; Wed, 21 Jul 2021 11:09:23 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:51006) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m6DqV-0000V9-Ln; Wed, 21 Jul 2021 11:09:17 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=45274 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m6DqG-0007O4-LQ; Wed, 21 Jul 2021 11:09:07 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Andrew Tropin Subject: Re: bug#49419: [PATCH 0/4] Essential home services References: <87y2akhiz1.fsf@trop.in> <87v956g1g5.fsf@trop.in> Date: Wed, 21 Jul 2021 17:08:55 +0200 In-Reply-To: <87v956g1g5.fsf@trop.in> (Andrew Tropin's message of "Mon, 19 Jul 2021 11:04:01 +0300") Message-ID: <87im13g0vs.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 49419 Cc: 49419@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi Andrew, Andrew Tropin skribis: > Diff with v2: Prevents unecessary calls to system* > > Please, when review finished, apply against guix-home-wip branch. > > Andrew Tropin (4): > home-services: Add most essential home services > home-services: Add home-run-on-change-service-type > home-services: Add home-provenance-service-type > home-services: Add fold-home-service-types function Thanks for sending this first patch series! How would you like to proceed? Sending patches that add essential services, and then (guix scripts home =E2=80=A6) modules? I agree we should apply it all in =E2=80=98wip-guix-home=E2=80=99 for now. Some general comments: =E2=80=A2 Please remove tabs from Scheme files. =E2=80=A2 Please do not write documentation in commit logs. For example, patch #1 explains the different service types, but to me, that=E2=80=99d belong in a comment or (better yet) in a section of the manual. For commit logs, we use ChangeLog style: https://guix.gnu.org/manual/en/html_node/Submitting-Patches.html It=E2=80=99s OK if you don=E2=80=99t get the fine points right from the= start, committers can tweak it for you. :-) =E2=80=A2 When there are tests or documentation, add them in the commit t= hat adds the corresponding functionality. =E2=80=A2 Regarding module names: what about putting everything in the (g= nu home =E2=80=A6) name space. For services, I wonder if we could simply = use (gnu services home), for the essential services, and other (gnu services =E2=80=A6) module, but that assumes some code can be shared be= tween System and Home. Thoughts? I=E2=80=99ll look at the actual patches later, but I invite others to chime= in too. :-) Thanks! Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 28 01:38:26 2021 Received: (at 49419) by debbugs.gnu.org; 28 Jul 2021 05:38:26 +0000 Received: from localhost ([127.0.0.1]:54447 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m8cGv-0001zi-MV for submit@debbugs.gnu.org; Wed, 28 Jul 2021 01:38:26 -0400 Received: from mail-lj1-f173.google.com ([209.85.208.173]:36781) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m8cGr-0001zT-Nn for 49419@debbugs.gnu.org; Wed, 28 Jul 2021 01:38:24 -0400 Received: by mail-lj1-f173.google.com with SMTP id r23so1663700lji.3 for <49419@debbugs.gnu.org>; Tue, 27 Jul 2021 22:38:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop-in.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:in-reply-to:date:message-id:mime-version; bh=rLNzPXGzxqFeWKkG6BQzm8lBTIA7JU1hfA9F6mKjIOg=; b=QM21ddI8j5Q2TAWs+NZ5XWPUtQUR+mNlUlHxgTDw/UBDGYEbYeNPLVeK+EY7D/j0FW jh27aEgDGPG3e02PmEPgafASxW3yHmKlIMWZHfgIZjluDlxDedle9nKLaz+kM61RVZjq +CVUlko1yg/XfeHWM2g7N6cUHnJKYqdRxRc4Q0W/6j0IzDfYnjRPMfLFIMiiS10oUTwh meUMBYnJvl9NWW9j2jgYasmX0t6eG9mjPBjeCWkG7+x4PKIMjn6AKEkwWBLlnpLGNqvl GDF7pZOtGkYwzxNRFygmHRGZYvQKYcscEIEKCQVM+DpfVerN9bWdEPUR2YpmAHXQUmq1 N3ZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:date:message-id :mime-version; bh=rLNzPXGzxqFeWKkG6BQzm8lBTIA7JU1hfA9F6mKjIOg=; b=DDd/wgxyDTCNX+YCpse2Eowg3sNSieU3q8oV7uFzUj+Tk6mkN41SrjAj+6CLIleskl 6b/+62J8REZoJjNLlSsrvotgYeO1v4pRInaJccMW1RejMcoUbg4/qNmS5DTDwb+nNvGo 9dtreTj0dSMzd9vLsJOOYVY8r5MDDYnkzQnTxAhI3IGFT+EQr16XxiErBLvpMJ8yTY7G Qkw5SG/oK/h9uQahcqnau/PHMPROU+dcM+sBkMXBRbv6xzO3RKxkaj8fyXJ+uTQli9d3 VI8F5EeV1C6LyWvz8wYkJpML3Wopq7WcPYa1kCop4HofaQkf/OYtJUahiANwq3ApzPOf BGSA== X-Gm-Message-State: AOAM531h1UpuA+VUaO8Iz+3OFPtXjjXSZJ6NQN1XqZXv3gzMOczRg6Pj Qqo7pWybUb/e1y6rRLoUmv13wQ== X-Google-Smtp-Source: ABdhPJyrMrsozWWB+KpQtqQqVvms8k4OJIwu5TkbeBx/n+QluYRhGTscJXWgZ18KSGeejVwbc+JHuQ== X-Received: by 2002:a2e:9c58:: with SMTP id t24mr17328512ljj.411.1627450695520; Tue, 27 Jul 2021 22:38:15 -0700 (PDT) Received: from localhost ([109.252.93.92]) by smtp.gmail.com with ESMTPSA id s21sm428545lji.57.2021.07.27.22.38.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Jul 2021 22:38:14 -0700 (PDT) From: Andrew Tropin To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: bug#49419: [PATCH 0/4] Essential home services In-Reply-To: <87im13g0vs.fsf_-_@gnu.org> Date: Wed, 28 Jul 2021 08:35:59 +0300 Message-ID: <87lf5rj8zk.fsf@trop.in> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 49419 Cc: 49419@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Ludovic Court=C3=A8s writes: > Hi Andrew, > > Andrew Tropin skribis: > >> Diff with v2: Prevents unecessary calls to system* >> >> Please, when review finished, apply against guix-home-wip branch. >> >> Andrew Tropin (4): >> home-services: Add most essential home services >> home-services: Add home-run-on-change-service-type >> home-services: Add home-provenance-service-type >> home-services: Add fold-home-service-types function > > Thanks for sending this first patch series! > > How would you like to proceed? Sending patches that add essential > services, and then (guix scripts home =E2=80=A6) modules? Yep. > I agree we should apply it all in =E2=80=98wip-guix-home=E2=80=99 for now. > > Some general comments: > > =E2=80=A2 Please remove tabs from Scheme files. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-toberebased-gnu-home-services-Untabify-a-file.patch Content-Transfer-Encoding: quoted-printable From=2026bfd8052d90650abc7e5ec6dbb7dd7165dfba3c Mon Sep 17 00:00:00 2001 From: Andrew Tropin Date: Wed, 28 Jul 2021 08:22:20 +0300 Subject: [PATCH] (toberebased) gnu: home-services: Untabify a file =2D-- gnu/home-services.scm | 80 +++++++++++++++++++++---------------------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/gnu/home-services.scm b/gnu/home-services.scm index 9afb70f0a7..94f0ccff7a 100644 =2D-- a/gnu/home-services.scm +++ b/gnu/home-services.scm @@ -33,10 +33,10 @@ #:use-module (ice-9 match) =20 #:export (home-service-type =2D home-profile-service-type =2D home-environment-variables-service-type =2D home-files-service-type =2D home-run-on-first-login-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 home-run-on-change-service-type home-provenance-service-type @@ -44,8 +44,8 @@ fold-home-service-types) =20 #:re-export (service =2D service-type =2D service-extension)) + service-type + service-extension)) =20 ;;; Comment: ;;; @@ -76,7 +76,7 @@ directory containing the given entries." (extensions '()) (compose identity) (extend home-derivation) =2D (default-value '()) + (default-value '()) (description "Build the home environment top-level directory, which in turn refers to everything the home environment needs: its @@ -130,12 +130,12 @@ exported." (fold (lambda (x acc) (when (equal? (car x) (car acc)) =2D (warning =2D (G_ "duplicate definition for `~a' environment variable ~%") (car x))) + (warning + (G_ "duplicate definition for `~a' environment variable ~%") (ca= r x))) x) (cons "" "") (sort vars (lambda (a b) =2D (stringsetup-environment-script))) (compose concatenate) (extend append) =2D (default-value '()) + (default-value '()) (description "Set the environment variables."))) =20 (define (files->files-directory files) @@ -227,7 +227,7 @@ directory containing FILES." files-entry))) (compose concatenate) (extend append) =2D (default-value '()) + (default-value '()) (description "Configuration files for programs that will be put in @file{~/.guix-home/files}."))) =20 @@ -235,32 +235,32 @@ will be put in @file{~/.guix-home/files}."))) (gexp->script "on-first-login" #~(let* ((xdg-runtime-dir (or (getenv "XDG_RUNTIME_DIR") =2D (format #f "/run/user/~a" (getuid)))) =2D (flag-file-path (string-append =2D xdg-runtime-dir "/on-first-login-executed")) =2D (touch (lambda (file-name) =2D (call-with-output-file file-name (const #t))))) + (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)) =2D (begin #$@gexps (touch flag-file-path)))))) + (begin #$@gexps (touch flag-file-path)))))) =20 (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)) =2D (return `(("on-first-login" ,on-first-login))))) + (return `(("on-first-login" ,on-first-login))))) =20 (define home-run-on-first-login-service-type (service-type (name 'home-run-on-first-login) (extensions (list (service-extension =2D home-service-type + home-service-type on-first-login-script-entry))) (compose identity) (extend compute-on-first-login-script) =2D (default-value #f) + (default-value #f) (description "Run gexps on first user login. Can be extended with one gexp."))) =20 @@ -281,18 +281,18 @@ extended with one gexp."))) #f)))) (if (file-exists? (he-init-file new-home)) (let* ((port ((@ (ice-9 popen) open-input-pipe) =2D (format #f "source ~a && env" + (format #f "source ~a && env" (he-init-file new-home)))) =2D (result ((@ (ice-9 rdelim) read-delimited) "" port)) =2D (vars (map (lambda (x) + (result ((@ (ice-9 rdelim) read-delimited) "" port)) + (vars (map (lambda (x) (let ((si (string-index x #\=3D))) (cons (string-take x si) (string-drop x (1+ si))))) =2D ((@ (srfi srfi-1) remove) =2D string-null? + ((@ (srfi srfi-1) remove) + string-null? (string-split result #\newline))))) =2D (close-port port) =2D (map (lambda (x) (setenv (car x) (cdr x))) vars) + (close-port port) + (map (lambda (x) (setenv (car x) (cdr x))) vars) =20 (setenv "GUIX_NEW_HOME" new-home) (setenv "GUIX_OLD_HOME" old-home) @@ -319,11 +319,11 @@ in the home environment directory." (service-type (name 'home-activation) (extensions (list (service-extension =2D home-service-type + home-service-type activation-script-entry))) (compose identity) (extend compute-activation-script) =2D (default-value #f) + (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 =2D-=20 2.32.0 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable > =E2=80=A2 Please do not write documentation in commit logs. For example, > patch #1 explains the different service types, but to me, that=E2=80= =99d > belong in a comment or (better yet) in a section of the manual. For > commit logs, we use ChangeLog style: > > https://guix.gnu.org/manual/en/html_node/Submitting-Patches.html > > It=E2=80=99s OK if you don=E2=80=99t get the fine points right from t= he start, > committers can tweak it for you. :-) True, I forgot to add ChangeLog style parts to first two patches. The rest of commit message originally was just an explanation for reviewers to provide a context, but yep it's already looks like a documentation) > > =E2=80=A2 When there are tests or documentation, add them in the commit t= hat > adds the corresponding functionality. Wanted to add documentation with a separate patch series to make patch series to wip-guix-home be smaller and easier for review, but probably you are right, I should add related documentation in the same series. > =E2=80=A2 Regarding module names: what about putting everything in the = (gnu > home =E2=80=A6) name space. For services, I wonder if we could simpl= y use > (gnu services home), for the essential services, and other (gnu > services =E2=80=A6) module, but that assumes some code can be shared = between > System and Home. Thoughts? There was a thread on rde-devel about moving home services to (gnu services ...), in the second half of the first response I provided some arguments against this change. https://lists.sr.ht/~abcdw/rde-devel/%3C87y2cqifpx.fsf%40yoctocell.xyz%3E However, I can miss some niceties, so I still open for discussion if you think that arguments from the thread isn't valid anymore or not valid at all. > I=E2=80=99ll look at the actual patches later, but I invite others to chi= me in > too. :-) Cool, I'll wait for the review of the code and will prepare a new version of patch series after that. Thank you for the comments! --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJDBAEBCgAtFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmEA7L8PHGFuZHJld0B0 cm9wLmluAAoJECII0glYwd6wBtIP/3+dnU+LlveSU43SjRWkPBPNnRvf9E0NIZ2f RJFTiknp4tswLeVbZAgURYuLUNtWgxWc4JTM5gK1n7U+/BAHZ2sKlrnQ9i6hQmAJ DapGJti+taseiW52jvaUJMA/G7i05hSk96lrNgsX1ngMljwSUPX3kF8+t0U25uzd rSVF8cfij1D39xOvrz1P3p6KQ/C26o0RlJNdBpQ1m691h2hCvSN69NYmvloXf7Yl SJvJgM2byTso9Udp67G32nmvDBEdep7ZQsKoC+3LNCN+8OkkPkaJ+9WAjlx6v0d1 vGHxQMCyWneaaDEhmnm+xSaQ85rHlRVSnHUGaUt3/4DLZoaMBCWaVBi7fKGeZ2/x QoV4suDPcSAa4RFyiet3tbKApFhc0yAMLKTxi/nxDP3F5uDBKmkm37XRWkDwXcpm wjWOrw9EW2PSbxAPH/wgVCZYmaYlO7Ks+HCWuqCIPGbba2/aaxo61z0VyvBBe8og pSAI7+O1e1ccKMYwSA2TMrsM6Foo2Ma9PYGvyFElsXWQS7Elkx/UIYYBbdS8iFsw yKxluQbt0zgMmKfsu7F9f0NoyDJOjc6EKxBOHPDiDEnpLw8m2BM6+sp38zDNzDmz dxDiqdOpRKuBH1t/0F7Ct1ogPMDRnKtxDSKt9JWLV8nAizrWWmQU0YZ6sudybzwC zI5nwjze =p5iR -----END PGP SIGNATURE----- --==-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 05 01:48:17 2021 Received: (at 49419) by debbugs.gnu.org; 5 Aug 2021 05:48:17 +0000 Received: from localhost ([127.0.0.1]:45635 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mBWEq-0006le-VN for submit@debbugs.gnu.org; Thu, 05 Aug 2021 01:48:17 -0400 Received: from mail-lj1-f170.google.com ([209.85.208.170]:36448) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mBWEp-0006lQ-36 for 49419@debbugs.gnu.org; Thu, 05 Aug 2021 01:48:15 -0400 Received: by mail-lj1-f170.google.com with SMTP id y7so5538507ljp.3 for <49419@debbugs.gnu.org>; Wed, 04 Aug 2021 22:48:14 -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:references:date:message-id:mime-version; bh=U3HKKY/+CGTZ7Blhbqt45wjx8/I1YyFrfM4JMGkZcDc=; b=vQMSVdwBQKo9PrQsGcC0QNQzTK0oVlRtc4VlBvtpt5bdhMYLmJGGu95lBPBdzNS7Dw 5s7Dx1wTSAg+/9TRxHFJaLndHkiFS7LXaNX7EP933z0IWFwgZjSg1dZKDs7geOHTfdaG B/6zzir/pYNneBa9Xbk+HYKgwhIG4+aefPwV/xaglGVx/OsSy9kbrK4Vu+qltmt+MuBD uJAMMku9XaECBxbAyfe73XRwSBqPpVQxRyCghY+Ck1Nqe5PXvcUqTINlhGWFhadPn4GI DHpNqhWYWiK40nx3up0UbZyE4CfjWq8KttELTkqa9QFwACa3hU1G4YO1sjBSSYtt18ay lRuA== 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:references:date :message-id:mime-version; bh=U3HKKY/+CGTZ7Blhbqt45wjx8/I1YyFrfM4JMGkZcDc=; b=OpCvkoM7NuGbrbyk7AeJuD1QARjoNa3ohawLGZmJkkon0izHOVSkK9Nxo/V5OEWQqf WmExX5Udg3PK+CY+BhMcLQwHhW6bRPs1owpLSpD3XMOcGGmGr2S1qNBVKqz84JP6bm6B fqrM29fmg5XDgINZTlzgbvrOuXRUw85HbeJXtdSACV2JXF7W0NeYr019gIsOHISYkjZm Gd5II4UVP7fkK3bFgn5fPF+ziZScMEGkOE54opj53x/yp96BuEqoXVIJDUIvmb6U7Ge2 UqSihzRrnTasvF9zt7jvg8E9owNK8u7IjLeeMaPhf+I+MX4JQgJnZE9T/W5ewyP7hGc/ PPeg== X-Gm-Message-State: AOAM532ha+ggn+gvpPA1rPVtBx5/0tJqui1NpPlKhrsaqjQyXVQ6cmqY U+uyWkUG228FB0OJvECLxyzs7CVH5mbOQzUV X-Google-Smtp-Source: ABdhPJyDpDu0+NmFh5dLlukKE+qsHyK8jHrGzM0gI4lxrLkhQAs2fb19v1dS1WF+Kl9UT4HdiG3RYA== X-Received: by 2002:a2e:581a:: with SMTP id m26mr2014517ljb.120.1628142488583; Wed, 04 Aug 2021 22:48:08 -0700 (PDT) Received: from localhost ([109.252.93.92]) by smtp.gmail.com with ESMTPSA id t4sm403552lfl.23.2021.08.04.22.48.07 for <49419@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Aug 2021 22:48:07 -0700 (PDT) From: Andrew Tropin To: 49419@debbugs.gnu.org Subject: [PATCH v4 0/4] Essential home services In-Reply-To: References: <87y2akhiz1.fsf@trop.in> Date: Thu, 05 Aug 2021 08:41:43 +0300 Message-ID: <87tuk4mors.fsf@trop.in> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 49419 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Seems there is no additional comments about implementation, so I just send cosmetical changes treating comments from previous reviews. Changes since v3: =2D Remove tabs. =2D Move Home Services explanation from commit message to comment. =2D Add missing ChangeLog-style commit body. Andrew Tropin (4): home-services: Add most essential home services home-services: Add home-run-on-change-service-type home-services: Add home-provenance-service-type home-services: Add fold-home-service-types function gnu/home-services.scm | 520 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 520 insertions(+) create mode 100644 gnu/home-services.scm =2D-=20 2.32.0 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJDBAEBCgAtFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmELehgPHGFuZHJld0B0 cm9wLmluAAoJECII0glYwd6wze4P/RUwwZCDsUD7s9K91ZZw5TYB53DSselwYYnu jcJi9PmHyrSI3ZwEmCuaQUJBvSubo6sdspucxCLVn8VXrXU0KbED5fm8AjSphwkH OA96THL/UM2li3gnvXDPzoR+kG1qumRRmnUb/a4w42G8V01sjTeLXkbBudoKw6SR t2VL5wxlOaYE1Vx3HhZl8SXgMv1V/C7gq7dGAhJl61j7BKfG743m0AVB6ImS1zE4 uqL9hool4X9yfGvf0NDreFff2swmGrDKIHbCAmGlfPfI1qc4UZu1jhY8JMtZebDr KCKCy5SyQNP8Ue8jhzStvaOGWtoFPVtve6qziwzhUD78NePX+hgL41hYK7JNYav4 MZe0Sd83txWhwAKg0UEYQWCFlqNKNxDU02B6pQgxgFPZ7NjU5PKWsthj/eBFVacY BmAUnpfVhP6itXH05mPU99J6QY9tThWC0DkS+Km4gJqi5sttE9bzmgJHdrrJoBsw 01EBjfC7dlGeVzWaecvjcpC1P0DoFL55mbJ/EhEgagc4793A6RT8JgfT34gVzZCE QLwEj2OqnSxCw0LtBwzjwF2jokhsTX1u7ubSjHFd+47fd1O8IQRpdKXfDeqQ2USp M7H+une9aYRGegOmQGkbABOgFJfy/0jTl6pAI/WkYm1U7bLJDILM+9QMpitxzQD7 rDxgfbxK =W/mt -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 05 01:48:21 2021 Received: (at 49419) by debbugs.gnu.org; 5 Aug 2021 05:48:22 +0000 Received: from localhost ([127.0.0.1]:45638 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mBWEv-0006lw-58 for submit@debbugs.gnu.org; Thu, 05 Aug 2021 01:48:21 -0400 Received: from mail-lf1-f49.google.com ([209.85.167.49]:39786) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mBWEt-0006lU-0U for 49419@debbugs.gnu.org; Thu, 05 Aug 2021 01:48:20 -0400 Received: by mail-lf1-f49.google.com with SMTP id t9so8827830lfc.6 for <49419@debbugs.gnu.org>; Wed, 04 Aug 2021 22:48:18 -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:references:date:message-id:mime-version; bh=kYHjrgm4fUtztklEgus04dPZaqWxTVg6VLzyoxJf7SA=; b=YxfIp2TW6x7XuA4B2Q/E2nLl6gxDTaVwiKg7OlTZS+MGUNDo+AIySE6umXkvinoyx9 dxWgNKyosadEiQQh+1AImmZ6TtMfrYvstYziv9u2JPKBJ0Evwr7n1BAQcbgbAEXLIUrd HyJvIY/jMDxQ1h/yM739LhzWWz24ukkLVf3Uz+xlbDDEh5SHSQd73783ahnJxBh9qUUj 5RF/yG4McrVbziwLcmUb0bgODvL5RT/pS8WJxboToAxBO/Lgx8wnsq3Ty7fvsLC/feDD cOGVraiYQzTdBpxZjJJUGQtyDU92u4yNHUmatqBqTej8b54z1cFLc42o0opYn3Qxi/uZ wVig== 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:references:date :message-id:mime-version; bh=kYHjrgm4fUtztklEgus04dPZaqWxTVg6VLzyoxJf7SA=; b=sNfL0hdHAKPMUiEelN8s5Z81ddlO7Q7pdFyiQZ/ScbJnRnTgmKexjqCgS5f3IknMsm 4df1KYf4DNtG/T3v/5sy8/IxIcbdtBQDlU4OmhN3N4i2EK/SsWSLcJQXwgP4HQJT+/yC A1c3WAfFZDyRqjsPcOKLBzEzY8v4GF5hSS8XDtQ8liElbA/qWeVWfnxPRKAeSgyUSFbp ae9X3X4VkbB3nFKmBNNXxRY1sy0NwHIwdqnIR68fE/l4SRi1A61M6NMrlQG2x/oJgriQ r1iR9h8hdGXYSpuhj93/nvj1Mq0Koa0Re1YD2erUXYAZjWbl4DixR01Ns5kRNZVMqaxG 0yZA== X-Gm-Message-State: AOAM533B5WpNpYyYH1K3pQpoEC7FY46G7jAV6bzO+zbt4lTpJ+6rNb1M 62u74jajSDV2ADi/iPXLw52KxZKbN4NvMHvk X-Google-Smtp-Source: ABdhPJx4N/pTH8gS8hrhW5yZ4yZOg6MCYI0aLrrQeV6oPEGVFnd6jXX+QBmBXKo7AlYq8PD8BBe21A== X-Received: by 2002:ac2:5fc7:: with SMTP id q7mr2262531lfg.524.1628142492439; Wed, 04 Aug 2021 22:48:12 -0700 (PDT) Received: from localhost (109-252-93-92.nat.spd-mgts.ru. [109.252.93.92]) by smtp.gmail.com with ESMTPSA id c16sm298793ljh.98.2021.08.04.22.48.11 for <49419@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Aug 2021 22:48:11 -0700 (PDT) From: Andrew Tropin To: 49419@debbugs.gnu.org Subject: [PATCH v4 1/4] home-services: Add most essential home services In-Reply-To: <87tuk4mors.fsf@trop.in> References: <87y2akhiz1.fsf@trop.in> <87tuk4mors.fsf@trop.in> Date: Thu, 05 Aug 2021 08:45:38 +0300 Message-ID: <87pmusmol9.fsf@trop.in> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * gnu/home-services.scm (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 [...] Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_NONE SPF: sender does not publish an SPF Record 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: yoctocell.xyz (xyz)] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.167.49 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.167.49 listed in wl.mailspike.net] X-Debbugs-Envelope-To: 49419 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable * gnu/home-services.scm (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): New variables. =2D-- gnu/home-services.scm | 368 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 368 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..4a6458abec =2D-- /dev/null +++ b/gnu/home-services.scm @@ -0,0 +1,368 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright =C2=A9 2021 Andrew Tropin +;;; Copyright =C2=A9 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. +;;; +;;; 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-enviro= nment} +;;; 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 th= ose home +;;; services they have to source this script manually in their's shell *pr= ofile +;;; file (details described in the manual). +;;; +;;; home-files-service-type is similar to etc-service-type, but doesn't ex= tend +;;; home-activation, because deploy mechanism for config files is pluggabl= e and +;;; can be different for different home environments: The default one is c= alled +;;; 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 rel= ies 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 c= an set +;;; for example XDG_CONFIG_HOME and it should be respected by activation g= exp of +;;; symlink-manager. +;;; +;;; - Sets GUIX_NEW_HOME and possibly GUIX_OLD_HOME vars to paths in the s= tore. +;;; 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. +;;; +;;; 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 th= ose + ;; 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 transforma= tions) + (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 ~%") (ca= r 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-environme= nt"))) + (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 interac= tively + (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 #\=3D))) + (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."))) + =2D-=20 2.32.0 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJDBAEBCgAtFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmELewIPHGFuZHJld0B0 cm9wLmluAAoJECII0glYwd6wq5sP/06qZLWOs6kZeLLXPzXW/AVyBalLXk+dfbey lHpjen64CG5mU6QP2XI+R8YnaeQnZ4fi9wEFU2JI7uXp+xy8n53UpMRWIv6UnO47 Tw5waFjMtCM8SkFbORxPHCpJ9a9nEPki9tVZTUvNwMAf+DyM9tB/15wA1WsoklbW e5bj7dVR+Vl399PnKFccfQYAknaBF61yEtk/U+PBvGRivvXG12+hj48CO+5Gv1we 3u14z7iKwuJmiZgBcCrXJhx0/4lIhd1lC+0wxKLvHfiEjfam79FSNg0Age8q1Kfv ZkjaaeiUahZ+Xrb9wW+Nb/oWFLfOSC2ZHvj+PTgqv67CYG8TLOgK5V/RbgS00wio 66q8V8kSDuTXOB9OI0UCZZ8HMY7u4lX9IdezTJoWL5DUknjhd0His2RQRTr3ds2e mQolBJVjJICWgkBmHgemU1C4uxqpT+eSNWACdtb2FfsRM4B197ehEYzjvt4ojzNp Kmt/+0OanYAOoEyVScTQMyhxXo0PaKX6vuqTAhFbqocLE+BxN4caG/DYy/M+g4wm B76oksZVn6zmiMk3iQHrdtx2+NBvaOSSyXoeoYF4un/pI5FxQlaN5q/mqJxf9rN5 ilb8JorQovJ8nbzOts8PHo4fg7sTU1T1nlDziPcVpJX7z0mst2m2d0w+jEB5xHWu Oppk+7Hn =5TXb -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 05 01:48:24 2021 Received: (at 49419) by debbugs.gnu.org; 5 Aug 2021 05:48:24 +0000 Received: from localhost ([127.0.0.1]:45641 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mBWEx-0006mB-Ul for submit@debbugs.gnu.org; Thu, 05 Aug 2021 01:48:24 -0400 Received: from mail-lf1-f53.google.com ([209.85.167.53]:46673) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mBWEw-0006ld-61 for 49419@debbugs.gnu.org; Thu, 05 Aug 2021 01:48:22 -0400 Received: by mail-lf1-f53.google.com with SMTP id n17so6144869lft.13 for <49419@debbugs.gnu.org>; Wed, 04 Aug 2021 22:48: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:references:date:message-id:mime-version; bh=YlAzzSc+mdsxWuVnzk3GnyglD9z4SEk3pY2qS7tWLcg=; b=UcbkQCoQ3EizV+TlbZBDsq/VvdgOr9jOsz40hH+aP6qdnkgZkBtrZ/UYZwJWH0Ru7c Jxq169HKsB/aYVWCcIOBtE1+l/KWRjrMwv2nDeEqyn50Nc2ApK5ZFBj5kdnfbYUNmCuv XLeIauI4ioQSl2/f3s+pUMROroO9zZa2tvc/et3kFUxZCEJb8DxIcCQmSyB67TosQGJU ZsBVpXmH8pVD7vBI30sTwj7IIGp8dDX1O3bFVP4AXv5Fc83SeTZw76rD+Cx30Tk+Bs3A GlFYaBOdbPMcfadlfkWrd471CPj8Ziyj57mdqD8T1wek0GjE6I9N9hwQPaLc9UIasG08 2TaA== 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:references:date :message-id:mime-version; bh=YlAzzSc+mdsxWuVnzk3GnyglD9z4SEk3pY2qS7tWLcg=; b=lMLJVCorCtPrU1Xb/gOXdZgqKb6Q01aWNeYbeOBv6wlIteDx90jL5xNy02m9XgbNaY rCguSz2ziKmIBZbaimeL7vDY9n7AR7/pfKGX9kn4AwS0JWfUdiYzNi8p4CeM22iLotsq F1NYDJEWRbZCdXnFDwBWPILfYEGl/lwon/3dTTzU/fwfDRS95mINlV4WphdSUTfEr6Wp 8TFh0zBlUV1y0/LrdKPro6Wnse1jhEgX0XbJpakB6eiHGE6l8Kf/GtL1G28U4THfV+X3 yqbynyfYpNXtY1oZxdKhsXdZBepblsso0n1zBrMw7uq37f0R3jWHUfkuGqQpMPiS+Sw4 Lbew== X-Gm-Message-State: AOAM531VecMfZuqtGCb1lvSunh5NIhL+aGtGS6uYXCnSMmQRyYMAbyVi d5HtV+vxRmzr9Svyb2H6ayYelKm808zbpYX6 X-Google-Smtp-Source: ABdhPJz39VQoM2yIZgGrdaBNDh4h7csKuWcUfL2AZBDYn5l9SMz1Zxy8R+d+TkihlCXig7pgZ2FWjQ== X-Received: by 2002:ac2:4150:: with SMTP id c16mr2305289lfi.127.1628142496105; Wed, 04 Aug 2021 22:48:16 -0700 (PDT) Received: from localhost ([109.252.93.92]) by smtp.gmail.com with ESMTPSA id j10sm401306lfk.286.2021.08.04.22.48.15 for <49419@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Aug 2021 22:48:15 -0700 (PDT) From: Andrew Tropin To: 49419@debbugs.gnu.org Subject: [PATCH v4 2/4] home-services: Add home-run-on-change-service-type In-Reply-To: <87tuk4mors.fsf@trop.in> References: <87y2akhiz1.fsf@trop.in> <87tuk4mors.fsf@trop.in> Date: Thu, 05 Aug 2021 08:46:22 +0300 Message-ID: <87mtpwmok1.fsf@trop.in> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 49419 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable * gnu/home-services.scm (home-run-on-change-service-type): New variable. =2D-- gnu/home-services.scm | 103 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 102 insertions(+), 1 deletion(-) diff --git a/gnu/home-services.scm b/gnu/home-services.scm index 4a6458abec..32b59f55df 100644 =2D-- 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 =2D home-activation-service-type) + home-activation-service-type + home-run-on-change-service-type) =20 #:re-export (service service-type @@ -92,6 +93,9 @@ ;;; ;;; - Run all activation gexps provided by other home services. ;;; +;;; home-run-on-change-service-type allows to trigger actions during +;;; activation if file or directory specified by pattern is changed. +;;; ;;; Code: =20 =20 @@ -366,3 +370,100 @@ directory. @command{activate} script automatically c= alled during reconfiguration or generation switching. This service can be extended with one gexp, but many times, and all gexps must be idempotent."))) =20 + +;;; +;;; 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 + ((=3D (stat:ino stats1) (stat:ino stats2)) #t) + ((not (=3D (stat:size stats1) (stat:size stats2))) #f) + + (else (=3D (system* cmp-binary file1 file2) 0))))) + + (define (equal-symlinks? symlink1 symlink2) + "Check if SYMLINK1 and SYMLINK2 are pointing to the same target." + (string=3D? (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=3D? file ".") + (string=3D? 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."))) =2D-=20 2.32.0 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJDBAEBCgAtFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmELey4PHGFuZHJld0B0 cm9wLmluAAoJECII0glYwd6wBiUP/i7ILAYn7hh1SE8feonHznL7sbUOZqosToMy rXfI3XIW8xGQr3Br4rDzWnYSgPYVnrBYzibzBV7K8Wl6oNhQNARneHKAsgNNEPXN yLkzc1IDsHtcF8MGOZ4/2ANvyckkS6u0xz3/P0qjlsP60Zew5fGvMJb/+MFthq5+ 4hynnDk8XuRlQN/4qq6Zwhr7Mgzuaq9n8L7IyVusWYmgh4M2WviOzTlST01Q/2ta XgaRJ6XNz0QtP0dLNaIG+5LEVSfxtZfVW5/xVBxo+VRhNG8i/adTnsAcL+/gpFiy lDiblx+nrwwk6ybuk8ms+QlR0FSE5j4Oz6NQglsZ+JMZe8JqvGZoZs+lL6ZaIWMH JAaZfWLJhZRxaCX9Kej3Z9TsKweR/ettYZHPRXFc+5AlolPUUB0IppUPQJYxg+jn Idcd8P893GUqHcEp6m7Bz5aotIGuMGumWECw3pXiMGOYx9vfjlCr32u3J/fqy2cg zzF3nFyEejCa+SZp3d/uzkBPuFabzhy+/uaxXk8aXlyBCUk/w9ZCjqtb0eqpnrGd tbdSkz/R7XhDgJlgoK/st5bidP/pCRR1lRmBoUR/4imZzO6WCwxIp2rUjb268rh2 sZsf7iOX00Gg1NlPACPIwJwa6IS0lce8V0gRgxOnCm+AsdIn8u+6/oFa65emyU1S W2ljCkCO =WGSU -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 05 01:48:28 2021 Received: (at 49419) by debbugs.gnu.org; 5 Aug 2021 05:48:28 +0000 Received: from localhost ([127.0.0.1]:45644 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mBWF2-0006mS-At for submit@debbugs.gnu.org; Thu, 05 Aug 2021 01:48:28 -0400 Received: from mail-lf1-f41.google.com ([209.85.167.41]:33615) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mBWF1-0006lx-4Q for 49419@debbugs.gnu.org; Thu, 05 Aug 2021 01:48:27 -0400 Received: by mail-lf1-f41.google.com with SMTP id p38so8936078lfa.0 for <49419@debbugs.gnu.org>; Wed, 04 Aug 2021 22:48:27 -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:references:date:message-id:mime-version; bh=snZ4ZNwtRzA2+DvxEtESiaS3qrykzVqCJe6xThrel2w=; b=UMJENF2b6HXZO3WwdyFqM0qf8RsKRJiZ7AYtmWiAyI7dtxyUBsrUwy5DtscpCJLky4 Vu3vioFFr5hll/7dykl1oj/XAc/RfaoLDGzN/kqFWTJlMIalUhX/XwXFGx7jxt6Bfj4+ QZ7kkA9ylE81AcKPdwXPlct8XF1mtLZ+ipN0B6ZJt8bLtGme8DKsIifVNsU3+B2g4OQe au8VgxT9Ci6vDogcwmtXRdz/ekzLpTLoJEJPa8CLwn2UikBl2xnfaDM/n7nRDGCSxWKK O1S7WDL98JFvAM/Yv41xz6+UQy+1DAeoV8ZnTo8lOcfVCu5wgG9jlZcv7JSI29Cy/oey 8nMw== 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:references:date :message-id:mime-version; bh=snZ4ZNwtRzA2+DvxEtESiaS3qrykzVqCJe6xThrel2w=; b=Ho9XSRH5fLvHvHPKZxL0B79IzGe8eAtOqSdDn3ktvewOeqarzTun53v2dkUpgE9G6J 2CpqJVbcCdJTgnmgH8wzCJ8hmyU25JUo4x64YVt04VcHH4PT5idLo1L9lUjmhToQHj5b XnLiOmZWPQfFffpm19UkiR9h5H23cCNNKJ2ksJhJayzUzw5qnpuU9N2lk9x5otldA23B xAKLgsUQ+edPmQ2JgI9s1pZPmoNCeQ/GuwkMjvC0Tgz7VKJIuas58Z9UoXvwAo1kTBPO i8tx/5OF8tBLmhvnUhRhb93UGeF9Pae7KRH7jsj5FIlrlxlaON8fGR0p/tYzNsAjHVj4 MQrw== X-Gm-Message-State: AOAM533CDrn/NWYyVnzNY6z2F2zioVU8nlj4I50CAqRp9VBWmuN1A1Tu o9g66If5iZHUAG3xpT1Ando7SshWdbzC8EPB X-Google-Smtp-Source: ABdhPJz0fWli93xb/8+Q6VU4tbl7h9xDR19Ily9RyjoB55cvkk8kESO7y8qDyXBzzccHz/bbxYk8hQ== X-Received: by 2002:ac2:4c0d:: with SMTP id t13mr2289892lfq.118.1628142501090; Wed, 04 Aug 2021 22:48: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 l21sm320046ljc.94.2021.08.04.22.48.19 for <49419@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Aug 2021 22:48:20 -0700 (PDT) From: Andrew Tropin To: 49419@debbugs.gnu.org Subject: [PATCH v4 3/4] home-services: Add home-provenance-service-type In-Reply-To: <87tuk4mors.fsf@trop.in> References: <87y2akhiz1.fsf@trop.in> <87tuk4mors.fsf@trop.in> Date: Thu, 05 Aug 2021 08:46:58 +0300 Message-ID: <87k0l0moj1.fsf@trop.in> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 49419 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable * gnu/home-services.scm (home-provenance-service-type, sexp->home-provenanc= e, home-provenance): New variables. =2D-- 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 32b59f55df..d320d3a44d 100644 =2D-- 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 =2D home-run-on-change-service-type) + home-run-on-change-service-type + home-provenance-service-type + + fold-home-service-types) =20 #:re-export (service service-type @@ -467,3 +470,25 @@ G-expressions to run if the specified files have chang= ed 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) =2D-=20 2.32.0 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJDBAEBCgAtFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmELe1IPHGFuZHJld0B0 cm9wLmluAAoJECII0glYwd6wbLcP/iEJTPV0B59ezPSYYCYTTNQaijU6wJTfkXkf 1MB9DnQLK0eVnTrmPzSNW18BNiwrbJKA3BUcnw1u7+Ht23FvArKb7t0m0A/rbQtw PkH8HEJMPFlGKOY/speO6dIH6c64b9f4erCLWh/If63w7ojAudp/y2faj632NhdH ntAqTwzbmd8a6SkaXtEXjE5HRzoWThUmCvI+Zr4LJ3WxGBY6hFzxKiTAljyRWgnH XEkCJUvWHJkh4+4U9Ih+3NagFbrBWzed1XTz97PgSYgrzkzG2OTVA6ElKwWPJAZG 6VThrBnGmyjMP28nN+wd0v7wnLu65hFs5SQhAVgBg72BkjW5EDTPFd0CnV254mh5 2pS59vWBTdShjlv4okNhqF972Ja87qKyZNgG063XW8g1w4ylfYy3g3L/FZHSjvKb 0OrMwl4/Xw8YcHrZF+F42ZAYgoCp3lxeSHp95On2m2IlacVTOJ4f6KIURmpZI9OT 4bdUZsM7Uvpwlit/G759onYZK4tCOX40b4+UhVUEHdcCz0O1o+r/J1BIBZ3DcDrA 1G4c38V9K0Ch5yNDprW0DsinA/51bgXlkjGAuMx/Vqp/2sZCSJN82w2q1vrysD/v baKtyUWW0QoMy7TPHjYYm8RvZkZTiDtDaNGaeesEPQP4LHwD6AwijYfLAs/rhUEr suCiQ8j9 =6vmB -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 05 01:48:31 2021 Received: (at 49419) by debbugs.gnu.org; 5 Aug 2021 05:48:31 +0000 Received: from localhost ([127.0.0.1]:45647 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mBWF5-0006mh-Hp for submit@debbugs.gnu.org; Thu, 05 Aug 2021 01:48:31 -0400 Received: from mail-lj1-f172.google.com ([209.85.208.172]:35573) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mBWF4-0006mJ-MA for 49419@debbugs.gnu.org; Thu, 05 Aug 2021 01:48:31 -0400 Received: by mail-lj1-f172.google.com with SMTP id x9so3562683ljj.2 for <49419@debbugs.gnu.org>; Wed, 04 Aug 2021 22:48: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:references:date:message-id:mime-version; bh=8S15RKfEMo4F0g5qCAJ7N/QpXm9mgOVxmPG0QA0WzY0=; b=SFaXmQaeOCe3sbAh57shejRH3nJfDvnUAunBzzwyZM3AvGHRn0pJu4HdxM1/5TKSks tqewJWKgGZreOKIqnMaR6q2uF5MmtLnSlJJP/ftxdjDNV6GtBheNigJhTID9lyS4ZF0L 5t5iD82FfmRNHHNIZGY7M0N2kyQBJ+78VRUYgKmQy7BQa9YZF04nqk+Tcw0pWpuEgrd+ XAEq+tOsM7g8w8r+R/EctfNoFxZ6c1+IKv9yAPWMBMdsbo6MSdpRsMEGGeRj4H4EoUzJ dBftxAWxY2D/WQ638fRdyyacVDJ3Xoeat10OGsbGWIWzFDfpyXWLSpmD66mdVTJDnxKs KZBQ== 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:references:date :message-id:mime-version; bh=8S15RKfEMo4F0g5qCAJ7N/QpXm9mgOVxmPG0QA0WzY0=; b=UtPxBCPEFzSQYxTBP+kLOIoolc8pW67bFTFZ/ONGnqnmBIK+PQtAS76fTiefMCKIUI TumwgruP/KpKkR/Dt1SS792JcoCwQxUhM8CcSeScT+8xRr7mApSInIV75zxm/TRFfrUI M8sBFkacxVkBDAw1zjCOscenpYMBheiKFo59Xm00KvE6TTCSZvlQh0YfUIqkSYwjkB6J GVmtGCuhk8km4cBsAgCCj+o/bsz1IeeXJ/lJb6/HiMF/p0QtZpymF22DK02otaOI34xJ U7OiDgKA6qdnJuKkLtVRGegihDNfI6rlxTgaW3yHAumt88oBq59ZO/5Fx2gMlG7As2bP 9MEA== X-Gm-Message-State: AOAM532PySDcgkZMAAfsOe+p6Sfp2U5aLYYOz/Y53+UwW71Avo1qNCYN qQ/dM7V0HtU+LYy0T2sl2G6B0hjz2RIwbn9u X-Google-Smtp-Source: ABdhPJzjQjzqVNb+5q9aNDSbtKXOEweo8MEl4DqrHJEISahC0V7nncidMChwdILr3t3VfEclruhnWQ== X-Received: by 2002:a2e:890a:: with SMTP id d10mr2086703lji.310.1628142504550; Wed, 04 Aug 2021 22:48:24 -0700 (PDT) Received: from localhost ([109.252.93.92]) by smtp.gmail.com with ESMTPSA id c13sm402663lfm.208.2021.08.04.22.48.23 for <49419@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Aug 2021 22:48:24 -0700 (PDT) From: Andrew Tropin To: 49419@debbugs.gnu.org Subject: [PATCH v4 4/4] home-services: Add fold-home-service-types function In-Reply-To: <87tuk4mors.fsf@trop.in> References: <87y2akhiz1.fsf@trop.in> <87tuk4mors.fsf@trop.in> Date: Thu, 05 Aug 2021 08:47:40 +0300 Message-ID: <87h7g4mohv.fsf@trop.in> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 49419 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable * gnu/home-services.scm (parent-directory, %guix-home-root-directory, %service-type-path, all-home-service-modules, fold-home-service-types): New variables. =2D-- gnu/home-services.scm | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/gnu/home-services.scm b/gnu/home-services.scm index d320d3a44d..16b9736d64 100644 =2D-- a/gnu/home-services.scm +++ b/gnu/home-services.scm @@ -492,3 +492,29 @@ environment, and its configuration file, when availabl= e."))) =20 (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.sc= m")))) + +(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))) =2D-=20 2.32.0 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJDBAEBCgAtFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmELe3wPHGFuZHJld0B0 cm9wLmluAAoJECII0glYwd6wWMMP+wZ4fP/zaU11arRXnWhHiFGM+4f4cY4XNW53 UWgxIYW4cqAe4U7K2UzIPQ1wBUuMpO+54l5f0qOIn629JVeEt5tvc2l8aLyHql75 BJ9u82bPk7Zk2kbWW/h7N1Anvp87PNwP2hqmpi9NSWHDHcWLyZMXUaqi099yb8BF Xyw++P9Ugy/nhE8Ml0sLLBVuJfZG0QT3dwVn/LdcqcbFM9KcmnW01ysukjSkiIXP WFxyb2W3XI5hQo/JKR15Remi8L8YudChXoVaXwRGbbgeIyuvkY+p3ocxwfHWCDjX V9BmaT4NAIjCrkA3tP0a7TrNTbJjfOdPfNg0hA7FU4IjFOYtMFmK9dnuLuTr31zQ EcsKBEyLUCj45I+lhmZ1yhbMmnrc76gR1VxwKozTEcbnizRfr0oG5Fu3mGdebha3 VeHEilLAj8QOm+bsaWfsV2TVfPkDc8ySRoIm+xzt18s0Fy3mLVv3WoFiT8XrL6sb sNJqxcjH+BUuQ1zFv4/XIwKFd5xPKHfxC/GveZsPIz2d2bCTW8WqBuveA4WQYgjk mF/T6ZHZgSwUF5DQxDDsHeReKwYEA+tUnOvyGI8UcGlaVOANm9K+7wWpLAp16jVd DrCRm6WuWD6Jbp5TyQpyGSZZKEperkuilhjbihxj6mTXTSXEcI6oDmBEzLwiW6Ez r6b4q7h/ =lxRc -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 23 05:57:57 2021 Received: (at 49419) by debbugs.gnu.org; 23 Aug 2021 09:57:57 +0000 Received: from localhost ([127.0.0.1]:40544 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mI6iK-0006nB-VQ for submit@debbugs.gnu.org; Mon, 23 Aug 2021 05:57:57 -0400 Received: from mail-lj1-f169.google.com ([209.85.208.169]:41918) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mI6iJ-0006mw-1k for 49419@debbugs.gnu.org; Mon, 23 Aug 2021 05:57:55 -0400 Received: by mail-lj1-f169.google.com with SMTP id h9so30434888ljq.8 for <49419@debbugs.gnu.org>; Mon, 23 Aug 2021 02:57:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop-in.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=kalNdAemgQrNHC3GHkPGvcGGts/pIV75ZhWznJdqGhE=; b=Sf72q7N3YeSrFckQ7mDeMZAZGpIhIJc61qRS47Gg89lwxKgSQvS3+nQGkH97C2raUQ uhtbvU/buzWg9vMG9DUpIHYAyaMQp8y0hwl/8/RxIJ6y+gwONLVG+cbf8E4H20oH9hjv IIshOVinpH/qhb+TDBBxfuJ3VGSIdie4FGNNNBdeCL/mZhKBD/zojshr+j/1eKbUXs6H ywfOm0BcLoF6D6zQbZbVNsEy5J0AVq5AfC0IOk8+FrRuzfkTOmHaPWonzFn4yW9UeNho dJtX+W/gjdR/ssq9nI0QMRfgrI9exMmdywH6pRWIaRYa41hWFmd1Y9pKrRZBnNtlhF3s bkLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=kalNdAemgQrNHC3GHkPGvcGGts/pIV75ZhWznJdqGhE=; b=KfeFmjCelAXLuDUrO/2wQkU8GcAmtarpBvthugD9qOnDbUKEFDZAw3WWG65z/Q4aSV NRul4PVZBZyX3/xmc1wqzqFVFDA0wkCQLss/JwxdI8jviS5VzkhZ1KEXjZonOcukSBwG 0XXm++rmAwPj8SjihQCQY5g7xIlxLcK2SW8m/g1hNy0qYG+Ae+ZZyGI0j5eON1nMFiSx 0dBhPziwLdmWfOkXLVaZeLbP/o0RXlWBx5E9kSmtkRIflZCzXZyRt3VCpw44EcWfRJVr sBui3e/KsB3r5PBn+NQUbpHSM/SZAzyaIytvgUF8rrJthpxOwMIYzyWyEC0la8xlS3o4 FhhQ== X-Gm-Message-State: AOAM533UfgTQjfQVe0xt6hQdbguqAwmZRreWebBUx4CDOq81OOkNWupD r8RdhEeu302y5osADV+j9M79AdCtWABbIw== X-Google-Smtp-Source: ABdhPJxJz9PPfIc+CdiR4b+ifM9byLHiJq67Fm05wT8ReAfxeskCSJnEZSLbSS1533wtUW5N4XeC9A== X-Received: by 2002:a2e:a7c7:: with SMTP id x7mr1285475ljp.406.1629712668692; Mon, 23 Aug 2021 02:57:48 -0700 (PDT) Received: from localhost (109-252-93-92.nat.spd-mgts.ru. [109.252.93.92]) by smtp.gmail.com with ESMTPSA id e8sm1418099ljj.132.2021.08.23.02.57.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Aug 2021 02:57:48 -0700 (PDT) From: Andrew Tropin To: 49419@debbugs.gnu.org Subject: Re: [PATCH v4 0/4] Essential home services In-Reply-To: <87tuk4mors.fsf@trop.in> References: <87y2akhiz1.fsf@trop.in> <87tuk4mors.fsf@trop.in> Date: Mon, 23 Aug 2021 12:57:05 +0300 Message-ID: <87h7fgbi1a.fsf@trop.in> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 49419 Cc: Ludovic =?utf-8?Q?Court=C3=A8s?= , Maxime Devos X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain On 2021-08-05 08:41, Andrew Tropin wrote: > Seems there is no additional comments about implementation, so I just > send cosmetical changes treating comments from previous reviews. > > Changes since v3: > - Remove tabs. > - Move Home Services explanation from commit message to comment. > - Add missing ChangeLog-style commit body. > > Andrew Tropin (4): > home-services: Add most essential home services > home-services: Add home-run-on-change-service-type > home-services: Add home-provenance-service-type > home-services: Add fold-home-service-types function > > gnu/home-services.scm | 520 ++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 520 insertions(+) > create mode 100644 gnu/home-services.scm Guys, review v4 patches, please. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJDBAEBCgAtFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmEjcPEPHGFuZHJld0B0 cm9wLmluAAoJECII0glYwd6wAUAP/RbYZxu119qlh9ljgBkefbKPBYV7vTm6evyK fJS5o89IWUhgdzODasLXmLOI5aDc4yy0akJDv5XBl4xmqHn/+UOAkOo+sc7+tisE YxE/Jh60p5JpnrMKGIwhQS9dXK3YfqPE/Bdq1MDIzLw1KtZmnVZA1gCkFxOiH1I/ MNgfc2bVhue9DmlW6pIjWiI/3XYzmFfr1nPED5zlFUGWrMawF4vXn2CBg2ID7aR7 eWtfXNptQzIYPl0wSHaSQK2WxF4U8LRM6hrUD+AG688O4jXw/4wx/Tpr1LGAH/gJ pVZODAuC/U0HKGY61anrIknyz3NAYFDeK7ynnFWx7XNY17SHdrQZwqJ/DwLN1tSL YRm/8fxEX5I7jeP5LWI9Ks33VkowVVHGHESeihiOlMf4uS9gNyDUaFIFMfBmXGKN frq1s+TjOu7UXV8lafg/oZ+IRNzGXcx0skEsQN5FvkS2+lKbVGIWGeqqd2To7bit 7UVPpyaYW6DTBkbmOHUBCrC/6GR63sgp5yry5IcLpv6X/imXZcQ/Iq+j98SOyDmL /0QxGF7+6QM/LOjJRjI3REKAHXJlUDhjNbGja4geWLsGBamOmeS5aBDNzWCN8Ycr pClXqvwpqmYvjm7JuaMs+JFAdmDyWEOhBCtLbTSVAGHQidTOCaIt6raoDg2mbsOt y83L1daH =XwFU -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 23 12:24:37 2021 Received: (at 49419) by debbugs.gnu.org; 23 Aug 2021 16:24:37 +0000 Received: from localhost ([127.0.0.1]:42478 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mICkW-0000Q6-QF for submit@debbugs.gnu.org; Mon, 23 Aug 2021 12:24:37 -0400 Received: from mail-lj1-f171.google.com ([209.85.208.171]:46043) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mICkU-0000Pl-TD for 49419@debbugs.gnu.org; Mon, 23 Aug 2021 12:24:36 -0400 Received: by mail-lj1-f171.google.com with SMTP id l18so24952663lji.12 for <49419@debbugs.gnu.org>; Mon, 23 Aug 2021 09:24:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=CC8a31QT3v2VkHaDetuNqiVC/9YnQJG9pWb7Pgky5/Q=; b=psTwioe7qObA57W4yguNB+QZ6k4GwkCIZ83NX47xjgofp2I9wlAstRNhzOJkYyw5iz vj8PMSCCGLDWn65ZBFJG5ihfsA3+oGi2n0GBHCvoyA7VkpaBnpUKVkocF9p/awMzRaBO TjgTivAdUVkQiAaamawPBIUbViBoMff5VzLjAIstBhirAl87vH7jQJAKHEIhPlvoRAiE 2nDbUV4w4obp2BrXnyyB2eUX5FEYk+0sK0v49V/kTVu2dMgDTDH3vmdiCyiBItzWPvGt hZAHeuGbfy1XHQ/+qxcZBp9uwVbICo6kyK0y54aB8UaOgPMTW1tWKQrJVlSIatxEQVQT KDKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=CC8a31QT3v2VkHaDetuNqiVC/9YnQJG9pWb7Pgky5/Q=; b=gbc4+JMdHdaa/iz+SWpGmZefOwflHTvmUpJZsv2E1w/WqHdGiJwkOKVeAR6/yZw8H5 rxMkNkT3hfORxvz/6ydduIiTuWGi9EkYU9caq6gz5hLFOB50B7lLLS0qJ3h4xvweb9CF 72guX89+SM4MSx/YsIkHDIsLcMqOSFP9JrXUI1yMAZYAPRS3+u771kZZmlqvOKTUspwI VUy0UYugbORCAsZv5tqV77iI/Z+asZ72Cyx7/J/EP52l3ZEbl0mvgp2baQRl7lrHN5Ne U/fqtCCY1jVc1tcx84tdaZfYdISm+D88aEssipvo+AhMgGCKeABWHQ5pLyysgIaqb2RH /QCw== X-Gm-Message-State: AOAM531b6jASvGG08vrdwyt1YVUy2C606fxBQLJ2jHTdmoK1wcHv2113 rFIKZ9P/wI08Rt7+SpJymEQ= X-Google-Smtp-Source: ABdhPJw3PXybXW5lvHBLcKwgZ7IeiTJgsMDyX7sUCEdP9VJEWiHJWTYtktze/LvzzBcvc/WcH4+zMQ== X-Received: by 2002:a05:651c:385:: with SMTP id e5mr28488520ljp.35.1629735868894; Mon, 23 Aug 2021 09:24:28 -0700 (PDT) Received: from guixsd ([88.201.161.72]) by smtp.gmail.com with ESMTPSA id a13sm1493628lfu.13.2021.08.23.09.24.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Aug 2021 09:24:28 -0700 (PDT) From: Oleg Pykhalov To: Andrew Tropin Subject: Re: bug#49419: [PATCH 0/4] Essential home services References: <87y2akhiz1.fsf@trop.in> <87tuk4mors.fsf@trop.in> <87h7fgbi1a.fsf@trop.in> Date: Mon, 23 Aug 2021 19:24:25 +0300 In-Reply-To: <87h7fgbi1a.fsf@trop.in> (Andrew Tropin's message of "Mon, 23 Aug 2021 12:57:05 +0300") Message-ID: <87h7fgxh6u.fsf_-_@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 49419 Cc: Ludovic =?utf-8?Q?Court=C3=A8s?= , Maxime Devos , 49419@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Andrew, Andrew Tropin writes: [=E2=80=A6] > Guys, review v4 patches, please. These patch series looks good for me. 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? As I remember you have an access to push. Otherwise, please, ping me to push it.< Thanks, Oleg. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJIBAEBCgAyFiEEcjhxI46s62NFSFhXFn+OpQAa+pwFAmEjy7kUHGdvLndpZ3Vz dEBnbWFpbC5jb20ACgkQFn+OpQAa+pw8sxAApf+jD9R7xO3ofAjyCgn5uzujvgsY QBu12tIkEpAREL683D1TdMudTfGbDEByARMFdreIvS6NNfZyOEJHJmaN1ENE2MsI kztOYV/S7ZDmOIfyONNo7JFjam+4a0WqKoUvU736T8V1hh6CQQYBKbL0yOJQxB2W ANjEo6TpmHEMdCQSasxylTceujebrjsy8H+xq8EQtq4+GIU3rJmTf1R3G+/BoO6/ 0MLlDjX8vRIZL0o2f7JjicdmOoLw0H2E096bZMuySeW2LxxExS+b3DNBjrTEi+Kl +s0Z9jHAqB7ohC44A9ftcs6xsoHjlcUGHCYvNk/QZz1Cj5xFk8jIfrcZFKn/F0AW T+8qAxiPpjkJ+UciOftHONxr/gBWrLiee2Jp6Edui9G2K3Anzk3C6zlRKaajNeUm 1aLpa7AMbKrJEJHi4YHlpKKjWlqm7+jSvoH3V8XK3Y0mNJzpDvU4fN7XVLfDGuzE 1F3GpqVjFy4Qsdg3Tlx8kE4Gll33k/Jb/apemsh68btFGwEZDv4jwzqCsPOWeeoC F+9bQqsMZRkAPOpbYeExW/wh+Rc8LtRUFASSHna/dIIVTD77HfgS2vF4Df0Tuwpn ZxqHeEwMkODrtsEgLPLKUqWoiXgzpCiBje0ZiovX97Uzq8ayUaAMOWAlpKpxWGSc hu/ebg8wxxLhbhQ= =9inX -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 24 04:54:19 2021 Received: (at 49419) by debbugs.gnu.org; 24 Aug 2021 08:54:19 +0000 Received: from localhost ([127.0.0.1]:43228 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mISCI-0008S1-U5 for submit@debbugs.gnu.org; Tue, 24 Aug 2021 04:54:19 -0400 Received: from mail-lj1-f174.google.com ([209.85.208.174]:36384) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mISCH-0008Rl-89 for 49419@debbugs.gnu.org; Tue, 24 Aug 2021 04:54:17 -0400 Received: by mail-lj1-f174.google.com with SMTP id y7so36361315ljp.3 for <49419@debbugs.gnu.org>; Tue, 24 Aug 2021 01:54:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop-in.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=fgf4fhM2VIdz4U2U0VIrWfZp3G7RT6p9QODp+TqV4fE=; b=lk7HRD443IcjNjLjQz3coas+tTUlGIzZlr/vcMNIXZjkvhk4do4l0m1WAv6SUV0SCn SzmDu8sRbxVaNCdoQkWQYr5jz2Fl3Ec+CHDc+xqcODwCfJq+1ABofX4vNu/r5abOqdQi fPrFOJUqM5oPZy6aIaf97EJxCb/8m7FfsrDvnGVMKMSGn3WdCbgi6Qg3LTOqlU7TcOGf FB4eufK+9o31J8RGAsWUbnB/sKCd8Eko9lXXR+lgH9mr+OFysJvZo/BgkcYAl3QzOvP7 EuOpkhabwsWcP4C4Ug5iExySFRZPu/xNktizjgqwWNyeWPGyVlRd52KX5LCZbrCD36lb OECQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=fgf4fhM2VIdz4U2U0VIrWfZp3G7RT6p9QODp+TqV4fE=; b=Xn6phpEBNhl8qZSUHGOUn01sMuHWeldiqOXOzl/nWyAKNlLz0mWwMRjFeUw3rlPMFv 0qp+f4HkHW3xnNngL63/7/icdjGP/6bOmKJM/pzaOZwBSfCvFcXx1x5qE+xPcJB3DZBO 3ShOBHBs47GpBds5+2jhAn8NjYvhTcjMu0T1B8vRPrbn5W3rF4TURsrJ+kFAVVk89qEx N2sn9OeCZDwPaSU+s1yLh43CPHa+mknyj/T5jVHlQXUhN9Wc7cmduWvLicOd9vwnGT3b Qr1wIYB8KP0vVhC95a/9vghNe8xZ3C+/tsQSk8o3mtSV264l4wznGmX21wme4ttWRWf6 5W2Q== X-Gm-Message-State: AOAM531Y9MlHZIGedMP1o2/CTipH4/vJK6BWlIfZ1rQwLN0NX00yyexx D1i91V94iruqf2v9QNXotUYmkw== X-Google-Smtp-Source: ABdhPJxMV82HG9PppI6091lRjSH5lgH383BFohxCzVVmySc9hqIlvUKUlutWKY4Bzdi+9u8KMbQMyQ== X-Received: by 2002:a05:651c:1186:: with SMTP id w6mr3762426ljo.50.1629795250995; Tue, 24 Aug 2021 01:54:10 -0700 (PDT) Received: from localhost (109-252-93-92.nat.spd-mgts.ru. [109.252.93.92]) by smtp.gmail.com with ESMTPSA id y7sm1722817ljn.26.2021.08.24.01.54.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Aug 2021 01:54:10 -0700 (PDT) From: Andrew Tropin To: Oleg Pykhalov Subject: Re: bug#49419: [PATCH 0/4] Essential home services In-Reply-To: <87h7fgxh6u.fsf_-_@gmail.com> References: <87y2akhiz1.fsf@trop.in> <87tuk4mors.fsf@trop.in> <87h7fgbi1a.fsf@trop.in> <87h7fgxh6u.fsf_-_@gmail.com> Date: Tue, 24 Aug 2021 11:53:54 +0300 Message-ID: <875yvvnrz1.fsf@trop.in> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 49419 Cc: Ludovic =?utf-8?Q?Court=C3=A8s?= , Maxime Devos , 49419@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain On 2021-08-23 19:24, Oleg Pykhalov wrote: > Hi Andrew, > Hi Oleg! > > These patch series looks good for me. > > 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. > > As I remember you have an access to push. Nope, I don't have commit access yet) > Otherwise, please, ping me to push it.< If everything seems ok, merge the changes, please. I'll prepare the next patch series soon. > > Thanks, > Oleg. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJDBAEBCgAtFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmEks6IPHGFuZHJld0B0 cm9wLmluAAoJECII0glYwd6w7WIP/0KYD7Cs9sJHmU4lOpB0wWsVm/OwLxSV13eT TRdwePTizPrIuHuSg3EJMLM0BAZxyTzy0gPg6if8PlgJVnegzZaMUoGvc4sUfkTW zw3a+l1YU4ZsrIrl2CY8cqocPJznWSZuq2uYCfXiCQ7T2xfleOIXBpMSR6a0YOTn iMGnLVsbuqDcJVsNHR09t4dIFNX3mzGjXj/PrJkU0qB5fAsk7RccvSDryi1px/y6 7YXY5F0YIgcbnaT0ZN4JlYPFkNIsHOToQo/q16qzIGcRvOINlTytx9kGXgoCBcuO 4MW0PzSleE6GpXNyJT/s6kFgNGMHJQVQYxAb9M6eMeFW5T8ifVmTJlZs6ZngooX5 GX8JcwJYWNzSEiPJTpHqZAKTV2Lt9G1/58aQWOl0BlBOj2pNZsr8lyrcDqeLnBdA 1SWeOlxgXDGZQTiLaO8TMEoJct5iH52r0PG2qzTEpnCJEb09j0DMkDNPBm4bmdqB irZ52pZ0VzwXACT/r/+Psmrdsf3JeXZuJEaRCDqae658l4YLtPDUao5jS+ozIAg9 axggyeB5lga7mukDvW6TADlbUP+swrCKFZDA0FFy7tVSl8dz33TXGa4qvOKNoxHR wbG9V7RuEpqwlkl3x2hCVkLivz1yN+KdzZEh0TwpozQ38609G1FNFKu/5ZpBmTgj Gjeb1Lzo =hfxK -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 24 08:14:39 2021 Received: (at 49419-done) by debbugs.gnu.org; 24 Aug 2021 12:14:39 +0000 Received: from localhost ([127.0.0.1]:43386 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mIVKB-0007M9-Ez for submit@debbugs.gnu.org; Tue, 24 Aug 2021 08:14:39 -0400 Received: from mail-lf1-f51.google.com ([209.85.167.51]:43904) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mIVK8-0007Lu-5E for 49419-done@debbugs.gnu.org; Tue, 24 Aug 2021 08:14:37 -0400 Received: by mail-lf1-f51.google.com with SMTP id i9so45050204lfg.10 for <49419-done@debbugs.gnu.org>; Tue, 24 Aug 2021 05:14:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=7jOZEHlyN6nOXLbmbneIHbwkRBr/eLdNFXp6/4uISys=; b=dOBi3sopH5wPxeRg7I9RvZ7m4UoaEo3xnMdis7ukRG2qBUZXDcyvn88/VbXGY98UDu XXoT7dEDsOuLuZk1kr48LRQi8mI7fJmdh3OdpjfmMntn0GLvbA1BfMr3H5n06QJ8QiyD OyXkC+sVoz7UgFGNLvONkCrM3xzUjB1FOVyNpYELn63MpLcEwBeCywL6Q4JkWmptdkcZ fNJcgKYw9HgTNf/4EQjsNT/HdK2jhuuoYOhjt6DfcVhCGk12z907DfpcunC/Vb9eNst8 rlapJ2k3Ls1SR5/+3fHwdIo2oIlmgJwXASKIqIIIRvSBUK3MqN2TQ6/h2AfGSorjnhaC mWKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=7jOZEHlyN6nOXLbmbneIHbwkRBr/eLdNFXp6/4uISys=; b=Ma7wUGV+DcVIAV+zpcqajzv1swsSOZYy8H4CXNNza1QuKo7BNSxQsfDKJfAK8AzPK1 iw5f1IHGcbnuYgTZhw7ySjrT0R2TdlJYyBTpUpPkOd9Mhzrv1RG49KC6Eg2kB1dgLh4X pIFSLdvIuPpyXT5d2gUAEKDG32WC2aAHRkHR1cX7AnJWb06XT7xLcsRmqBslF5kWgQjW MifzYADv9P+hC7Pei5I8mTWkBeRQtYMB2X58aveuMh8iKQO+9giFgqSAjJyuqZMj+3WC o4WHlS5fTc6/vGt4mOn04lzfFbyYGsgE1vOzBqMXS2PZvACJvcnc5CWxf95Gl40JNIC0 yQSQ== X-Gm-Message-State: AOAM532eBu6uDlxQ6APXYTVHpbjHrAmYuIFuFeIdgII5xU7vDB5kyd6K n0myvZXT+fS5IT2/sCaO9HzUfKwvOf4= X-Google-Smtp-Source: ABdhPJzwTqzOMU6x9ilgnw2sFIm36LO5i18ppFqbvAvyRU9JqzCWI92s8rAkKa62XDImPfmnlD6nkA== X-Received: by 2002:a05:6512:3b27:: with SMTP id f39mr27497690lfv.585.1629807269765; Tue, 24 Aug 2021 05:14:29 -0700 (PDT) Received: from guixsd ([88.201.161.72]) by smtp.gmail.com with ESMTPSA id d5sm1739522lfm.73.2021.08.24.05.14.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Aug 2021 05:14:29 -0700 (PDT) From: Oleg Pykhalov To: Andrew Tropin Subject: Re: bug#49419: [PATCH 0/4] Essential home services References: <87y2akhiz1.fsf@trop.in> <87tuk4mors.fsf@trop.in> <87h7fgbi1a.fsf@trop.in> <87h7fgxh6u.fsf_-_@gmail.com> <875yvvnrz1.fsf@trop.in> Date: Tue, 24 Aug 2021 15:14:25 +0300 In-Reply-To: <875yvvnrz1.fsf@trop.in> (Andrew Tropin's message of "Tue, 24 Aug 2021 11:53:54 +0300") Message-ID: <87h7ffujj2.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 49419-done Cc: 49419-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Andrew Tropin writes: [=E2=80=A6] >> 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=3Dwip-guix-home --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJIBAEBCgAyFiEEcjhxI46s62NFSFhXFn+OpQAa+pwFAmEk4qEUHGdvLndpZ3Vz dEBnbWFpbC5jb20ACgkQFn+OpQAa+pyYuhAAyHVQrGM+CR6TY1LRtyW3Es32Egt2 ubRyL7I9JduQUgtdKkW7Tl364P6yGUB7SIkeSoYFMSqHAmvPMyn7geUko/u1iFmb jy9PfizxhMUTRHR3pUT0qU7PYjexF9mU7kRYoT62ICjXBgq6UVEfhs9EFPC/8n0a 3HRtyIFpWWRq+Hw/KixqZ9K6XFQVZjeSzK6ll8KFSyizlipQvT5J6IN+QwhLjDIK v9BU37GoJoSkTMBG3pu+EfFNiPtR1FGRQOXBrDjZkJ+PGXQW0MVKDxTI/KTb+9/V +QAUtrcvz8d3I3dEfLJTHjsWdp6TLTUzv3X/zGUY30qy3M36/Ukbx82+OQ1dr2mg tvKwf4sdjYaG6Iod02Bkd4KZQ/rJq/nDqpzed9YJ+b4QdKDZvqVaGwtbqJO/MQLG DEUZAL9Wvr3av/wwWAnDYW3bTbR6xPuuQdnE9YrNBzldJ9G6fq1m1fEtILEx17oK ve0ImAb69CSu3R+Z3wOep9ueuohraVRuc8JiGX/Y8CY5bbtRH45Leum8aGE4EiRG qaDZmZI1dCEiP/j+VOrokgSQCsuUA57UJMqTMHmFEXsENifJ+zl2lKynM1rbxKFV vzbzmHURpQHPvpkuLZLSDyRyoanWKD/5my+ObhG/wpeF8oGs6CZqoBg71A7R5Fuf ryJyXET+LuN/PCs= =dUIt -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 26 03:02:59 2021 Received: (at 49419-done) by debbugs.gnu.org; 26 Aug 2021 07:03:00 +0000 Received: from localhost ([127.0.0.1]:48263 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mJ9Pb-00010n-Nt for submit@debbugs.gnu.org; Thu, 26 Aug 2021 03:02:59 -0400 Received: from mail-lf1-f53.google.com ([209.85.167.53]:41549) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mJ9PW-00010W-Gn for 49419-done@debbugs.gnu.org; Thu, 26 Aug 2021 03:02:54 -0400 Received: by mail-lf1-f53.google.com with SMTP id y34so4590288lfa.8 for <49419-done@debbugs.gnu.org>; Thu, 26 Aug 2021 00:02:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop-in.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=dLgVpHxUK+90/8WuD/c35aYHcw3ALIDSJA433dAuSc0=; b=Lz44abNt94r6Cj4EkBl6Ubg0RS92jTeTmJt/A9n0KGdRc1+YQk6RiTt7Dx74JnGqlB 7jeteN5iAyZra5Bdnwl76z5V5xmq0Mx9+pwAYQ06qqmc+08l7ZWCBtV+icSXIDD2P/Yh 8+S+0NrLj234pWbBOkaIVd4aTUuWuTJhzIzjUC6hFK0p6cLgb30lk2oMWnqfXIA0PSMi r4Z5F+OpIucqLYmOb1nOFeJT+XA9Z87ujxQRHFKrsicBg0TAN/VwCFWTxVdOpslj/FvU LT4ADGUaskd8AoIXe0W5yGDWghI775I1YGDGMQEMCidVPTfvhDzxbKf+4nKFnc1/I8lF Fb7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=dLgVpHxUK+90/8WuD/c35aYHcw3ALIDSJA433dAuSc0=; b=C61HMzCj+Z8hoExm9x9pOwCJa1PzG2kGYHHIgGz3aWZqRt60bo6U5Ve7wglFdUc2G1 hlARsjRlqPDpDbX4DI3AmC6pKc0LCY+CGSBpnD0BpWE4CkruzjwZsEoaD87fN84sI/0a BufvoaCEu8JvShuvh6gCmEp5NR1YVNJIjeMHhr5k2HvmoSGPeBIwpXUOlUOiuKTn1Yyv e4ooqRvM0l8PmTKj6efduavtOYwWX6fhQBbukKkMROKdybc11L6mkD0BoAynMEDbo3NH KA1ECk6o4DfZbWzDvpzIpM/8KkInXaUcYsei939M/BbKou+T7ElMv/TDytNYnftbrsMB JTMw== X-Gm-Message-State: AOAM530DBPpVpO1VW/wVqq7HwmA7HbXIAm9OgKQ32TeaeENnQFKEfaho a+g9LD5un8644lgA5ajMZlJ04A== X-Google-Smtp-Source: ABdhPJw8lYQU6b2Eg1635mOEB3dgLGExaBo7lbyGJNHXvwJDSIQL5utLPXT2opo0hY+64TLmSIwXJw== X-Received: by 2002:a05:6512:3c95:: with SMTP id h21mr1636858lfv.16.1629961364325; Thu, 26 Aug 2021 00:02:44 -0700 (PDT) Received: from localhost ([109.252.93.92]) by smtp.gmail.com with ESMTPSA id f22sm230067lfk.55.2021.08.26.00.02.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Aug 2021 00:02:43 -0700 (PDT) From: Andrew Tropin To: Oleg Pykhalov Subject: Re: bug#49419: [PATCH 0/4] Essential home services In-Reply-To: <87h7ffujj2.fsf@gmail.com> References: <87y2akhiz1.fsf@trop.in> <87tuk4mors.fsf@trop.in> <87h7fgbi1a.fsf@trop.in> <87h7fgxh6u.fsf_-_@gmail.com> <875yvvnrz1.fsf@trop.in> <87h7ffujj2.fsf@gmail.com> Date: Thu, 26 Aug 2021 10:01:28 +0300 Message-ID: <878s0obsfr.fsf@trop.in> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 49419-done Cc: 49419-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2021-08-24 15:14, Oleg Pykhalov wrote: > Andrew Tropin writes: > > [=E2=80=A6] > >>> 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=3Dwip-guix-home Thank you very much!) Sent a next patch for Guix Home. #50208 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJDBAEBCgAtFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmEnPEgPHGFuZHJld0B0 cm9wLmluAAoJECII0glYwd6wWkYQAJCI+EQQ7BtfreCXyjdskcT1qtUhfaGvU9IT uqC22kha6kSVic71jFOUSgrjlABLiuf9T9uBfKUamYVPu4zwpFMKeMBbIeKOKH14 83QIl5g4AE/KFLaT0n9U+i+n14KOJwr32uR81R6++bkVrPJCYIF4Jw9bASNgEt24 PsfLF5LgH7PinbLje9EEUNTOoNlP8ba5ReMK6H1eVTOQECK/zR9UREhzOvOXAs6a utayZtizfhXvByCtbWLhzn1eMHYXioesukSqLuaEzKFeAZDSk0JoAeEUjJ1eyPNq J+fG+pMzfDmjpOJ2fOsZqdCfubBG6Wsv79Hz/7yI2ey7dVOeS2cE0E0P7rIZa9Fn kaCAva6wIzNGTDGtfDF/RKACHVi0nCoiuY91ByxqCFNaYGTReQcciKlSossE7q/f hayrmbScXTsV6aVEjGc1kGMsd1GtXai6TbCvKUQPuRrmiDzTdpvL8/E1EN6TYph+ 2zAhTwif7SEdbqp/VjdTm17lq3tv7tZ3vuAQ333tWF0n+eF8u9T2/z+PHY8tTTku /VLbYeRkiLOWha9NfYEH+QDuGhW5urDuls9M0cGe3TMHjeZtmm6DcmFgPdQq2Dth imj/E7OycR5/O2K1Y41p7JsyVFD1LAl0PL5fXl2QNcYOa8D1/DVN7C6Zp3EhIexi JJEg7cgy =AM+3 -----END PGP SIGNATURE----- --=-=-=-- From unknown Fri Jun 20 07:19:23 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 23 Sep 2021 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator