From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 31 05:30:32 2021 Received: (at submit) by debbugs.gnu.org; 31 Aug 2021 09:30:32 +0000 Received: from localhost ([127.0.0.1]:32953 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mL068-0001zE-B0 for submit@debbugs.gnu.org; Tue, 31 Aug 2021 05:30:32 -0400 Received: from lists.gnu.org ([209.51.188.17]:53496) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mL063-0001z3-1G for submit@debbugs.gnu.org; Tue, 31 Aug 2021 05:30:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41014) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mL061-00014u-Pv for guix-patches@gnu.org; Tue, 31 Aug 2021 05:30:22 -0400 Received: from mail-lf1-x12e.google.com ([2a00:1450:4864:20::12e]:38456) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mL05z-0000SM-Ud for guix-patches@gnu.org; Tue, 31 Aug 2021 05:30:21 -0400 Received: by mail-lf1-x12e.google.com with SMTP id x27so37218373lfu.5 for ; Tue, 31 Aug 2021 02:30:17 -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=x5UkBZcqTuoo2kCjKUtqAW+MqmD0CKTWMOlw8gFe+Bc=; b=yPBzand6IpNpnm030fzgW4sACqPOFvtCf5J7KDL7xvpKzZZ0nx6KzmQxNXo20eUNWW h+vPdpjmQwZqXLn/I7HC2CGXVwL1mconbksHY7+ZoaCdluaHiqNOlGU6NmFGeXo+yMNq g/lJXYzPoV7LF0Kdb8mNe0jvEM7DifJiK4Wbn8mpu9mdHdiCaPO2vExB3+ELYPe6y8Ha uHIBBEu1vOiUKfrNYruZYFQ3f/Nyfz88FRAmBe8eNJlWEm0+TYgyUvVGjbFwVJI4/B+H ICA5510lB0KdehcqfwMPdMgbkpEVrdI0pRHGAyuBNDyvz9/G2oAxybOWlOB5BIRrTvPy 0pow== 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=x5UkBZcqTuoo2kCjKUtqAW+MqmD0CKTWMOlw8gFe+Bc=; b=iEAh9yLwDRpiAIWICoi9IvfnFmBItd6x9uVgDCLtaFriQpYCV8SyDEAdCjqQ505uWE 9dkc6ZhjZGe+dXCv39l3+Oi1iYmV1JksfgrszutC0Ta/lVFzfXllfnaVxReEoQuqhk0X mWrzjwttb75/oZ45WRmWY4xDsg/jnJ8NZnVwSpx+cS4t1d9XghrAYCKlEFae2tqoAca4 ALBNqaO6Ux6996UTiboIEfLpZ6mTJ2osmvMKytv4GUqgHPOU0pe3yWVTTZQo+V1rkEpU mHRd5lPUTnDR0WoBXTWHDafsj6ntX+/FDBjxAaPcCNOuRurksbP3Jo+oDSPhHad1X/Y1 5kXg== X-Gm-Message-State: AOAM530HRRi2brOitDcp7/mwKYKUcSbC57fJm/MkUywN+ukopUpbco/p 6Orllg5r11FK+ZLL1b7lIGS1nrVkC6jg9Q== X-Google-Smtp-Source: ABdhPJxGvxiAY8YPVR1N8/sUwNGneIBLTnUhgq46fqhgDZ+FFpDdh/t2s0Qs5EndavOn24Z+XmEQYg== X-Received: by 2002:a05:6512:31ce:: with SMTP id j14mr20428939lfe.646.1630402215412; Tue, 31 Aug 2021 02:30:15 -0700 (PDT) Received: from localhost (109-252-93-92.nat.spd-mgts.ru. [109.252.93.92]) by smtp.gmail.com with ESMTPSA id r7sm1835855lfr.60.2021.08.31.02.30.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Aug 2021 02:30:14 -0700 (PDT) From: Andrew Tropin To: guix-patches@gnu.org Subject: [PATCH 0/2] Add 'guix home' command. Date: Tue, 31 Aug 2021 12:28:12 +0300 Message-ID: <874kb6j718.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::12e; envelope-from=andrew@trop.in; helo=mail-lf1-x12e.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 Command and subbcommands allowing to manage home environment with guix. Andrew Tropin (2): scripts: Add 'guix home'. scripts: home: Add import subcommand. Makefile.am | 3 + guix/scripts/home.scm | 512 +++++++++++++++++++++++++++++++++++ guix/scripts/home/import.scm | 241 +++++++++++++++++ 3 files changed, 756 insertions(+) create mode 100644 guix/scripts/home.scm create mode 100644 guix/scripts/home/import.scm =2D-=20 2.33.0 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmEt9qMACgkQIgjSCVjB 3rBELA/+L9JbUUEgOirgg7PaeExiW9NIqkYCU0ER7cW5r6qWnDLaLh18nwrQlBUB dUk4S71OBM6SODQDrdqbJqHEuTbpdjYtFRjFE+dZ4dqlddG6XFN6KkH3aMMXUIVw oAgDlgPusxnkPOBWO4AYxEsFKcYxS6oJFwdf3j7TFoSTukzNwW4SEc696OWowJV4 OwPSREmE/SWRyJNrgXZvPVqDwp/Tsluo4NDU8CgUWnoYHBbPriyC3QycTrihf67h CqauSNf6rtqK7wHE+b+LVONSJQePdG996rnoZO8V6Ih/ZyNM0drMwYVHBN5yE6Y5 ie80caIrtusycX0PBQC7Q2/f7Pt9l0Tg5lB6dkrdR8TOVi+AfxRDk8dn+Q482uuX toJvdit1fTFNvhOudlFyHMlCWAxozy6IBXNjLdp4YTXs2EsbO38xq/u+8cPSc8St 3rEWtB99ZgJNkkiXlmgzoeaItXqLatq0+JAQJN60EUdVqv+s3x4MAx8OFHgDv5Rs TzY37HTY2CAzYfH5f1VYmVQ+PQ0Qp/mA9teNTTetowNNthpabYWkkUmf35MOl1z9 MhoSYudOp0tfnj+PAokccFkYYkauNl9WVV1UVz9icvMNsvJqE52MBTv3kt0es+qV PFfVbyBpfm71hmRAyko2dLPUkjs9wEJv4oVtER3ckYomvenACGk= =drYg -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 31 05:40:25 2021 Received: (at 50296) by debbugs.gnu.org; 31 Aug 2021 09:40:25 +0000 Received: from localhost ([127.0.0.1]:33037 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mL0Fh-0002I5-LF for submit@debbugs.gnu.org; Tue, 31 Aug 2021 05:40:25 -0400 Received: from mail-lj1-f178.google.com ([209.85.208.178]:46651) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mL0Fe-0002Hk-HA for 50296@debbugs.gnu.org; Tue, 31 Aug 2021 05:40:20 -0400 Received: by mail-lj1-f178.google.com with SMTP id w4so30587269ljh.13 for <50296@debbugs.gnu.org>; Tue, 31 Aug 2021 02:40: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=eRT8tu2JMXfXmCkZMx8xGCJYjVQCMHKC54rb79kNExs=; b=LCj2vfIFzE3DM3PaKU0gQjBVVZK/ehEhwWGgkGHqoXn5j/8WlJMhlrYrk0VlY58fYz Hhkqe9KPFFPBww+hxVxDha6Tva0/HxmX4yMn+xbvj3Dsox+xcGQXiitkqGPFkvtaWYxj Ha2TWXQ5oCctbDItHmTO2hFqGqbhmIm2dHQmX8cl5oe2drWq6vyfZHrGWfYdXEitaASZ PF5z2bvspCDevG4P84C97SaMmI55rhu6oAAIa7lsRzKKWJ2Yq6cIE2cReyf4KZWTRdHQ n/c1FoCz3HZic5fv+ucOqK8djyZuE8i9vmfIbNhAxNy0tMRYlAqMjMgGxvg0JZ78mt+Z 2H3w== 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=eRT8tu2JMXfXmCkZMx8xGCJYjVQCMHKC54rb79kNExs=; b=cBA8yjEbJTvhu9xXl6Cw/adtcf4+vqM105OrTdX8tWCSiEelSpjcQ9UTenBDyEHVTK 7wvZVMyZoiWV/KkOpLxPcg99RIeK5kujeN3nibXVhuILkhF92Y3vtUJo+3eB95Xe/SEF FHBWjem8AnOaDbQJBT8SoKCq74BSsDHadS3fkw78tpE9aB9TmgTjkZ9PMpZUAUA2BX78 ypxajB9BfHx+1ijJ9gLYD8v7g9YHgRrpXPp5psy4yMNyckjHTJKF2UOmx5UewJFAU85A R4o9ERi2o9X+5oyO4folueieebpYvWU4ToC+v9yG0g+0ANRiNHeT2JAs4fY9MfIs4lf3 +yUQ== X-Gm-Message-State: AOAM531ul+Sp1SzERX0KqjialxASdP6kyjSF2gSrkXwWUyvxfOuzM30E PgY8IyBOi0kuNtbRwZDxL3X/8g6JOV4dhA== X-Google-Smtp-Source: ABdhPJyAktXnAS80GfBqcWMG3SqrmJjH2Ti2AVuVa49RzsubhhSrebK2KktPxs6ZP79kuecXw5JJZw== X-Received: by 2002:a2e:bb93:: with SMTP id y19mr23632939lje.79.1630402811748; Tue, 31 Aug 2021 02:40:11 -0700 (PDT) Received: from localhost (109-252-93-92.nat.spd-mgts.ru. [109.252.93.92]) by smtp.gmail.com with ESMTPSA id d4sm1675947lfg.178.2021.08.31.02.40.10 for <50296@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Aug 2021 02:40:11 -0700 (PDT) From: Andrew Tropin To: 50296@debbugs.gnu.org Subject: [PATCH 1/2] scripts: Add 'guix home'. In-Reply-To: References: <874kb6j718.fsf@trop.in> Date: Tue, 31 Aug 2021 12:40:08 +0300 Message-ID: <87y28ihs07.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: * guix/scripts/home.scm: New file. * Makefile.am (MODULES): Add it. --- Makefile.am | 2 + guix/scripts/home.scm | 512 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 514 insertions(+) crea [...] 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_MSPIKE_H2 RBL: Average reputation (+2) [209.85.208.178 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.208.178 listed in list.dnswl.org] X-Debbugs-Envelope-To: 50296 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 * guix/scripts/home.scm: New file. * Makefile.am (MODULES): Add it. =2D-- Makefile.am | 2 + guix/scripts/home.scm | 512 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 514 insertions(+) create mode 100644 guix/scripts/home.scm diff --git a/Makefile.am b/Makefile.am index 327d3f9961..d44360c034 100644 =2D-- a/Makefile.am +++ b/Makefile.am @@ -15,6 +15,7 @@ # Copyright =C2=A9 2018 Alex Vong # Copyright =C2=A9 2019 Efraim Flashner # Copyright =C2=A9 2021 Chris Marusich +# Copyright =C2=A9 2021 Andrew Tropin # # This file is part of GNU Guix. # @@ -294,6 +295,7 @@ MODULES =3D \ guix/scripts/system.scm \ guix/scripts/system/search.scm \ guix/scripts/system/reconfigure.scm \ + guix/scripts/home.scm \ guix/scripts/lint.scm \ guix/scripts/challenge.scm \ guix/scripts/import/crate.scm \ diff --git a/guix/scripts/home.scm b/guix/scripts/home.scm new file mode 100644 index 0000000000..9eb5c0c917 =2D-- /dev/null +++ b/guix/scripts/home.scm @@ -0,0 +1,512 @@ +;;; 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 (guix scripts home) + #:use-module (gnu packages admin) + #:use-module ((gnu services) #:hide (delete)) + #:use-module (gnu packages) + #:use-module (gnu home) + #:use-module (gnu home-services) + #:use-module (guix channels) + #:use-module (guix derivations) + #:use-module (guix ui) + #:use-module (guix grafts) + #:use-module (guix packages) + #:use-module (guix profiles) + #:use-module (guix store) + #:use-module (guix utils) + #:use-module (guix scripts) + #:use-module (guix scripts package) + #:use-module (guix scripts build) + #:use-module (guix scripts system search) + #:autoload (guix scripts pull) (channel-commit-hyperlink) + ;; #:use-module (guix scripts home import) + #:use-module ((guix status) #:select (with-status-verbosity)) + #:use-module (guix gexp) + #:use-module (guix monads) + #:use-module (srfi srfi-1) + #:use-module (srfi srfi-26) + #:use-module (srfi srfi-35) + #:use-module (srfi srfi-37) + #:use-module (ice-9 match) + #:export (guix-home)) + + +;;; +;;; Options. +;;; + +(define %user-module + (make-user-module '((gnu home)))) + +(define %guix-home + (string-append %profile-directory "/guix-home")) + +(define (show-help) + (display (G_ "Usage: guix home [OPTION ...] ACTION [ARG ...] [FILE] +Build the home environment declared in FILE according to ACTION. +Some ACTIONS support additional ARGS.\n")) + (newline) + (display (G_ "The valid values for ACTION are:\n")) + (newline) + (display (G_ "\ + search search for existing service types\n")) + (display (G_ "\ + reconfigure switch to a new home environment configuration\n")) + (display (G_ "\ + roll-back switch to the previous home environment configuratio= n\n")) + (display (G_ "\ + describe describe the current home environment\n")) + (display (G_ "\ + list-generations list the home environment generations\n")) + (display (G_ "\ + switch-generation switch to an existing home environment configuration= \n")) + (display (G_ "\ + delete-generations delete old home environment generations\n")) + (display (G_ "\ + build build the home environment without installing anythi= ng\n")) + (display (G_ "\ + import generates a home environment definition from dotfile= s\n")) + + (show-build-options-help) + (display (G_ " + -v, --verbosity=3DLEVEL use the given verbosity LEVEL")) + (newline) + (display (G_ " + -h, --help display this help and exit")) + (display (G_ " + -V, --version display version information and exit")) + (newline) + (show-bug-report-information)) + +(define (verbosity-level opts) + "Return the verbosity level based on OPTS, the alist of parsed options." + (or (assoc-ref opts 'verbosity) + (if (eq? (assoc-ref opts 'action) 'build) + 2 1))) + +(define %options + ;; Specification of the command-line options. + (cons* (option '(#\h "help") #f #f + (lambda args + (show-help) + (exit 0))) + (option '(#\V "version") #f #f + (lambda args + (show-version-and-exit "guix show"))) + (option '(#\v "verbosity") #t #f + (lambda (opt name arg result) + (let ((level (string->number* arg))) + (alist-cons 'verbosity level + (alist-delete 'verbosity result))))) + %standard-build-options)) + +(define %default-options + `((build-mode . ,(build-mode normal)) + (graft? . #t) + (substitutes? . #t) + (offload? . #t) + (print-build-trace? . #t) + (print-extended-build-trace? . #t) + (multiplexed-build-output? . #t) + (verbosity . 3) + (debug . 0))) + + +;;; +;;; Actions. +;;; + +(define* (perform-action action he + #:key + dry-run? + derivations-only? + use-substitutes?) + "Perform ACTION for home environment. " + + (define println + (cut format #t "~a~%" <>)) + + (mlet* %store-monad + ((he-drv (home-environment-derivation he)) + (drvs (mapm/accumulate-builds lower-object (list he-drv))) + (% (if derivations-only? + (return + (for-each (compose println derivation-file-name) drv= s)) + (built-derivations drvs))) + + (he-out-path -> (derivation->output-path he-drv))) + (if (or dry-run? derivations-only?) + (return #f) + (begin + (for-each (compose println derivation->output-path) drvs) + + (case action + ((reconfigure) + (let* ((number (generation-number %guix-home)) + (generation (generation-file-name + %guix-home (+ 1 number)))) + + (switch-symlinks generation he-out-path) + (switch-symlinks %guix-home generation) + (setenv "GUIX_NEW_HOME" he-out-path) + (primitive-load (string-append he-out-path "/activate")) + (setenv "GUIX_NEW_HOME" #f) + (return he-out-path))) + (else + (newline) + (return he-out-path))))))) + +(define (process-action action args opts) + "Process ACTION, a sub-command, with the arguments are listed in ARGS. +ACTION must be one of the sub-commands that takes a home environment +declaration as an argument (a file name.) OPTS is the raw alist of options +resulting from command-line parsing." + (define (ensure-home-environment file-or-exp obj) + (unless (home-environment? obj) + (leave (G_ "'~a' does not return a home environment ~%") + file-or-exp)) + obj) + + (let* ((file (match args + (() #f) + ((x . _) x))) + (expr (assoc-ref opts 'expression)) + (system (assoc-ref opts 'system)) + + (transform (lambda (obj) + (home-environment-with-provenance obj file))) + + (home-environment + (transform + (ensure-home-environment + (or file expr) + (cond + ((and expr file) + (leave + (G_ "both file and expression cannot be specified~%"))) + (expr + (read/eval expr)) + (file + (load* file %user-module + #:on-error (assoc-ref opts 'on-error))) + (else + (leave (G_ "no configuration specified~%"))))))) + + (dry? (assoc-ref opts 'dry-run?))) + + (with-store store + (set-build-options-from-command-line store opts) + (with-build-handler (build-notifier #:use-substitutes? + (assoc-ref opts 'substitutes?) + #:verbosity + (verbosity-level opts) + #:dry-run? + (assoc-ref opts 'dry-run?)) + + (run-with-store store + (mbegin %store-monad + (set-guile-for-build (default-guile)) + + (case action + (else + (perform-action action home-environment + #:dry-run? dry? + #:derivations-only? (assoc-ref opts 'deriva= tions-only?) + #:use-substitutes? (assoc-ref opts 'substit= utes?)) + )))))) + (warn-about-disk-space))) + + +(define (process-command command args opts) + "Process COMMAND, one of the 'guix home' sub-commands. ARGS is its +argument list and OPTS is the option alist." + (define-syntax-rule (with-store* store exp ...) + (with-store store + (set-build-options-from-command-line store opts) + exp ...)) + (case command + ;; The following commands do not need to use the store, and they do no= t need + ;; an home environment file. + ((search) + (apply search args)) + ((import) + (let* ((profiles (delete-duplicates + (match (filter-map (match-lambda + (('profile . p) p) + (_ #f)) + opts) + (() (list %current-profile)) + (lst (reverse lst))))) + (manifest (concatenate-manifests + (map profile-manifest profiles)))) + (import-manifest manifest (current-output-port)))) + ((describe) + (match (generation-number %guix-home) + (0 + (error (G_ "no home environment generation, nothing to describe~%"= ))) + (generation + (display-home-environment-generation generation)))) + ((list-generations) + (let ((pattern (match args + (() #f) + ((pattern) pattern) + (x (leave (G_ "wrong number of arguments~%")))))) + (list-generations pattern))) + ((switch-generation) + (let ((pattern (match args + ((pattern) pattern) + (x (leave (G_ "wrong number of arguments~%")))))) + (with-store* store + (switch-to-home-environment-generation store pattern))= )) + ((roll-back) + (let ((pattern (match args + (() "") + (x (leave (G_ "wrong number of arguments~%")))))) + (with-store* store + (roll-back-home-environment store)))) + ((delete-generations) + (let ((pattern (match args + (() #f) + ((pattern) pattern) + (x (leave (G_ "wrong number of arguments~%")))))) + (with-store* + store + (delete-matching-generations store %guix-home pattern)))) + (else (process-action command args opts)))) + +(define-command (guix-home . args) + (synopsis "build and deploy home environments") + + (define (parse-sub-command arg result) + ;; Parse sub-command ARG and augment RESULT accordingly. + (if (assoc-ref result 'action) + (alist-cons 'argument arg result) + (let ((action (string->symbol arg))) + (case action + ((build + reconfigure + extension-graph shepherd-graph + list-generations describe + delete-generations roll-back + switch-generation search + import) + (alist-cons 'action action result)) + (else (leave (G_ "~a: unknown action~%") action)))))) + + (define (match-pair car) + ;; Return a procedure that matches a pair with CAR. + (match-lambda + ((head . tail) + (and (eq? car head) tail)) + (_ #f))) + + (define (option-arguments opts) + ;; Extract the plain arguments from OPTS. + (let* ((args (reverse (filter-map (match-pair 'argument) opts))) + (count (length args)) + (action (assoc-ref opts 'action)) + (expr (assoc-ref opts 'expression))) + (define (fail) + (leave (G_ "wrong number of arguments for action '~a'~%") + action)) + + (unless action + (format (current-error-port) + (G_ "guix home: missing command name~%")) + (format (current-error-port) + (G_ "Try 'guix home --help' for more information.~%")) + (exit 1)) + + (case action + ((build reconfigure) + (unless (or (=3D count 1) + (and expr (=3D count 0))) + (fail))) + ((init) + (unless (=3D count 2) + (fail)))) + args)) + + (with-error-handling + (let* ((opts (parse-command-line args %options + (list %default-options) + #:argument-handler + parse-sub-command)) + (args (option-arguments opts)) + (command (assoc-ref opts 'action))) + (parameterize ((%graft? (assoc-ref opts 'graft?))) + (with-status-verbosity (verbosity-level opts) + (process-command command args opts)))))) + + +;;; +;;; Searching. +;;; + +(define service-type-name* + (compose symbol->string service-type-name)) + +(define (service-type-description-string type) + "Return the rendered and localised description of TYPE, a service type." + (and=3D> (service-type-description type) + (compose texi->plain-text P_))) + +(define %service-type-metrics + ;; Metrics used to estimate the relevance of a search result. + `((,service-type-name* . 3) + (,service-type-description-string . 2) + (,(lambda (type) + (match (and=3D> (service-type-location type) location-file) + ((? string? file) + (basename file ".scm")) + (#f + ""))) + . 1))) + +(define (find-service-types regexps) + "Return a list of service type/score pairs: service types whose name or +description matches REGEXPS sorted by relevance, and their score." + (let ((matches (fold-home-service-types + (lambda (type result) + (match (relevance type regexps + %service-type-metrics) + ((? zero?) + result) + (score + (cons (cons type score) result)))) + '()))) + (sort matches + (lambda (m1 m2) + (match m1 + ((type1 . score1) + (match m2 + ((type2 . score2) + (if (=3D score1 score2) + (string>? (service-type-name* type1) + (service-type-name* type2)) + (> score1 score2)))))))))) + +(define (search . args) + (with-error-handling + (let* ((regexps (map (cut make-regexp* <> regexp/icase) args)) + (matches (find-service-types regexps))) + (leave-on-EPIPE + (display-search-results matches (current-output-port) + #:print service-type->recutils + #:command "guix home search"))))) + + +;;; +;;; Generations. +;;; + +(define* (display-home-environment-generation + number + #:optional (profile %guix-home)) + "Display a summary of home-environment generation NUMBER in a +human-readable format." + (define (display-channel channel) + (format #t " ~a:~%" (channel-name channel)) + (format #t (G_ " repository URL: ~a~%") (channel-url channel)) + (when (channel-branch channel) + (format #t (G_ " branch: ~a~%") (channel-branch channel))) + (format #t (G_ " commit: ~a~%") + (if (supports-hyperlinks?) + (channel-commit-hyperlink channel) + (channel-commit channel)))) + + (unless (zero? number) + (let* ((generation (generation-file-name profile number))) + (define-values (channels config-file) + ;; The function will work for home environments too, we just + ;; need to keep provenance file. + (system-provenance generation)) + + (display-generation profile number) + (format #t (G_ " file name: ~a~%") generation) + (format #t (G_ " canonical file name: ~a~%") (readlink* generation)) + ;; TRANSLATORS: Please preserve the two-space indentation. + + (unless (null? channels) + ;; TRANSLATORS: Here "channel" is the same terminology as used in + ;; "guix describe" and "guix pull --channels". + (format #t (G_ " channels:~%")) + (for-each display-channel channels)) + (when config-file + (format #t (G_ " configuration file: ~a~%") + (if (supports-hyperlinks?) + (file-hyperlink config-file) + config-file)))))) + +(define* (list-generations pattern #:optional (profile %guix-home)) + "Display in a human-readable format all the home environment +generations matching PATTERN, a string. When PATTERN is #f, display +all the home environment generations." + (cond ((not (file-exists? profile)) ; XXX: race condition + (raise (condition (&profile-not-found-error + (profile profile))))) + ((not pattern) + (for-each display-home-environment-generation (profile-generation= s profile))) + ((matching-generations pattern profile) + =3D> + (lambda (numbers) + (if (null-list? numbers) + (exit 1) + (leave-on-EPIPE + (for-each display-home-environment-generation numbers)))))= )) + + +;;; +;;; Switch generations. +;;; + +;; TODO: Make it public in (guix scripts system) +(define-syntax-rule (unless-file-not-found exp) + (catch 'system-error + (lambda () + exp) + (lambda args + (if (=3D ENOENT (system-error-errno args)) + #f + (apply throw args))))) + +(define (switch-to-home-environment-generation store spec) + "Switch the home-environment profile to the generation specified by +SPEC. STORE is an open connection to the store." + (let* ((number (relative-generation-spec->number %guix-home spec)) + (generation (generation-file-name %guix-home number)) + (activate (string-append generation "/activate"))) + (if number + (begin + (setenv "GUIX_NEW_HOME" (readlink generation)) + (switch-to-generation* %guix-home number) + (unless-file-not-found (primitive-load activate)) + (setenv "GUIX_NEW_HOME" #f)) + (leave (G_ "cannot switch to home environment generation '~a'~%") = spec)))) + + +;;; +;;; Roll-back. +;;; + +(define (roll-back-home-environment store) + "Roll back the home-environment profile to its previous generation. +STORE is an open connection to the store." + (switch-to-home-environment-generation store "-1")) =2D-=20 2.33.0 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmEt+PgACgkQIgjSCVjB 3rAkUw/+LZ1Cq3n46PxPfj6V9zXKZxyzU4k4MHTq5o75G2PPgLDjwi9tst/Nz7T5 Reo3ETe/FfsVWWTl8Fi4lzUk+uIorREnwcKwLqwJP2H0vxXC6LcfLswb6TpVKGq5 fBAyfPHbeBFZiKlfpKdPaHKsXcqM50zsoi7UcGpYcJDnUaVBfxAqfjT71Ru/N8K4 hcmepyths+s23+iqXMM97u+aKWIxTtPnksmZVHeDLVSDjaBmjFa6DP5CsfP+kinJ rPH1sPaVUuRbLAYMhcQVOTjGrKeTAEOG2ZG9jgZJrUbsYZdndrH3WqjleTvAM6Ln 3O/IlFeIKZ8UHxeDL78ZVldqMNJt4yY69jR/rTYu13DFdvRCnPIgu765ddDZ5+TB +5AlHSWUaRMWHi6KKjOoAKWGDthu3KHiioIX9Y/FpvGSBzqFkdrKCEMUVG9m6yyK 4PkKGd255/w8WwFxIUyUPGrOr7CekCDO+uBdyFtMvgThBLk/plgRi6JhfkJLha3Z Pd8h5Hl8u170mRJHTedOr8tfVIwaXJpEVD6NMxobiD7HyXEsV/elI3UIrHnholK5 589dYqIFDr3EU5/1hxViWlXyQzUHO+EI84nntQLdVjuJAaMZCS3exNLqfOrWr+2G Wr7MguyydHYZiY5eU2sd8JV7KeIiTiqLCgjnJZ8ATSKWyip3ce0= =WPvF -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 31 05:41:11 2021 Received: (at 50296) by debbugs.gnu.org; 31 Aug 2021 09:41:11 +0000 Received: from localhost ([127.0.0.1]:33043 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mL0GV-0002Jd-5O for submit@debbugs.gnu.org; Tue, 31 Aug 2021 05:41:11 -0400 Received: from mail-lf1-f41.google.com ([209.85.167.41]:43964) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mL0GS-0002JO-Ay for 50296@debbugs.gnu.org; Tue, 31 Aug 2021 05:41:09 -0400 Received: by mail-lf1-f41.google.com with SMTP id m18so23039833lfl.10 for <50296@debbugs.gnu.org>; Tue, 31 Aug 2021 02:41:08 -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=d9QqO7l7uQhCJWojmGtT0Y22Y+xH6QxS41I9BWfDuPM=; b=BU98cVPhZXrLcsf6+Qbc/TKsxsF8ESMD5ivCblJkTqrxcx17RPFTDLOW13yt1ijZql pHWjweUioSvGU+NjoF9ed4G+IiKgMmgIIMjONciOQEy+VBqGrdXDxcqw115KzlEgy+7R CddpbqyFhNwUpAHm81fpGwppPcr9tydTHOm8TYYNg2UjLyCNWpaMhzKdKR4pVyj/VxeR 7Wrq8U1MZksvby7EQXCcVY3yA5Ri9AOjOrU/QyvUbnp9Lm4Lm2MMbQxcn0BEOSAEO2np 43DigNsyYkhgv/M/ZTWKCRPLj/EEZkD9JWv8Oo/36knjhTnTe6aMSyEidp/vH5gu8gxF qCYg== 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=d9QqO7l7uQhCJWojmGtT0Y22Y+xH6QxS41I9BWfDuPM=; b=FeYmqHrfAx81pue3Mxd3KLaBEN09nuChd4HR9PwHfGBRgyGKWYcbU3Hg/E1lna3eC5 yMZrOJPGmNHzbzukHkrdhtmjliHtZBToxdrPyH2XgdJAtmFJ5OdrO6oGjMZ/VUb5SnXq D7MQV2kiNd0+DGG1egkJ/ReNVnrKtVFGDJdfwPWzZ3kZA/kg9UFboqR9DlKs7+M1Xoc4 MsCz9a4gYxjh4+pk4fLl4ydKXje5S5J+ivjEk8oXtEqlAzx9QJwjZHsZRQfWdJhwriaw 7jCoOCu0jHcUOJ1BKRe6dQALFKsbGB0OUnkmyryivKzZVhS3bcaWBAJ0rJbRQwnR2gUs 30nw== X-Gm-Message-State: AOAM532CcuPk4d8e0f9o6yDuVqgCMy8FfGWNFUuRMfqrvtiwmD038A/L BK/OhSAMao9sLvYD4OjcPZxJNhdPBdIeMw== X-Google-Smtp-Source: ABdhPJzPM7QZNAmf5gYtQ7biYjcRhOVdXNN3ww+MGr8OBDfCjY9/wcvu0q35RkSA/k8m9tCCV83cGA== X-Received: by 2002:a05:6512:11ec:: with SMTP id p12mr20613626lfs.379.1630402861788; Tue, 31 Aug 2021 02:41:01 -0700 (PDT) Received: from localhost (109-252-93-92.nat.spd-mgts.ru. [109.252.93.92]) by smtp.gmail.com with ESMTPSA id w2sm1312226lfq.20.2021.08.31.02.41.00 for <50296@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Aug 2021 02:41:01 -0700 (PDT) From: Andrew Tropin To: 50296@debbugs.gnu.org Subject: [PATCH 2/2] scripts: home: Add import subcommand. In-Reply-To: References: <874kb6j718.fsf@trop.in> Date: Tue, 31 Aug 2021 12:40:58 +0300 Message-ID: <87v93mhryt.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: * guix/scripts/home/import.scm: New file. * Makefile.am (MODULES): Add it. --- Makefile.am | 1 + guix/scripts/home.scm | 2 +- guix/scripts/home/import.scm | 241 +++++++++++++++++++++++++++++++++++ 3 f [...] 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.41 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.167.41 listed in wl.mailspike.net] X-Debbugs-Envelope-To: 50296 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 * guix/scripts/home/import.scm: New file. * Makefile.am (MODULES): Add it. =2D-- Makefile.am | 1 + guix/scripts/home.scm | 2 +- guix/scripts/home/import.scm | 241 +++++++++++++++++++++++++++++++++++ 3 files changed, 243 insertions(+), 1 deletion(-) create mode 100644 guix/scripts/home/import.scm diff --git a/Makefile.am b/Makefile.am index d44360c034..c27dcf9a38 100644 =2D-- a/Makefile.am +++ b/Makefile.am @@ -296,6 +296,7 @@ MODULES =3D \ guix/scripts/system/search.scm \ guix/scripts/system/reconfigure.scm \ guix/scripts/home.scm \ + guix/scripts/home/import.scm \ guix/scripts/lint.scm \ guix/scripts/challenge.scm \ guix/scripts/import/crate.scm \ diff --git a/guix/scripts/home.scm b/guix/scripts/home.scm index 9eb5c0c917..75df6d707d 100644 =2D-- a/guix/scripts/home.scm +++ b/guix/scripts/home.scm @@ -36,7 +36,7 @@ #:use-module (guix scripts build) #:use-module (guix scripts system search) #:autoload (guix scripts pull) (channel-commit-hyperlink) =2D ;; #:use-module (guix scripts home import) + #:use-module (guix scripts home import) #:use-module ((guix status) #:select (with-status-verbosity)) #:use-module (guix gexp) #:use-module (guix monads) diff --git a/guix/scripts/home/import.scm b/guix/scripts/home/import.scm new file mode 100644 index 0000000000..39f45dbeac =2D-- /dev/null +++ b/guix/scripts/home/import.scm @@ -0,0 +1,241 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright =C2=A9 2021 Xinglu Chen +;;; Copyright =C2=A9 2021 Andrew Tropin +;;; +;;; 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 (guix scripts home import) + #:use-module (guix profiles) + #:use-module (guix ui) + #:use-module (ice-9 match) + #:use-module (ice-9 pretty-print) + #:use-module (srfi srfi-1) + #:export (import-manifest)) + +;;; Commentary: +;;; +;;; This module provides utilities for generating home service +;;; configurations from existing "dotfiles". +;;; +;;; Code: + + +(define (generate-bash-module+configuration) + (let ((rc (string-append (getenv "HOME") "/.bashrc")) + (profile (string-append (getenv "HOME") "/.bash_profile")) + (logout (string-append (getenv "HOME") "/.bash_logout"))) + `((gnu home-services bash) + (service home-bash-service-type + (home-bash-configuration + ,@(if (file-exists? rc) + `((bashrc + (list (slurp-file-gexp (local-file ,rc))))) + '()) + ,@(if (file-exists? profile) + `((bash-profile + (list (slurp-file-gexp + (local-file ,profile))))) + '()) + ,@(if (file-exists? logout) + `((bash-logout + (list (slurp-file-gexp + (local-file ,logout))))) + '())))))) + + +(define %files-configurations-alist + `((".bashrc" . ,generate-bash-module+configuration) + (".bash_profile" . ,generate-bash-module+configuration) + (".bash_logout" . ,generate-bash-module+configuration))) + +(define (modules+configurations) + (let ((configurations (delete-duplicates + (filter-map (match-lambda + ((file . proc) + (if (file-exists? + (string-append (getenv "HOME") "/" f= ile)) + proc + #f))) + %files-configurations-alist) + (lambda (x y) + (equal? (procedure-name x) (procedure-name y)))= ))) + (map (lambda (proc) (proc)) configurations))) + +;; Based on `manifest->code' from (guix profiles) +;; MAYBE: Upstream it? +(define* (manifest->code manifest + #:key + (entry-package-version (const "")) + (home-environment? #f)) + "Return an sexp representing code to build an approximate version of +MANIFEST; the code is wrapped in a top-level 'begin' form. If +HOME-ENVIRONMENT? is #t, return an definition. +Call ENTRY-PACKAGE-VERSION to determine the version number to use in +the spec for a given entry; it can be set to 'manifest-entry-version' +for fully-specified version numbers, or to some other procedure to +disambiguate versions for packages for which several versions are +available." + (define (entry-transformations entry) + ;; Return the transformations that apply to ENTRY. + (assoc-ref (manifest-entry-properties entry) 'transformations)) + + (define transformation-procedures + ;; List of transformation options/procedure name pairs. + (let loop ((entries (manifest-entries manifest)) + (counter 1) + (result '())) + (match entries + (() result) + ((entry . tail) + (match (entry-transformations entry) + (#f + (loop tail counter result)) + (options + (if (assoc-ref result options) + (loop tail counter result) + (loop tail (+ 1 counter) + (alist-cons options + (string->symbol + (format #f "transform~a" counter)) + result))))))))) + + (define (qualified-name entry) + ;; Return the name of ENTRY possibly with "@" followed by a version. + (match (entry-package-version entry) + ("" (manifest-entry-name entry)) + (version (string-append (manifest-entry-name entry) + "@" version)))) + + (if (null? transformation-procedures) + (let ((specs (map (lambda (entry) + (match (manifest-entry-output entry) + ("out" (qualified-name entry)) + (output (string-append (qualified-name entry) + ":" output)))) + (manifest-entries manifest)))) + (if home-environment? + (let ((modules+configurations (modules+configurations))) + `(begin + (use-modules (gnu home) + (gnu packages) + ,@(map first modules+configurations)) + ,(home-environment-template + #:specs specs + #:services (map second modules+configurations)))) + `(begin + (use-modules (gnu packages)) + + (specifications->manifest + (list ,@specs))))) + (let* ((transform (lambda (options exp) + (if (not options) + exp + (let ((proc (assoc-ref transformation-procedu= res + options))) + `(,proc ,exp))))) + (packages (map (lambda (entry) + (define options + (entry-transformations entry)) + + (define name + (qualified-name entry)) + + (match (manifest-entry-output entry) + ("out" + (transform options + `(specification->package = ,name))) + (output + `(list ,(transform + options + `(specification->package ,n= ame)) + ,output)))) + (manifest-entries manifest))) + (transformations (map (match-lambda + ((options . name) + `(define ,name + (options->transformation ',options)))) + transformation-procedures))) + (if home-environment? + (let ((modules+configurations (modules+configurations))) + `(begin + (use-modules (guix transformations) + (gnu home) + (gnu packages) + ,@(map first modules+configurations)) + + ,@transformations + + ,(home-environment-template + #:packages packages + #:services (map second modules+configurations)))) + `(begin + (use-modules (guix transformations) + (gnu packages)) + + ,@transformations + + (packages->manifest + (list ,@packages))))))) + +(define* (home-environment-template #:key (packages #f) (specs #f) service= s) + "Return an S-exp containing a declaration +containing PACKAGES, or SPECS (package specifications), and SERVICES." + `(home-environment + (packages + ,@(if packages + `((list ,@packages)) + `((map specification->package + (list ,@specs))))) + (services (list ,@services)))) + +(define* (import-manifest + manifest + #:optional (port (current-output-port))) + "Write to PORT a corresponding to MANIFEST." + (define (version-spec entry) + (let ((name (manifest-entry-name entry))) + (match (map package-version (find-packages-by-name name)) + ((_) + ;; A single version of NAME is available, so do not specify the + ;; version number, even if the available version doesn't match EN= TRY. + "") + (versions + ;; If ENTRY uses the latest version, don't specify any version. + ;; Otherwise return the shortest unique version prefix. Note that + ;; this is based on the currently available packages, which could + ;; differ from the packages available in the revision that was us= ed + ;; to build MANIFEST. + (let ((current (manifest-entry-version entry))) + (if (every (cut version>? current <>) + (delete current versions)) + "" + (version-unique-prefix (manifest-entry-version entry) + versions))))))) + + (match (manifest->code manifest + #:entry-package-version version-spec + #:home-environment? #t) + (('begin exp ...) + (format port (G_ "\ +;; This \"home-environment\" file can be passed to 'guix home reconfigure' +;; to reproduce the content of your profile. This is \"symbolic\": it only +;; specifies package names. To reproduce the exact same profile, you also +;; need to capture the channels being used, as returned by \"guix describe= \". +;; See the \"Replicating Guix\" section in the manual.\n")) + (for-each (lambda (exp) + (newline port) + (pretty-print exp port)) + exp)))) =2D-=20 2.33.0 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmEt+SoACgkQIgjSCVjB 3rD7hw/7By/FO3SarrQZ0kmMNWV83UIi2ztywbNAayzHmSsT1cLIi/xKaKOT+05W 3SVDdg8VZRR6C3Wc7RIujPnCqO5iWGtVHOTbmgNEfS8JPSlxqA3yHkkmxuvltbI/ DNwUPgiYx2rqb2EaTNLAgu+Dsyb9K4RN6j+GAXuDRAmcy3ttk7h7kx2wxcwT16Jo CEi2SNlIxCfUfEfvNMa7mzQ46LlC+cdsq78SnFcfioL3keWhHFsoSjPHp4K+ZEN0 9fLzi4NLq0nTkyuXCG/wW0TUNBBr1zw5ZOpGfKejGzoH2JGn7ufuc4IDeULkgDiS 8pJhBKtKSBKyVLo2Nk6xhcnOiu/88O8XebHcmqS10Jijpt6zaJof4ONhY9nYBhV7 w5iqUxEaANbQ1GG3mtcB5AZJloPpIIG5UEgAdjE4bBVoEot2HIrZ9P0r4DQk9hqm 7L9iZDU6WW6C0gPhvnWx7YXqZG8gBofbEo76GMLMgGARJT/6SPaEz4q6dFobgRRd 4F2utWajCAFAHjdv9UHTFS6F2PwjQ05uLH8E7uOywvOCu0kmyBCyt6n1bNmes7h4 NXP6y5NR931XGpJselSOeQABHYUaR1H2ODTcxQbJvERFLltJ15CgxhCt6Zjh3z72 n34GI19YJsgAyFNnm2aRsYGe4Uw+LB4eTAAxvyDSSX1INrwqEHw= =JFMU -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 31 07:13:24 2021 Received: (at 50296-done) by debbugs.gnu.org; 31 Aug 2021 11:13:24 +0000 Received: from localhost ([127.0.0.1]:33148 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mL1hg-0004nC-3D for submit@debbugs.gnu.org; Tue, 31 Aug 2021 07:13:24 -0400 Received: from mail-lf1-f49.google.com ([209.85.167.49]:46046) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mL1ha-0004mt-HA for 50296-done@debbugs.gnu.org; Tue, 31 Aug 2021 07:13:18 -0400 Received: by mail-lf1-f49.google.com with SMTP id g13so37630415lfj.12 for <50296-done@debbugs.gnu.org>; Tue, 31 Aug 2021 04:13:14 -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=trs1tGGlMLUqLqkOzxEECNwAcat2jsnTzFPzDTyDYbE=; b=ovgSfNJumB9/wI5VT/O+74Sea62vqr5UBBK5IN3i8OTdVLsgX101I/ehhUDwxmgROX GjHQG2mfGn/6htPnzIJXBhtXr38QEZO697Mhf3evS+UDk7bzJFz2atvmT6sePFhFZnhZ 7cXnL7/DzubffKGaXF34HoceEdkO69ZNbSVp6EyNP9jgUzFGQyEf0GYdCp13Vui/m1Sg L8HPlMBjcEkI2G1S8lbHar1VziUm8+LCejbbVdOlzSUONOc/6c9JXUGahSyyd6u/c8if L8NA7HzFQtzbdu8PmHeTnH25bOW6Fr7Edecq7bxY8nSQvUxoLzSrOhiAkmMLtQpVlt1B bX8g== 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=trs1tGGlMLUqLqkOzxEECNwAcat2jsnTzFPzDTyDYbE=; b=iGzMrBOlWYFZkX6YvKUzhKQgRA2oPwQKPsSHA2KSkr8iVK4an/9JAfs3m1HT4DBlQ2 mnBeG33GVMl9ybQY2Eg3OGgtRx6m9/OHTKOkfvxBKvP7KeelRccrvQfPkVSfSLEAODzg qosloCmptcJvPoRCcohOa7ss9SEY8pUXxXisis4VyCJnUJkPvpIMkvUrQqRMl92TqnYE OqN6Hel2WTCbTsdMItWe89Uwiff0Dp0DqkVrG62CZt9xJ0qkbwPZD7APHQZC6qDPzLyR 387fYY1MY0j+6BvlP6uPwXXSX4ur6rxhtMMX/TiSwyssARlphIpVuaixt+sCEJYZO4x5 VdYQ== X-Gm-Message-State: AOAM5326MzWNJGuTkCOheu1vkkVPyrhJFIdhl1YbgvApW4fMcziJKHl/ 0zYPju7yQ9pSlsZTZhTyn2KzqiBojb4= X-Google-Smtp-Source: ABdhPJxw3HrOAOAi0ArZ3HZmqs9cn9MtDLqZvZTNaTBTwG2Cqyl/wgn5jJI54xi1kbnWwPLlxdwPNQ== X-Received: by 2002:a05:6512:b8f:: with SMTP id b15mr20340757lfv.577.1630408387981; Tue, 31 Aug 2021 04:13:07 -0700 (PDT) Received: from guixsd ([88.201.161.72]) by smtp.gmail.com with ESMTPSA id bn16sm2137374ljb.74.2021.08.31.04.13.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Aug 2021 04:13:07 -0700 (PDT) From: Oleg Pykhalov To: Andrew Tropin Subject: Re: [bug#50296] [PATCH 0/2] Add 'guix home' command. References: <874kb6j718.fsf@trop.in> Date: Tue, 31 Aug 2021 14:13:04 +0300 In-Reply-To: <874kb6j718.fsf@trop.in> (Andrew Tropin's message of "Tue, 31 Aug 2021 12:28:12 +0300") Message-ID: <87tuj598an.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: 50296-done Cc: 50296-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 Hi Andrew, Andrew Tropin writes: > Command and subbcommands allowing to manage home environment with guix. > > Andrew Tropin (2): > scripts: Add 'guix home'. > scripts: home: Add import subcommand. > > Makefile.am | 3 + > guix/scripts/home.scm | 512 +++++++++++++++++++++++++++++++++++ > guix/scripts/home/import.scm | 241 +++++++++++++++++ > 3 files changed, 756 insertions(+) > create mode 100644 guix/scripts/home.scm > create mode 100644 guix/scripts/home/import.scm I applied your patches and also fixed a typo in gnu/home-services/xdg.scm file, which I noticed during Geiser entering (guix scripts home) module about missing =E2=80=98home-services-utils=E2=80= =99, which should be =E2=80=98home-services utils=E2=80=99. Pushed to wip-guix-home. Also, I tried to use guix home for the first time as documented at site [1], and got an error: =2D-8<---------------cut here---------------start------------->8--- (string-append #f "/" "profile/share/fonts") In procedure string-append: Wrong type (expecting string): #f =2D-8<---------------cut here---------------end--------------->8--- [1] https://guix-home.trop.in/Declaring-the-Home-Environment.html The following text in the message is only about the error. oleg@guixsd ~/src/guix-wip-guix-home$ mkdir /tmp/guix oleg@guixsd ~/src/guix-wip-guix-home$ guix pull --url=3Dfile:///home/oleg/s= rc/guix-wip-guix-home --branch=3Dwip-guix-home -p /tmp/guix/guix ~/.local/share/chezmoi/dotfiles/guixsd/home.scm: =2D-8<---------------cut here---------------start------------->8--- (use-modules (gnu home) (gnu home-services) ;; (gnu home-services ssh) (gnu home-services shells) ;; (gnu home-services files) (gnu services) (gnu packages admin) (guix gexp) (ice-9 rdelim)) (define %home (and=3D> (getenv "HOME") (lambda (home) home))) (define .bash_profile (string-append %home "/.local/share/chezmoi/dot_bash_profile")) (home-environment ;; (packages (list htop)) (services (list (service home-bash-service-type (home-bash-configuration (guix-defaults? #t) (bash-profile (list (with-input-from-file .bash_profile read-string))))) ;; XXX: missing home-files-service-type ;; (simple-service 'test-config ;; home-files-service-type ;; (list `("config/test.conf" ;; ,(plain-file "tmp-file.txt" ;; "the content of ~/.config/test.c= onf")))) =20=20=20 ;; XXX: missing home-ssh-configuration ;; (service home-ssh-service-type ;; (home-ssh-configuration ;; (extra-config ;; (list ;; (ssh-host "savannah" ;; '((compression . #f))))))) ))) =2D-8<---------------cut here---------------end--------------->8--- My first guix home reconfigure launch: =2D-8<---------------cut here---------------start------------->8--- oleg@guixsd ~/src/guix-wip-guix-home$ /tmp/guix/guix/bin/guix home reconfig= ure ~/.local/share/chezmoi/dotfiles/guixsd/home.scm /gnu/store/xl4igqm0jjy7gfbganz9061ivdgzfpdk-home New symlinks to home-environment will be created soon. All conflicting files will go to /home/oleg/1630407324-guix-home-legacy-con= figs-backup. Skipping /home/oleg/.config (directory already exists)... done Creating /home/oleg/.config/fontconfig... done Symlinking /home/oleg/.config/fontconfig/fonts.conf -> /gnu/store/phj2z2iiq= dhryfy7mqral0b9qz3hlva6-fonts.conf... done Backing up /home/oleg/.bashrc... done Symlinking /home/oleg/.bashrc -> /gnu/store/513j2xkszmcmv7fiawh59mr0i1fmin5= 5-bashrc... done Symlinking /home/oleg/.profile -> /gnu/store/fxbppk3pqzdi3zzy0xl5vg1ir6c5jz= q5-shell-profile... done Backing up /home/oleg/.bash_profile... done Symlinking /home/oleg/.bash_profile -> /gnu/store/2c3yva8vj5ikb0gspmjvzw0r9= g9i1cxc-bash_profile... done done Finished updating symlinks. Backtrace: In guix/ui.scm: 2185:7 19 (run-guix . _) 2148:10 18 (run-guix-command _ . _) In ice-9/boot-9.scm: 1752:10 17 (with-exception-handler _ _ #:unwind? _ # _) In guix/status.scm: 820:3 16 (_) 800:4 15 (call-with-status-report _ _) In guix/scripts/home.scm: 214:4 14 (_) In ice-9/boot-9.scm: 1752:10 13 (with-exception-handler _ _ #:unwind? _ # _) In guix/store.scm: 658:37 12 (thunk) 1320:8 11 (call-with-build-handler _ _) 1320:8 10 (call-with-build-handler # =E2=80=A6) 2108:24 9 (run-with-store # =E2=80= =A6) In guix/scripts/home.scm: 169:15 8 (_ _) In unknown file: 7 (primitive-load "/gnu/store/xl4igqm0jjy7gfbganz9061ivdg=E2=80= =A6") In ice-9/eval.scm: 619:8 6 (_ #(#(#(#(#(#(#(#(#(#(#<=E2=80=A6> =E2=80=A6) =E2=80=A6) =E2= =80=A6) =E2=80=A6) =E2=80=A6) =E2=80=A6) =E2=80=A6) =E2=80=A6) =E2=80=A6) = =E2=80=A6)) 626:19 5 (_ #(#(#(#(#(#(#(#(#(#(#<=E2=80=A6> =E2=80=A6) =E2=80=A6) =E2= =80=A6) =E2=80=A6) =E2=80=A6) =E2=80=A6) =E2=80=A6) =E2=80=A6) =E2=80=A6) = =E2=80=A6)) In srfi/srfi-1.scm: 586:17 4 (map1 (("profile/share/fonts" (system* "/gnu/stor=E2=80=A6" = =E2=80=A6)))) In ice-9/eval.scm: 293:34 3 (_ #(#(# #) = #)) In unknown file: 2 (string-append #f "/" "profile/share/fonts") In ice-9/boot-9.scm: 1685:16 1 (raise-exception _ #:continuable? _) 1685:16 0 (raise-exception _ #:continuable? _) ice-9/boot-9.scm:1685:16: In procedure raise-exception: In procedure string-append: Wrong type (expecting string): #f =2D-8<---------------cut here---------------end--------------->8--- I skipped the error and tried to configure Bash more: =2D-8<---------------cut here---------------start------------->8--- (define .bashrc (string-append %home "/.local/share/chezmoi/dot_bashrc")) ;; ... (home-bash-configuration ;; ... (bashrc (list (with-input-from-file .bashrc read-string)))) =2D-8<---------------cut here---------------end--------------->8--- Another launch, no errors this time: =2D-8<---------------cut here---------------start------------->8--- oleg@guixsd ~/src/guix-wip-guix-home$ /tmp/guix/guix/bin/guix home reconfig= ure ~/.local/share/chezmoi/dotfiles/guixsd/home.scm substitute: updating substitutes from 'https://ci.guix.gnu.org'... 100.0% substitute: updating substitutes from 'https://bordeaux.guix.gnu.org'... 10= 0.0% The following derivations will be built: /gnu/store/fn1hzpyic1k32pamyf45vwa0x3lw046g-home.drv /gnu/store/akdwz30lx0widqvyqmnkya45cb78f74d-files.drv /gnu/store/xcvi7n1l0fvsm099x2vyg6xci0qkayzp-bashrc.drv /gnu/store/pm1gw2xakkqj0zxsbbq0jnwgv3v95ajj-provenance.drv building /gnu/store/pm1gw2xakkqj0zxsbbq0jnwgv3v95ajj-provenance.drv... successfully built /gnu/store/pm1gw2xakkqj0zxsbbq0jnwgv3v95ajj-provenance.d= rv building /gnu/store/xcvi7n1l0fvsm099x2vyg6xci0qkayzp-bashrc.drv... successfully built /gnu/store/xcvi7n1l0fvsm099x2vyg6xci0qkayzp-bashrc.drv building /gnu/store/akdwz30lx0widqvyqmnkya45cb78f74d-files.drv... successfully built /gnu/store/akdwz30lx0widqvyqmnkya45cb78f74d-files.drv building /gnu/store/fn1hzpyic1k32pamyf45vwa0x3lw046g-home.drv... successfully built /gnu/store/fn1hzpyic1k32pamyf45vwa0x3lw046g-home.drv /gnu/store/1y84hzz1m1c3jw03n2g8hn9wwyxngab3-home Cleaning up symlinks from previous home-environment. Removing /home/oleg/.config/fontconfig/fonts.conf... done Removing /home/oleg/.config/fontconfig... done Skipping /home/oleg/.config (not an empty directory)... done Removing /home/oleg/.bashrc... done Removing /home/oleg/.profile... done Removing /home/oleg/.bash_profile... done Cleanup finished. New symlinks to home-environment will be created soon. All conflicting files will go to /home/oleg/1630407412-guix-home-legacy-con= figs-backup. Skipping /home/oleg/.config (directory already exists)... done Creating /home/oleg/.config/fontconfig... done Symlinking /home/oleg/.config/fontconfig/fonts.conf -> /gnu/store/phj2z2iiq= dhryfy7mqral0b9qz3hlva6-fonts.conf... done Symlinking /home/oleg/.bashrc -> /gnu/store/lf51wflmvx91m2jx8hx3j34qs9x1k15= 3-bashrc... done Symlinking /home/oleg/.profile -> /gnu/store/fxbppk3pqzdi3zzy0xl5vg1ir6c5jz= q5-shell-profile... done Symlinking /home/oleg/.bash_profile -> /gnu/store/2c3yva8vj5ikb0gspmjvzw0r9= g9i1cxc-bash_profile... done done Finished updating symlinks. Comparing /gnu/store/xl4igqm0jjy7gfbganz9061ivdgzfpdk-home/profile/share/fo= nts and /gnu/store/1y84hzz1m1c3jw03n2g8hn9wwyxngab3-home/profile/share/fo= nts... done (same) Evaling on-change gexps. On-change gexps evaluation finished. =2D-8<---------------cut here---------------end--------------->8--- Oleg. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJIBAEBCgAyFiEEcjhxI46s62NFSFhXFn+OpQAa+pwFAmEuDsAUHGdvLndpZ3Vz dEBnbWFpbC5jb20ACgkQFn+OpQAa+px5zhAAwPWVUW9s1WDXP1j5wDHJ355YJRoi JhGScL7rWDibGhaPGSN5pPBPBWeIt5I59uojrMgH9SOqB6pCxcinz38Op5neM/KX S86Axe1iCCyRjGT5RMxPrO0tMwIV0/gW5zrCIir9BFtSEU0LJZBOfr9U2sQb0Lr6 pa+OiWx2CU+X5brtXBLBQyLAmdxSf1+Ps5wa2ZekzfrltFch3x855Je1dZ/cWtke z+0r+ypvRhbZzwBR23bAC9saIWJPqF5AI8dlujo7sOD/oLgQd5VGvqaUmeiiYKOK dNMEUM86qPfuk7CTmBkS4RUHwvKS7tPWGCsiKJ4mgFMwmCHg35l4xT9teOxk9isn xVKRiSdg6/mIGbk8Pn2XUy/hYzmDvlMRkdCWVp8XNU7bI1Hc8LmFesW5RBMVNQwP UM/QTr2+fmOYjO3qCTy1E71MBO25tZk+zSni4R8kdiMl/D6qgdQNRFXE29k3GZst yiQZ744TiE36uNvpfzJiTANSS+GNZZ8ka1s3H3gUWdM9qpFG8p50D33a3Hdg9b7w TzsovR5JWr28kEqALiAH1wSJMFIByChv7Ce9dL9FBE58b3w3bZbGWKIzdP5YM/6r yc33IBATW8RDC/Z/BL8eSzNuK9W9x1heQgpj2i8z2sOYAk94Eiydrc3doF5JW/mL S64IskPyDGvzjkM= =78cW -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 31 07:18:04 2021 Received: (at 50296) by debbugs.gnu.org; 31 Aug 2021 11:18:04 +0000 Received: from localhost ([127.0.0.1]:33160 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mL1mG-0004vK-2h for submit@debbugs.gnu.org; Tue, 31 Aug 2021 07:18:04 -0400 Received: from mail-wm1-f44.google.com ([209.85.128.44]:50948) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mL1mE-0004uk-II for 50296@debbugs.gnu.org; Tue, 31 Aug 2021 07:18:03 -0400 Received: by mail-wm1-f44.google.com with SMTP id m2so10954266wmm.0 for <50296@debbugs.gnu.org>; Tue, 31 Aug 2021 04:18:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:in-reply-to:references:date:message-id:mime-version; bh=z8y2K6mxfk3xVO3TcP166JkNASpJcc4aofdv6RoaTls=; b=KUvliJW+mdI1YTLkton82RbCn/Prvn10IFUSBDHKePuQA5+2ohZWZagcaopvm/a7UI I+hxLLefabOBvf/ty9l7j3h/Z6Qf0AWqs3ZW+gQY74ctlvnuHadPqVypM6rw89HeWfsA y6ab742Sp372vywvCaX4Gy+/KNEie+2/U9VXD5QIssqo02oldXkCrwuNZcXwYniZQCWy KPL3vce8nEZHmKFmz2cTk/zp6coMz9CGDFJhORJanEYUP8dnCr8Xxm+U8lWGC+8M9M47 IlRSgL2ppDOAcw7t3A09tufQ85Li2WtUz7LoahkOqJ2k9H2qjVYodwXhunCHEvS06GyN vBcw== 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=z8y2K6mxfk3xVO3TcP166JkNASpJcc4aofdv6RoaTls=; b=hksXwNIrvx/aiaBZmwJse5w3XbXg6ky187EyM5GEI/eDhNIDOjZmi4a6B/2YzMZ43/ 9JnzEZLHlzqlg79oj2WbEzThr7GF9v14Gr7mc/TPEtTq5NerUP5n5k1dCj7gkt2N22qr 7zwRtsXSCjvega9jKtqCBJK4beQ5Qdz7DmWXlNn66rNz2YYnq/Eifjdz2Hfo1ek/WaQn DkyNdxmOwdPtaxWAjQWgKRC3mjeCqxTRafKCg3ZBSKw1IBug8k/RTp7CgVS6LvYtpaAM veeDwQqmbz5YcyRTX67xJN7dmWjRRblwMEbDRxn/oJBfaSgKjNy1eOwe+ytfxe/Nt1fT +LfQ== X-Gm-Message-State: AOAM530b2c4tgMMc62r/b9NRrV91rD71k3Pff/xW1H+LvF8C8vF+d/L5 iMapYMVl+rCmDOB9M7c5+TIrTjCIow+R6A== X-Google-Smtp-Source: ABdhPJzDza9OSnrI2we80A5HeoXUWUasmVc9EKRNoKCVOIQhd1OG5I1egobEX2A46v4r6u+LPv9WtA== X-Received: by 2002:a7b:ce0f:: with SMTP id m15mr3667512wmc.62.1630408676606; Tue, 31 Aug 2021 04:17:56 -0700 (PDT) Received: from lili ([2a01:e0a:59b:9120:65d2:2476:f637:db1e]) by smtp.gmail.com with ESMTPSA id r20sm18738263wrr.47.2021.08.31.04.17.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Aug 2021 04:17:56 -0700 (PDT) From: zimoun To: Andrew Tropin , 50296@debbugs.gnu.org Subject: Re: [bug#50296] [PATCH 0/2] Add 'guix home' command. In-Reply-To: <874kb6j718.fsf@trop.in> References: <874kb6j718.fsf@trop.in> Date: Tue, 31 Aug 2021 12:46:59 +0200 Message-ID: <86tuj5opr0.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 50296 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 (-) Hi Andrew, On Tue, 31 Aug 2021 at 12:28, Andrew Tropin wrote: > Command and subbcommands allowing to manage home environment with guix. > > Andrew Tropin (2): > scripts: Add 'guix home'. > scripts: home: Add import subcommand. Raghav recently asked [1] an interesting question about consistency of command line commands, i.e., compare for instance: guix system roll-back guix pull --roll-back guix package --roll-back I do not have an opinion but is it a conscientious or discussed choice for subcommands? All the best, simon 1: From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 31 07:18:09 2021 Received: (at 50296) by debbugs.gnu.org; 31 Aug 2021 11:18:09 +0000 Received: from localhost ([127.0.0.1]:33162 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mL1mL-0004vW-9w for submit@debbugs.gnu.org; Tue, 31 Aug 2021 07:18:09 -0400 Received: from mail-wr1-f53.google.com ([209.85.221.53]:44749) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mL1mF-0004un-HT for 50296@debbugs.gnu.org; Tue, 31 Aug 2021 07:18:03 -0400 Received: by mail-wr1-f53.google.com with SMTP id g18so19559568wrc.11 for <50296@debbugs.gnu.org>; Tue, 31 Aug 2021 04:18:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:in-reply-to:references:date:message-id:mime-version :content-transfer-encoding; bh=rlyGHTwlQXlPS+NAJqcu5frYAEY+nnV4V9+CDjfq4YQ=; b=nPiWEGmWMcPEV8jcfEdTrL9j0A/j99SLNUPxy+1/CbjbxagP8QqGlTm7Qy3o/W1Smz QX0DyPu3IB0X4rfyX7/UBLMgbUxWihg9F4Las6qshXKg0sOjwa8f+iZsG3b9yV94wdTb dQ39froseQze0j/HTgHUvhSxeMbUCg43fymdajwK4sBjLrUcZaVM9XVvau0MFI5WXhiL sjwSRD+iDwia/YxTzri86GCE5SBEzabb1I69VjavoLbnf6u5u6VWpHRv50QMR1Vfony7 ZaIJeAzB3vpaWt+fVBgmY6SfylMG4zte13w1U1ukCA4/BfZmrYYGmf2JX8WR6POKQ3VA hhhw== 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:content-transfer-encoding; bh=rlyGHTwlQXlPS+NAJqcu5frYAEY+nnV4V9+CDjfq4YQ=; b=BTPPOSvVJNOt1UY7Qkuvg5e6IR/wxqCWhI2lsD9Rx0fK/rPHbhukCjlnlaZ5zGwOYF R327hHvO9If9409VoIkIuQ2XdSBciUBgKhaSruCmqDkJ9r48a5pEyvULObskN4rkIzsf 61FS7/FvSOvNKCnZDAT7+EuJkaXd/KRlF4AwNeZl8oCu2jIiiOORByQiqw7iK+FEquWN XwQGafqPB3e9fvoDDb5ldWejUFvhLlOeq3X06PdSPgzPtgPCU9sYFJUmmkbf/gC+2C9L i8c1oBzXPvbuV+34E0N5MF5lCB+Q0gGNOr5rGhmzLqM7Qsz7gdA4L22MVY4BcIvQjav6 sCgw== X-Gm-Message-State: AOAM530n8PUvchQ2yQc1rjObEKvjhtRiNQBTALLfxuk5ScVKj0oIUqaa uIeWyH74VXk2nn3gVahmiNGEaXPJF3pLag== X-Google-Smtp-Source: ABdhPJw1URTF+z9C15IrWs1MTiDFioEfJGVHrjlvZ9EYJl45hYPXdhh9yM6hL6GHEhbCHOOuCPQbBA== X-Received: by 2002:a5d:6148:: with SMTP id y8mr31678283wrt.33.1630408677859; Tue, 31 Aug 2021 04:17:57 -0700 (PDT) Received: from lili ([2a01:e0a:59b:9120:65d2:2476:f637:db1e]) by smtp.gmail.com with ESMTPSA id o2sm13019011wrh.13.2021.08.31.04.17.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Aug 2021 04:17:57 -0700 (PDT) From: zimoun To: Andrew Tropin , 50296@debbugs.gnu.org Subject: Re: [bug#50296] [PATCH 1/2] scripts: Add 'guix home'. In-Reply-To: <87y28ihs07.fsf@trop.in> References: <874kb6j718.fsf@trop.in> <87y28ihs07.fsf@trop.in> Date: Tue, 31 Aug 2021 12:53:51 +0200 Message-ID: <86pmttopfk.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 50296 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 (-) Hi, On Tue, 31 Aug 2021 at 12:40, Andrew Tropin wrote: > +(define-command (guix-home . args) > + (synopsis "build and deploy home environments") > + > + (define (parse-sub-command arg result) > + ;; Parse sub-command ARG and augment RESULT accordingly. > + (if (assoc-ref result 'action) > + (alist-cons 'argument arg result) > + (let ((action (string->symbol arg))) > + (case action > + ((build > + reconfigure > + extension-graph shepherd-graph > + list-generations describe > + delete-generations roll-back > + switch-generation search > + import) > + (alist-cons 'action action result)) > + (else (leave (G_ "~a: unknown action~%") action)))))) For parsing the actions, I would define elsewhere the list. Then if the action is unknown, you could use =E2=80=99string-closest=E2=80=99 and so re= turn an hint if there is a typo. Other said, this guix home recnfigure would return guix home: error: recnfigure: unknown action hint: Did you mean `reconfigure'? WDYT? Cheers, simon From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 31 07:46:25 2021 Received: (at 50296-done) by debbugs.gnu.org; 31 Aug 2021 11:46:25 +0000 Received: from localhost ([127.0.0.1]:33181 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mL2Dg-0007k9-Rx for submit@debbugs.gnu.org; Tue, 31 Aug 2021 07:46:25 -0400 Received: from mail-lj1-f172.google.com ([209.85.208.172]:44636) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mL2De-0007ju-HB for 50296-done@debbugs.gnu.org; Tue, 31 Aug 2021 07:46:23 -0400 Received: by mail-lj1-f172.google.com with SMTP id s3so31200628ljp.11 for <50296-done@debbugs.gnu.org>; Tue, 31 Aug 2021 04:46:22 -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=+/qld5Krf+/V13XGkjwrcsZfwOLuAiQ3r4uMimhpG2c=; b=b/bwAM4myLheMtWbs8LAJJsulLhMzZh0xP3orT9bDjwlcMxtE/etvojDcki+O08FYC SuJKYzObz2s/g0pbU7S8ZwHbnULfiOYfLmLfwjBYE9rs9WP/t78coHhEhfLrZ/mXwSmE GHpotLm/9rnLyxNimNrB2R+jB1+UvnsIML63XdAXiG6ktOa+JE1fB7ny2X2yy089BzAw h3Fiz4S2eyTe2KTnBZKL/Xeg25gMSqk3ZUqjNvmlPcQ6JaF49tpU2pZQZKMBTBSuBT3e MjwRqJjAqNNSpMg7D7B0WJOMWS147P19KY3Fde1kUYGSO9k9Fri3o1aI+/s9Lk4MXpA5 dlYA== 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=+/qld5Krf+/V13XGkjwrcsZfwOLuAiQ3r4uMimhpG2c=; b=ElrUc4QdqevNT2W4NeeMuyllE2IQXHGHp2/XO0IQrZ0goupQ71L7kNVUV0z2wkpaJk riuuwv+WKVb81LvchyE/AIz8kICfcZWGUyRUsxS1YbBz+Stq1VL7ev7UpKI6BKRs1pEI nIb6WwJlBt3f2Rb9qQvsIm1BvOl1h+5F3Dix8XVgZSaOSuLUbUtrGcmpJgGPGr07oGrm MQiy89waiB/5OKm2f3mNERreQ9mQgXNeEJA88qPEeYhPsmVQ4DtotzlfPngP+8Xvg/Zt 8Hszu7RozSDmuLTh81zLOPqCBvjS/1T+eAztB+yQ+YSuZBUDMUd3SQoHgY4GE8bzmKrS 7lXQ== X-Gm-Message-State: AOAM5331+07PmyaUPquHXcyh2S683xKm7VbmEzMMOxrFxXbcR9nINwjI PDTeyy1HCtfGz9GewiYeqJ4bbg== X-Google-Smtp-Source: ABdhPJyoFeiIOy01nBHT/XTxrhHkz8BI/gtoTU1G3rlLvYsuGtzCSWs8FuWuqy1DEr4zFr00K6qkqA== X-Received: by 2002:a2e:b529:: with SMTP id z9mr24414725ljm.149.1630410376204; Tue, 31 Aug 2021 04:46:16 -0700 (PDT) Received: from localhost (109-252-93-92.nat.spd-mgts.ru. [109.252.93.92]) by smtp.gmail.com with ESMTPSA id bn3sm2347783ljb.18.2021.08.31.04.46.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Aug 2021 04:46:15 -0700 (PDT) From: Andrew Tropin To: Oleg Pykhalov Subject: Re: [bug#50296] [PATCH 0/2] Add 'guix home' command. In-Reply-To: <87tuj598an.fsf@gmail.com> References: <874kb6j718.fsf@trop.in> <87tuj598an.fsf@gmail.com> Date: Tue, 31 Aug 2021 14:46:11 +0300 Message-ID: <87sfypj0qk.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: 50296-done Cc: 50296-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-31 14:13, Oleg Pykhalov wrote: > Hi Andrew, > > Andrew Tropin writes: > >> Command and subbcommands allowing to manage home environment with guix. >> >> Andrew Tropin (2): >> scripts: Add 'guix home'. >> scripts: home: Add import subcommand. >> >> Makefile.am | 3 + >> guix/scripts/home.scm | 512 +++++++++++++++++++++++++++++++++++ >> guix/scripts/home/import.scm | 241 +++++++++++++++++ >> 3 files changed, 756 insertions(+) >> create mode 100644 guix/scripts/home.scm >> create mode 100644 guix/scripts/home/import.scm > > I applied your patches and also fixed a typo in > gnu/home-services/xdg.scm file, which I noticed during Geiser entering > (guix scripts home) module about missing =E2=80=98home-services-utils=E2= =80=99, which > should be =E2=80=98home-services utils=E2=80=99. > In rde we have home-services-utils, during recent refactoring I took parts of it and split into home-services utils and home-services configure modules. For some reason I missed that xdg still uses it and I didn't get rid of this import, I'll update xdg module and send patches for it, thank you for noticing the issue. >=20 > Pushed to wip-guix-home. > > Also, I tried to use guix home for the first time as documented at site > [1], and got an error: > --8<---------------cut here---------------start------------->8--- > (string-append #f "/" "profile/share/fonts") > In procedure string-append: Wrong type (expecting string): #f > --8<---------------cut here---------------end--------------->8--- > > [1] https://guix-home.trop.in/Declaring-the-Home-Environment.html > > > The following text in the message is only about the error. > > oleg@guixsd ~/src/guix-wip-guix-home$ mkdir /tmp/guix > > oleg@guixsd ~/src/guix-wip-guix-home$ guix pull --url=3Dfile:///home/oleg= /src/guix-wip-guix-home --branch=3Dwip-guix-home -p /tmp/guix/guix > > ~/.local/share/chezmoi/dotfiles/guixsd/home.scm: > --8<---------------cut here---------------start------------->8--- > (use-modules (gnu home) > (gnu home-services) > ;; (gnu home-services ssh) > (gnu home-services shells) > ;; (gnu home-services files) > (gnu services) > (gnu packages admin) > (guix gexp) > > (ice-9 rdelim)) > > (define %home > (and=3D> (getenv "HOME") > (lambda (home) > home))) > > (define .bash_profile > (string-append %home "/.local/share/chezmoi/dot_bash_profile")) > > (home-environment > > ;; (packages (list htop)) > > (services > (list > > (service home-bash-service-type > (home-bash-configuration > (guix-defaults? #t) > (bash-profile > (list > (with-input-from-file .bash_profile read-string))))) > > ;; XXX: missing home-files-service-type > ;; (simple-service 'test-config > ;; home-files-service-type > ;; (list `("config/test.conf" > ;; ,(plain-file "tmp-file.txt" > ;; "the content of ~/.config/test= .conf")))) >=20=20=20=20 > ;; XXX: missing home-ssh-configuration > ;; (service home-ssh-service-type > ;; (home-ssh-configuration > ;; (extra-config > ;; (list > ;; (ssh-host "savannah" > ;; '((compression . #f))))))) > > ))) > --8<---------------cut here---------------end--------------->8--- > > My first guix home reconfigure launch: > --8<---------------cut here---------------start------------->8--- > oleg@guixsd ~/src/guix-wip-guix-home$ /tmp/guix/guix/bin/guix home reconf= igure ~/.local/share/chezmoi/dotfiles/guixsd/home.scm > /gnu/store/xl4igqm0jjy7gfbganz9061ivdgzfpdk-home > New symlinks to home-environment will be created soon. > All conflicting files will go to /home/oleg/1630407324-guix-home-legacy-c= onfigs-backup. > > Skipping /home/oleg/.config (directory already exists)... done > Creating /home/oleg/.config/fontconfig... done > Symlinking /home/oleg/.config/fontconfig/fonts.conf -> /gnu/store/phj2z2i= iqdhryfy7mqral0b9qz3hlva6-fonts.conf... done > Backing up /home/oleg/.bashrc... done > Symlinking /home/oleg/.bashrc -> /gnu/store/513j2xkszmcmv7fiawh59mr0i1fmi= n55-bashrc... done > Symlinking /home/oleg/.profile -> /gnu/store/fxbppk3pqzdi3zzy0xl5vg1ir6c5= jzq5-shell-profile... done > Backing up /home/oleg/.bash_profile... done > Symlinking /home/oleg/.bash_profile -> /gnu/store/2c3yva8vj5ikb0gspmjvzw0= r9g9i1cxc-bash_profile... done > done > Finished updating symlinks. > > Backtrace: > In guix/ui.scm: > 2185:7 19 (run-guix . _) > 2148:10 18 (run-guix-command _ . _) > In ice-9/boot-9.scm: > 1752:10 17 (with-exception-handler _ _ #:unwind? _ # _) > In guix/status.scm: > 820:3 16 (_) > 800:4 15 (call-with-status-report _ _) > In guix/scripts/home.scm: > 214:4 14 (_) > In ice-9/boot-9.scm: > 1752:10 13 (with-exception-handler _ _ #:unwind? _ # _) > In guix/store.scm: > 658:37 12 (thunk) > 1320:8 11 (call-with-build-handler _ _) > 1320:8 10 (call-with-build-handler # =E2=80=A6) > 2108:24 9 (run-with-store # =E2= =80=A6) > In guix/scripts/home.scm: > 169:15 8 (_ _) > In unknown file: > 7 (primitive-load "/gnu/store/xl4igqm0jjy7gfbganz9061ivdg=E2= =80=A6") > In ice-9/eval.scm: > 619:8 6 (_ #(#(#(#(#(#(#(#(#(#(#<=E2=80=A6> =E2=80=A6) =E2=80=A6) = =E2=80=A6) =E2=80=A6) =E2=80=A6) =E2=80=A6) =E2=80=A6) =E2=80=A6) =E2=80=A6= ) =E2=80=A6)) > 626:19 5 (_ #(#(#(#(#(#(#(#(#(#(#<=E2=80=A6> =E2=80=A6) =E2=80=A6) = =E2=80=A6) =E2=80=A6) =E2=80=A6) =E2=80=A6) =E2=80=A6) =E2=80=A6) =E2=80=A6= ) =E2=80=A6)) > In srfi/srfi-1.scm: > 586:17 4 (map1 (("profile/share/fonts" (system* "/gnu/stor=E2=80=A6" = =E2=80=A6)))) > In ice-9/eval.scm: > 293:34 3 (_ #(#(# #= ) #)) > In unknown file: > 2 (string-append #f "/" "profile/share/fonts") > In ice-9/boot-9.scm: > 1685:16 1 (raise-exception _ #:continuable? _) > 1685:16 0 (raise-exception _ #:continuable? _) > > ice-9/boot-9.scm:1685:16: In procedure raise-exception: > In procedure string-append: Wrong type (expecting string): #f run-on-change service doesn't handle the case, where the previous generation doesn't exists. Fix should be pretty simple, will send a patch once it done. Thank you for catching this) > --8<---------------cut here---------------end--------------->8--- > > I skipped the error and tried to configure Bash more: > --8<---------------cut here---------------start------------->8--- > (define .bashrc > (string-append %home "/.local/share/chezmoi/dot_bashrc")) > > ;; ... > > (home-bash-configuration > ;; ... > (bashrc > (list > (with-input-from-file .bashrc read-string)))) > --8<---------------cut here---------------end--------------->8--- > > Another launch, no errors this time: > --8<---------------cut here---------------start------------->8--- > oleg@guixsd ~/src/guix-wip-guix-home$ /tmp/guix/guix/bin/guix home reconf= igure ~/.local/share/chezmoi/dotfiles/guixsd/home.scm > substitute: updating substitutes from 'https://ci.guix.gnu.org'... 100.0% > substitute: updating substitutes from 'https://bordeaux.guix.gnu.org'... = 100.0% > The following derivations will be built: > /gnu/store/fn1hzpyic1k32pamyf45vwa0x3lw046g-home.drv > /gnu/store/akdwz30lx0widqvyqmnkya45cb78f74d-files.drv > /gnu/store/xcvi7n1l0fvsm099x2vyg6xci0qkayzp-bashrc.drv > /gnu/store/pm1gw2xakkqj0zxsbbq0jnwgv3v95ajj-provenance.drv > building /gnu/store/pm1gw2xakkqj0zxsbbq0jnwgv3v95ajj-provenance.drv... > successfully built /gnu/store/pm1gw2xakkqj0zxsbbq0jnwgv3v95ajj-provenance= .drv > building /gnu/store/xcvi7n1l0fvsm099x2vyg6xci0qkayzp-bashrc.drv... > successfully built /gnu/store/xcvi7n1l0fvsm099x2vyg6xci0qkayzp-bashrc.drv > building /gnu/store/akdwz30lx0widqvyqmnkya45cb78f74d-files.drv... > successfully built /gnu/store/akdwz30lx0widqvyqmnkya45cb78f74d-files.drv > building /gnu/store/fn1hzpyic1k32pamyf45vwa0x3lw046g-home.drv... > successfully built /gnu/store/fn1hzpyic1k32pamyf45vwa0x3lw046g-home.drv > /gnu/store/1y84hzz1m1c3jw03n2g8hn9wwyxngab3-home > Cleaning up symlinks from previous home-environment. > > Removing /home/oleg/.config/fontconfig/fonts.conf... done > Removing /home/oleg/.config/fontconfig... done > Skipping /home/oleg/.config (not an empty directory)... done > Removing /home/oleg/.bashrc... done > Removing /home/oleg/.profile... done > Removing /home/oleg/.bash_profile... done > Cleanup finished. > > New symlinks to home-environment will be created soon. > All conflicting files will go to /home/oleg/1630407412-guix-home-legacy-c= onfigs-backup. > > Skipping /home/oleg/.config (directory already exists)... done > Creating /home/oleg/.config/fontconfig... done > Symlinking /home/oleg/.config/fontconfig/fonts.conf -> /gnu/store/phj2z2i= iqdhryfy7mqral0b9qz3hlva6-fonts.conf... done > Symlinking /home/oleg/.bashrc -> /gnu/store/lf51wflmvx91m2jx8hx3j34qs9x1k= 153-bashrc... done > Symlinking /home/oleg/.profile -> /gnu/store/fxbppk3pqzdi3zzy0xl5vg1ir6c5= jzq5-shell-profile... done > Symlinking /home/oleg/.bash_profile -> /gnu/store/2c3yva8vj5ikb0gspmjvzw0= r9g9i1cxc-bash_profile... done > done > Finished updating symlinks. > > Comparing /gnu/store/xl4igqm0jjy7gfbganz9061ivdgzfpdk-home/profile/share/= fonts and > /gnu/store/1y84hzz1m1c3jw03n2g8hn9wwyxngab3-home/profile/share/= fonts... done (same) > Evaling on-change gexps. > > On-change gexps evaluation finished. > --8<---------------cut here---------------end--------------->8--- > > Oleg. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmEuFoMACgkQIgjSCVjB 3rBeTQ//R/adsPvLRB0+bkYq8O8PGYWCLpKLdu9XPuqMuN+FjceajxaqA4hZrTug RP4RSGjQjuy9pVvHBfZ5sYU0h2D/YSrK6piwlyzpa6vmaZvcANCARyi6NjRL1f9W Qf0LN+JGLc4WJTjmx/5WPpTuwXJ3/mlLDNRhLr7KpKb56z4Z5c/y618593fTdUP7 FzNQVfUiQbetjmhgYmw1OS9qTMDA+DcJOnHA4qIgtwtX/HMelLwUEVKMXJWHHtsD QQzbXg9Hi3iuOgB5zVy/yEfVDYmQwIEKOedutIr3dcdz3ZApGcgd9pVNPHnJSVx7 f3fgCOOeE+4dX+QqNGQbN35MCQZ8QldM+VA+VAKOkVXFaNGX6k+rHOUQZoZC7tqb RMRJszxGUUL/z39DAZJgwxiNyDz5bsDv1QAtPZFzy8gNrGBBpFQ7kvxTlr4C/WQq hDC/1U/xF9hQoRbt7soMep4Pj0p1rU9SeiIY6I1ZQIAQdWRlHKOaLsKRLWk9wdLi 0pD6/SPoqWV2E/Ardsc3NXF2X/8PLCdocUiyelg5F3leGdYNlyx+/kxk687cJBUv Sh9uqndCOw++5R2DvKBdhxSWhkS100dxYMKoCHUKOL//eP3Vu6f1dGcNSN2/mGZN TePxYA/W09ZWC8u4GJGpVIumI/soYFLuiHKtpvVP9suALgL5mWA= =HP6T -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 31 08:03:43 2021 Received: (at 50296) by debbugs.gnu.org; 31 Aug 2021 12:03:43 +0000 Received: from localhost ([127.0.0.1]:33207 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mL2UR-00089f-0a for submit@debbugs.gnu.org; Tue, 31 Aug 2021 08:03:43 -0400 Received: from mail-lj1-f182.google.com ([209.85.208.182]:44673) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mL2UN-00089R-OS for 50296@debbugs.gnu.org; Tue, 31 Aug 2021 08:03:40 -0400 Received: by mail-lj1-f182.google.com with SMTP id s3so31292797ljp.11 for <50296@debbugs.gnu.org>; Tue, 31 Aug 2021 05:03: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:references:date:message-id:mime-version; bh=M8udMqIdz4Hw9drdPdB97haY4bzs5RZwbzKMVAiSfl0=; b=Nx3U9u5r98/TH8DI6f0S7hcw/eePDE/nSKBEvDJgs9mxkbTQvn238vnEcA+PdksbH0 iVzcqvqQw9t2aQRAJzBjs6+65XzGluE0tlN0vPIkbDHWIicD+bMh3sQbCnZRLE9fdZ0m YlASKShIAT8dweqSzj5E0JMs6YupNdJEEZc8G4xXLb9VbK45RA79/X6Z+L2Ad0EMkq0H HuVYMNPzOle/RrIognJnH9gc93ykLXC2bnMsmUhhMhinHgsWX5DMY+0rzeMotvkJoc3Q jlj1gO/nQBvo17M7S29yrY5BYizpY0FJgo7/NnKNyh91CBK4zwKiAs3guwgSiUfY9HUe C0jw== 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=M8udMqIdz4Hw9drdPdB97haY4bzs5RZwbzKMVAiSfl0=; b=Z9a3xY+MyzVgsDKyPpfVOtpZY9YkxhSEl3KTN6tOTx1Qwsc35cOB89p1eFm83z7Lqc 7Wnytt9oPho6a3s0A5zZi7h9Xjnsp2db3MMknYe4VUJPKGhm/Uej/TVEuhgM1wd6XS9l eF/AV/tsNnQomOdSrAwOo7R14/yZN4chrXdqj+B4VhT35vaqPBx1rZIUSIHc0XhaKPjS PaTm5YyoGnzDPdVZezzo8stCy3/QdskC3f/TiB+8CcQRu+UXw98D6v1UIx3xd3v+ObVw EQbqCj5dMyKMEVPukpADdTJLVRjop7SKhorpUl9+Gs7tQZAdGJKhSq/mGYU04n04urVe U3Ug== X-Gm-Message-State: AOAM531pxUsrGuJEbpFQInnGwVHxexo6sSWQbzO2n+ZDTw6XPnm79RLN 8ai/giLNAoSslS5upKBw0+JEHA== X-Google-Smtp-Source: ABdhPJxvPPU8jUilz6r/ilgCRhMs4TPaUTzeuyfy2ko/ZPkUyVyYagyy7I4TRWGlhT2mVYFyzkMT9w== X-Received: by 2002:a2e:9848:: with SMTP id e8mr24462846ljj.493.1630411410250; Tue, 31 Aug 2021 05:03:30 -0700 (PDT) Received: from localhost (109-252-93-92.nat.spd-mgts.ru. [109.252.93.92]) by smtp.gmail.com with ESMTPSA id w12sm1663460lfd.276.2021.08.31.05.03.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Aug 2021 05:03:29 -0700 (PDT) From: Andrew Tropin To: zimoun , 50296@debbugs.gnu.org Subject: Re: [bug#50296] [PATCH 0/2] Add 'guix home' command. In-Reply-To: <86tuj5opr0.fsf@gmail.com> References: <874kb6j718.fsf@trop.in> <86tuj5opr0.fsf@gmail.com> Date: Tue, 31 Aug 2021 15:03:26 +0300 Message-ID: <87lf4hizxt.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: 50296 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 On 2021-08-31 12:46, zimoun wrote: > Hi Andrew, > > On Tue, 31 Aug 2021 at 12:28, Andrew Tropin wrote: >> Command and subbcommands allowing to manage home environment with guix. >> >> Andrew Tropin (2): >> scripts: Add 'guix home'. >> scripts: home: Add import subcommand. > > Raghav recently asked [1] an interesting question about consistency of > command line commands, i.e., compare for instance: > > guix system roll-back > guix pull --roll-back > guix package --roll-back > > I do not have an opinion but is it a conscientious or discussed choice > for subcommands?=20 > Yeah, I also mentioned this inconsistency, but I decided to stick to the 'guix system' approach and use subcommands. I'm not sure, which one is better, I would like to have pull, package and system to work the same way, but it seems that such refactoring will berak people setups. Anyway, I will be keeping the "compatibility" with 'guix system', so if we decide to change its interface, 'guix home's interface will be changed too. > > > All the best, > simon > > > 1: --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmEuGo4ACgkQIgjSCVjB 3rBcug/8D7NUpsXz0O3UXBs8FhvVLWdw0oIavftR+rNZnJdAzR4NXK2wShkBX2Zl jokwldbZvChvDpWE++96VFasBQJ56arvDOjZz4ZbAsaS+XUraZrJaM4f2MbSqU+q rgVvyf6XjAF0GBh39U2uFkb0vbZ2oSbmg0AhPgLNOXMkncIvvFCO1OXgrWOaLeyI aZrQlZa6P+C3ACBT+NzJzuMOxaI7TuZwJeEZdLRMchWPxV2I/jRTzY+BkWssRF1r EkA8LhbZ+6o1+d6CXq8c5wmIwCoxpTUsvlNaFe+fbkR8uGdMMo8v4TBA3gMsIugb dou3pNXJgc4g0U65XBdJ7r9o5k4IyNAD80eEGkF9MmHA2Bks2hm+6h5zJPa91NQj ljWY6k2BWjCnTwBuZ2zUgSQ6MMm+NFz1G4w7Df5dBInCv7zVV/m7aSplAEx8QZj/ jBBURvZQLVIO/ItGse0xqYI918oVJNQbU194DlvlezAyHLlR5ZJc0zRgaVghqB0i Kl5qi7h9d64lepC61pG8GzO3k0BHCquwm1n2M1IopuE+PmYBwhnrp3FtX3OQ3ERX XUylDf8dUjWC1DDcSVAvBnAz9biXd2Ri+8DwC/hb7l8drQ804hK821dAWDL3hjkU 8WzNPwC/KZxikAJ6iCR0ShjCS+Rd/80s6LzOfCp0Ufx6YItdCOA= =bKOs -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 31 08:12:45 2021 Received: (at 50296) by debbugs.gnu.org; 31 Aug 2021 12:12:45 +0000 Received: from localhost ([127.0.0.1]:33223 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mL2d7-0008Ma-PS for submit@debbugs.gnu.org; Tue, 31 Aug 2021 08:12:45 -0400 Received: from mail-lj1-f174.google.com ([209.85.208.174]:44024) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mL2d2-0008MJ-0F for 50296@debbugs.gnu.org; Tue, 31 Aug 2021 08:12:40 -0400 Received: by mail-lj1-f174.google.com with SMTP id j12so31283748ljg.10 for <50296@debbugs.gnu.org>; Tue, 31 Aug 2021 05:12:35 -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=ToAfOEIvOeMdmH0eJgXULUV6COV19vrJld3aYgV5tZQ=; b=iG8Ir69skqPZWKzEJ7smcLZ8uAFpODxANVN7kWZTqPvDRKliU9wdJyZ38oMVhYnTGf C68q+LHq4vW1tEz0SPYPrShBirtXG2MZmD7o+kquwft8kmUzRI2cdGR3lK/S4DiFLHwV EC7cZ2Nv2JW9vfax4q/rQiBOWy+H68wSteVA3rmgzyhy0tzRsh6G0Ux6/zZN7tDjg7yA F9+JDd/zAHhveHgNBZcOlCalWSTc/ulHJSvxtTrp1pbLPD9waqKIg/0k1LRU+6I76L9H 1rj0BnPkfCcnrOnu1E3EYjJCgi52w2WIyb7YKHgefGwOR2268dLxQeY0TWHjEW0/wu7j zwbw== 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=ToAfOEIvOeMdmH0eJgXULUV6COV19vrJld3aYgV5tZQ=; b=M+mYdkSSEyWPHZYybSC8G0yxjVCk+X/ORca67ED9R+8DPjwBe1W9eWCeGgJ/i9sEDi EeJGY0r5QuEXRIwGGJjZmUyK0p13OchbloaWLUTz/yR1WA8zMimp0c+13j7RsDVdtu5+ l1vzKneY81C0o3hE2czmfyXlL+MYkFvhlgNDQ0m/l2TOzlfYGYvDSC5kwS710mEK14fV nUX6KtHzOBAGOWJCpOIIizLnc18jx6fHTrGNYsX0cuPR1ata0niNQspjYWqWW9dgRYIs IQu369zvw57JJ+XmGUldpqkHWwu5GNlRbGU1kvSeGOlN2Pqg6RCkx6oxkjvwG1+liHFI QJPQ== X-Gm-Message-State: AOAM531kwGtkdH//TB/itZbbQOEGc/ttq9N2Jn7BlffI0JONd0Pm0vRK iq2fDRiqsyrsUfyFRVe2mQI3iw== X-Google-Smtp-Source: ABdhPJyXXMhTj6Aa8mxhTzNJXiDT6Q8hLJrMz1NtV8bJcZrxrlZvhd7Vf/WYbnmnG9IPsX7zY0BMfw== X-Received: by 2002:a2e:88d0:: with SMTP id a16mr24825790ljk.81.1630411949831; Tue, 31 Aug 2021 05:12:29 -0700 (PDT) Received: from localhost (109-252-93-92.nat.spd-mgts.ru. [109.252.93.92]) by smtp.gmail.com with ESMTPSA id 17sm970553lfr.79.2021.08.31.05.12.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Aug 2021 05:12:29 -0700 (PDT) From: Andrew Tropin To: zimoun , 50296@debbugs.gnu.org Subject: Re: [bug#50296] [PATCH 1/2] scripts: Add 'guix home'. In-Reply-To: <86pmttopfk.fsf@gmail.com> References: <874kb6j718.fsf@trop.in> <87y28ihs07.fsf@trop.in> <86pmttopfk.fsf@gmail.com> Date: Tue, 31 Aug 2021 15:12:26 +0300 Message-ID: <87ilzlizit.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: 50296 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-31 12:53, zimoun wrote: > Hi, > > On Tue, 31 Aug 2021 at 12:40, Andrew Tropin wrote: > >> +(define-command (guix-home . args) >> + (synopsis "build and deploy home environments") >> + >> + (define (parse-sub-command arg result) >> + ;; Parse sub-command ARG and augment RESULT accordingly. >> + (if (assoc-ref result 'action) >> + (alist-cons 'argument arg result) >> + (let ((action (string->symbol arg))) >> + (case action >> + ((build >> + reconfigure >> + extension-graph shepherd-graph >> + list-generations describe >> + delete-generations roll-back >> + switch-generation search >> + import) >> + (alist-cons 'action action result)) >> + (else (leave (G_ "~a: unknown action~%") action)))))) > > For parsing the actions, I would define elsewhere the list. Then if the > action is unknown, you could use =E2=80=99string-closest=E2=80=99 and so = return an hint > if there is a typo. > > Other said, this > > guix home recnfigure > > would return > > guix home: error: recnfigure: unknown action > hint: Did you mean `reconfigure'? > > WDYT? > Sounds good, the same "issue" exists for guix system subcommands, it would be cool to have such functionality, but I would like to have those changes to both guix system and guix home after wip-guix-home merged, because backporting changes to rde is a little tedious. Also, it seems related to subcommands/--arguments discussion and maybe better to talk about it in a separate thread. >=20 > Cheers, simon --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmEuHKoACgkQIgjSCVjB 3rDNKg/+Odxm/7m8GkuO2mvU4LMKdRFENKho6MDtSsML+x7zaWcuD/p9Aibwqbu9 G5p19LUiHEe+zvoUIO8OjMnvBhkynCa/TlyuMnkuEbCshRmisGIeaxQ20aP/UVUX XuWT7VxmqNAN5FZ18JckFSQwnEGsrUL/0r7bMcL08Koez3SnR1Hczpw8tw0b2zvF hs6VcrPDV6kyGk1rF4nyRiygENisGp+JUOCqTM3wU1kR8Ikqap471tPRI0DhfcOX QwfsbmItFAVZj67BnYgebyIazuttqtoPTsHVylQgPRdtaUstpIcZCHAb/x0h4Sr9 IKm0DgN+BgXycrNPYwUdpFBfmoVWzY/0vT0i1cXXyxoGQbcOM/mM/SIMCcm7/M6h Wh+MvmjEmg31KkTO0fIUsiS1cZWj6ejZMFmkL+jwyczbRVrSPJ8YgXT/8epmJBpS RiEm9blscWOhnv4IBkqEHxUjpKi2uXVVWJX5AoAsdvS4deniCILRB+dSugsmViU7 1eec8NQg5GI6/6TS6vTdqiIuG9pE6+BsinST5CoGxvu7DoaWEcQ9qAQh9RMeisC9 YCH1e+rleF6030AGJFUdHL9NgJrP3v2tg5DaQfTYuUXqJM3li60WZUgpnwkfc+At 3nP9Fkf5MueiKMw0RRxAtFo0nU0P1PQwInhbrjDh7b4f1YyjcbI= =FnWQ -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 31 08:47:18 2021 Received: (at 50296-done) by debbugs.gnu.org; 31 Aug 2021 12:47:18 +0000 Received: from localhost ([127.0.0.1]:33263 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mL3Ab-0002ff-Db for submit@debbugs.gnu.org; Tue, 31 Aug 2021 08:47:18 -0400 Received: from mail-lf1-f50.google.com ([209.85.167.50]:45038) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mL3AY-0002Yw-10 for 50296-done@debbugs.gnu.org; Tue, 31 Aug 2021 08:47:16 -0400 Received: by mail-lf1-f50.google.com with SMTP id s10so13408856lfr.11 for <50296-done@debbugs.gnu.org>; Tue, 31 Aug 2021 05:47:13 -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=Cmm/VprkPXUHBIWLN1aunXlh+kj8Qo8z/SdxkqxU858=; b=rfKGbIvf+TDw4RCa0BWUgIB96MCLIJHht2S5yRwqOVKeWVgRD7JHY06Z5CTNUFmFLv Y59cSrkHfG6dTXl92bF0yrrnoqIfuEQPeHvKyr82RukCL9D/Hcc0KqEuddcJ0vGpclBX 1u6DRc4rbj7Y/ECFTsGKbjgBJ/11hz83rvOu0OKdIVklff1XaLdPzm4tat/5Vkjvw7EQ Tqq6pCapF2Zo8GftZRGMI/+Bk1CC61HCDAvy1RIYh2xkH0Kk9es0dVjLcZ2gDbxIyK/1 vw7bAIkCJpLYoMLeepLVZ8Jk93f+Vp8nErTn3xXjtgMt26u2BLCzY2DeuFu4UThv0oXS F7YQ== 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=Cmm/VprkPXUHBIWLN1aunXlh+kj8Qo8z/SdxkqxU858=; b=gSZZOf+2wY5ZFgUwL7TBQGape8gDd1WtSuIQuILWzqsn3llkTYRNTi1c3Rzkp/s2RJ cFb79rEmNK6niNq4GXvFfZsHbq5b3Pr1di2NAPR53gBD7COmvfLYa5JB8kBfVi8PvvJ5 4GaNjEf4mazha+N5cqtvqiOf7KrohGyhqF2oumdHEH8Yh6OdYL39KHwqKRigIiPx+K2X 0W8J+Xms9SewkkO6oZT7tCjcjBBo6X5e0kB3lZ5lHsRqCOQHapIttpLai0ACLONWLxqx WGg06br+GK3SBryLnZCPM9fLs/3RWb8ZnVg2vAp7Far769eMetDgSmQrX62AqZCnphwq ZMiQ== X-Gm-Message-State: AOAM530+TmvI0EMPxg8pA8KJv9bhJfSlTF8uRXx7/mWIYAWRDQKgO4s8 Z+m4Q7MSZ9S57UtinB96vzUqJw== X-Google-Smtp-Source: ABdhPJyCH8bW2NbsSvfzECXI2W0L4cl4Ad5XFI0dqYZUWooS9obnU3MMMKENXlb31v1aIAm/90mJXQ== X-Received: by 2002:a05:6512:3d9f:: with SMTP id k31mr20842490lfv.137.1630414027876; Tue, 31 Aug 2021 05:47:07 -0700 (PDT) Received: from localhost (109-252-93-92.nat.spd-mgts.ru. [109.252.93.92]) by smtp.gmail.com with ESMTPSA id e4sm1076692lfc.141.2021.08.31.05.47.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Aug 2021 05:47:06 -0700 (PDT) From: Andrew Tropin To: Oleg Pykhalov Subject: Re: [bug#50296] [PATCH 0/2] Add 'guix home' command. In-Reply-To: <87sfypj0qk.fsf@trop.in> References: <874kb6j718.fsf@trop.in> <87tuj598an.fsf@gmail.com> <87sfypj0qk.fsf@trop.in> Date: Tue, 31 Aug 2021 15:47:03 +0300 Message-ID: <87eea9ixx4.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: On 2021-08-31 14:46, Andrew Tropin wrote: > On 2021-08-31 14:13, Oleg Pykhalov wrote: > >> Hi Andrew, >> >> Andrew Tropin writes: >> >>> Command and subbcommands allowing to manage home environment with guix. >>> >>> Andrew T [...] 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_MSPIKE_H2 RBL: Average reputation (+2) [209.85.167.50 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.167.50 listed in list.dnswl.org] X-Debbugs-Envelope-To: 50296-done Cc: 50296-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: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2021-08-31 14:46, Andrew Tropin wrote: > On 2021-08-31 14:13, Oleg Pykhalov wrote: > >> Hi Andrew, >> >> Andrew Tropin writes: >> >>> Command and subbcommands allowing to manage home environment with guix. >>> >>> Andrew Tropin (2): >>> scripts: Add 'guix home'. >>> scripts: home: Add import subcommand. >>> >>> Makefile.am | 3 + >>> guix/scripts/home.scm | 512 +++++++++++++++++++++++++++++++++++ >>> guix/scripts/home/import.scm | 241 +++++++++++++++++ >>> 3 files changed, 756 insertions(+) >>> create mode 100644 guix/scripts/home.scm >>> create mode 100644 guix/scripts/home/import.scm >> >> I applied your patches and also fixed a typo in >> gnu/home-services/xdg.scm file, which I noticed during Geiser entering >> (guix scripts home) module about missing =E2=80=98home-services-utils=E2= =80=99, which >> should be =E2=80=98home-services utils=E2=80=99. >> > > In rde we have home-services-utils, during recent refactoring I took > parts of it and split into home-services utils and home-services > configure modules. For some reason I missed that xdg still uses it and > I didn't get rid of this import, I'll update xdg module and send patches > for it, thank you for noticing the issue. > The functions from home-services-utils used by xdg now in home-services utils: --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline; filename=0002-home-services-configuration-Add-generic-serialize-al.patch Content-Transfer-Encoding: quoted-printable From=20efd3ea79905c12e2c1c594fa6b54cf62d741f92f Mon Sep 17 00:00:00 2001 From: Andrew Tropin Date: Tue, 31 Aug 2021 15:40:07 +0300 Subject: [PATCH 2/2] home-services: configuration: Add generic-serialize-alist. * gnu/home-services/configuration.scm (generic-serialize-alist) (generic-serialize-alist-entry): New variables. =2D-- gnu/home-services/configuration.scm | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/gnu/home-services/configuration.scm b/gnu/home-services/config= uration.scm index 039877b5c1..3698006c37 100644 =2D-- a/gnu/home-services/configuration.scm +++ b/gnu/home-services/configuration.scm @@ -1,5 +1,6 @@ ;;; 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. ;;; @@ -20,6 +21,8 @@ #:use-module (gnu services configuration) #:use-module (guix gexp) #:use-module (srfi srfi-1) + #:use-module (ice-9 curried-definitions) + #:use-module (ice-9 match) =20 #:export (filter-configuration-fields =20 @@ -31,7 +34,9 @@ string-or-gexp? serialize-string-or-gexp text-config? =2D serialize-text-config)) + serialize-text-config + generic-serialize-alist-entry + generic-serialize-alist)) =20 (define* (filter-configuration-fields configuration-fields fields #:optional negate?) @@ -79,3 +84,24 @@ the list result in @code{#t} when applying PRED? on them= ." (and (list? config) (every string-or-gexp? config))) (define (serialize-text-config field-name val) #~(string-append #$@(interpose val "\n" 'suffix))) + +(define ((generic-serialize-alist-entry serialize-field) entry) + "Apply the SERIALIZE-FIELD procedure on the field and value of ENTRY." + (match entry + ((field . val) (serialize-field field val)))) + +(define (generic-serialize-alist combine serialize-field fields) + "Generate a configuration from an association list FIELDS. + +SERIALIZE-FIELD is a procedure that takes two arguments, it will be +applied on the fields and values of FIELDS using the +@code{generic-serialize-alist-entry} procedure. + +COMBINE is a procedure that takes one or more arguments and combines +all the alist entries into one value, @code{string-append} or +@code{append} are usually good candidates for this. + +See the @code{serialize-alist} procedure in `@code{(gnu home-services +version-control}' for an example usage.)}" + (apply combine + (map (generic-serialize-alist-entry serialize-field) fields))) =2D-=20 2.33.0 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable > >>=20 >> Pushed to wip-guix-home. >> >> Also, I tried to use guix home for the first time as documented at site >> [1], and got an error: >> --8<---------------cut here---------------start------------->8--- >> (string-append #f "/" "profile/share/fonts") >> In procedure string-append: Wrong type (expecting string): #f >> --8<---------------cut here---------------end--------------->8--- >> >> [1] https://guix-home.trop.in/Declaring-the-Home-Environment.html >> >> >> The following text in the message is only about the error. >> >> oleg@guixsd ~/src/guix-wip-guix-home$ mkdir /tmp/guix >> >> oleg@guixsd ~/src/guix-wip-guix-home$ guix pull --url=3Dfile:///home/ole= g/src/guix-wip-guix-home --branch=3Dwip-guix-home -p /tmp/guix/guix >> >> ~/.local/share/chezmoi/dotfiles/guixsd/home.scm: >> --8<---------------cut here---------------start------------->8--- >> (use-modules (gnu home) >> (gnu home-services) >> ;; (gnu home-services ssh) >> (gnu home-services shells) >> ;; (gnu home-services files) >> (gnu services) >> (gnu packages admin) >> (guix gexp) >> >> (ice-9 rdelim)) >> >> (define %home >> (and=3D> (getenv "HOME") >> (lambda (home) >> home))) >> >> (define .bash_profile >> (string-append %home "/.local/share/chezmoi/dot_bash_profile")) >> >> (home-environment >> >> ;; (packages (list htop)) >> >> (services >> (list >> >> (service home-bash-service-type >> (home-bash-configuration >> (guix-defaults? #t) >> (bash-profile >> (list >> (with-input-from-file .bash_profile read-string))))) >> >> ;; XXX: missing home-files-service-type >> ;; (simple-service 'test-config >> ;; home-files-service-type >> ;; (list `("config/test.conf" >> ;; ,(plain-file "tmp-file.txt" >> ;; "the content of ~/.config/tes= t.conf")))) >>=20=20=20=20 >> ;; XXX: missing home-ssh-configuration >> ;; (service home-ssh-service-type >> ;; (home-ssh-configuration >> ;; (extra-config >> ;; (list >> ;; (ssh-host "savannah" >> ;; '((compression . #f))))))) >> >> ))) >> --8<---------------cut here---------------end--------------->8--- >> >> My first guix home reconfigure launch: >> --8<---------------cut here---------------start------------->8--- >> oleg@guixsd ~/src/guix-wip-guix-home$ /tmp/guix/guix/bin/guix home recon= figure ~/.local/share/chezmoi/dotfiles/guixsd/home.scm >> /gnu/store/xl4igqm0jjy7gfbganz9061ivdgzfpdk-home >> New symlinks to home-environment will be created soon. >> All conflicting files will go to /home/oleg/1630407324-guix-home-legacy-= configs-backup. >> >> Skipping /home/oleg/.config (directory already exists)... done >> Creating /home/oleg/.config/fontconfig... done >> Symlinking /home/oleg/.config/fontconfig/fonts.conf -> /gnu/store/phj2z2= iiqdhryfy7mqral0b9qz3hlva6-fonts.conf... done >> Backing up /home/oleg/.bashrc... done >> Symlinking /home/oleg/.bashrc -> /gnu/store/513j2xkszmcmv7fiawh59mr0i1fm= in55-bashrc... done >> Symlinking /home/oleg/.profile -> /gnu/store/fxbppk3pqzdi3zzy0xl5vg1ir6c= 5jzq5-shell-profile... done >> Backing up /home/oleg/.bash_profile... done >> Symlinking /home/oleg/.bash_profile -> /gnu/store/2c3yva8vj5ikb0gspmjvzw= 0r9g9i1cxc-bash_profile... done >> done >> Finished updating symlinks. >> >> Backtrace: >> In guix/ui.scm: >> 2185:7 19 (run-guix . _) >> 2148:10 18 (run-guix-command _ . _) >> In ice-9/boot-9.scm: >> 1752:10 17 (with-exception-handler _ _ #:unwind? _ # _) >> In guix/status.scm: >> 820:3 16 (_) >> 800:4 15 (call-with-status-report _ _) >> In guix/scripts/home.scm: >> 214:4 14 (_) >> In ice-9/boot-9.scm: >> 1752:10 13 (with-exception-handler _ _ #:unwind? _ # _) >> In guix/store.scm: >> 658:37 12 (thunk) >> 1320:8 11 (call-with-build-handler _ _) >> 1320:8 10 (call-with-build-handler # =E2=80=A6) >> 2108:24 9 (run-with-store # =E2= =80=A6) >> In guix/scripts/home.scm: >> 169:15 8 (_ _) >> In unknown file: >> 7 (primitive-load "/gnu/store/xl4igqm0jjy7gfbganz9061ivdg=E2= =80=A6") >> In ice-9/eval.scm: >> 619:8 6 (_ #(#(#(#(#(#(#(#(#(#(#<=E2=80=A6> =E2=80=A6) =E2=80=A6) = =E2=80=A6) =E2=80=A6) =E2=80=A6) =E2=80=A6) =E2=80=A6) =E2=80=A6) =E2=80=A6= ) =E2=80=A6)) >> 626:19 5 (_ #(#(#(#(#(#(#(#(#(#(#<=E2=80=A6> =E2=80=A6) =E2=80=A6) = =E2=80=A6) =E2=80=A6) =E2=80=A6) =E2=80=A6) =E2=80=A6) =E2=80=A6) =E2=80=A6= ) =E2=80=A6)) >> In srfi/srfi-1.scm: >> 586:17 4 (map1 (("profile/share/fonts" (system* "/gnu/stor=E2=80=A6"= =E2=80=A6)))) >> In ice-9/eval.scm: >> 293:34 3 (_ #(#(# #) #)) >> In unknown file: >> 2 (string-append #f "/" "profile/share/fonts") >> In ice-9/boot-9.scm: >> 1685:16 1 (raise-exception _ #:continuable? _) >> 1685:16 0 (raise-exception _ #:continuable? _) >> >> ice-9/boot-9.scm:1685:16: In procedure raise-exception: >> In procedure string-append: Wrong type (expecting string): #f > > run-on-change service doesn't handle the case, where the previous > generation doesn't exists. Fix should be pretty simple, will send a > patch once it done. Thank you for catching this) > The fix: --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-home-services-run-on-change-Handle-first-generation-.patch Content-Transfer-Encoding: quoted-printable From=20a07541380d412b33c504e5811776062af4e38582 Mon Sep 17 00:00:00 2001 From: Andrew Tropin Date: Tue, 31 Aug 2021 15:24:25 +0300 Subject: [PATCH 1/2] home-services: run-on-change: Handle first generation case. =2D-- gnu/home-services.scm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gnu/home-services.scm b/gnu/home-services.scm index 2a773496f0..5608c65175 100644 =2D-- a/gnu/home-services.scm +++ b/gnu/home-services.scm @@ -448,13 +448,14 @@ with one gexp, but many times, and all gexps must be = idempotent."))) (if any-changes? (cadr x) ""))) '#$pattern-gexp-tuples)) =20 =2D (if #$eval-gexps? + (if (and #$eval-gexps? (getenv "GUIX_OLD_HOME")) (begin (display "Evaling on-change gexps.\n\n") (for-each primitive-eval expressions-to-eval) (display "On-change gexps evaluation finished.\n\n")) (display "\ =2DOn-change gexps won't evaluated, disabled by service configuration.\n"))= )) +On-change gexps won't evaluated, disabled by service configuration or +there are no previos generations.\n")))) =20 (define home-run-on-change-service-type (service-type (name 'home-run-on-change) =2D-=20 2.33.0 --=-=-= Content-Type: text/plain > >> --8<---------------cut here---------------end--------------->8--- >> >> I skipped the error and tried to configure Bash more: >> --8<---------------cut here---------------start------------->8--- >> (define .bashrc >> (string-append %home "/.local/share/chezmoi/dot_bashrc")) >> >> ;; ... >> >> (home-bash-configuration >> ;; ... >> (bashrc >> (list >> (with-input-from-file .bashrc read-string)))) >> --8<---------------cut here---------------end--------------->8--- >> >> Another launch, no errors this time: >> --8<---------------cut here---------------start------------->8--- >> oleg@guixsd ~/src/guix-wip-guix-home$ /tmp/guix/guix/bin/guix home reconfigure ~/.local/share/chezmoi/dotfiles/guixsd/home.scm >> substitute: updating substitutes from 'https://ci.guix.gnu.org'... 100.0% >> substitute: updating substitutes from 'https://bordeaux.guix.gnu.org'... 100.0% >> The following derivations will be built: >> /gnu/store/fn1hzpyic1k32pamyf45vwa0x3lw046g-home.drv >> /gnu/store/akdwz30lx0widqvyqmnkya45cb78f74d-files.drv >> /gnu/store/xcvi7n1l0fvsm099x2vyg6xci0qkayzp-bashrc.drv >> /gnu/store/pm1gw2xakkqj0zxsbbq0jnwgv3v95ajj-provenance.drv >> building /gnu/store/pm1gw2xakkqj0zxsbbq0jnwgv3v95ajj-provenance.drv... >> successfully built /gnu/store/pm1gw2xakkqj0zxsbbq0jnwgv3v95ajj-provenance.drv >> building /gnu/store/xcvi7n1l0fvsm099x2vyg6xci0qkayzp-bashrc.drv... >> successfully built /gnu/store/xcvi7n1l0fvsm099x2vyg6xci0qkayzp-bashrc.drv >> building /gnu/store/akdwz30lx0widqvyqmnkya45cb78f74d-files.drv... >> successfully built /gnu/store/akdwz30lx0widqvyqmnkya45cb78f74d-files.drv >> building /gnu/store/fn1hzpyic1k32pamyf45vwa0x3lw046g-home.drv... >> successfully built /gnu/store/fn1hzpyic1k32pamyf45vwa0x3lw046g-home.drv >> /gnu/store/1y84hzz1m1c3jw03n2g8hn9wwyxngab3-home >> Cleaning up symlinks from previous home-environment. >> >> Removing /home/oleg/.config/fontconfig/fonts.conf... done >> Removing /home/oleg/.config/fontconfig... done >> Skipping /home/oleg/.config (not an empty directory)... done >> Removing /home/oleg/.bashrc... done >> Removing /home/oleg/.profile... done >> Removing /home/oleg/.bash_profile... done >> Cleanup finished. >> >> New symlinks to home-environment will be created soon. >> All conflicting files will go to /home/oleg/1630407412-guix-home-legacy-configs-backup. >> >> Skipping /home/oleg/.config (directory already exists)... done >> Creating /home/oleg/.config/fontconfig... done >> Symlinking /home/oleg/.config/fontconfig/fonts.conf -> /gnu/store/phj2z2iiqdhryfy7mqral0b9qz3hlva6-fonts.conf... done >> Symlinking /home/oleg/.bashrc -> /gnu/store/lf51wflmvx91m2jx8hx3j34qs9x1k153-bashrc... done >> Symlinking /home/oleg/.profile -> /gnu/store/fxbppk3pqzdi3zzy0xl5vg1ir6c5jzq5-shell-profile... done >> Symlinking /home/oleg/.bash_profile -> /gnu/store/2c3yva8vj5ikb0gspmjvzw0r9g9i1cxc-bash_profile... done >> done >> Finished updating symlinks. >> >> Comparing /gnu/store/xl4igqm0jjy7gfbganz9061ivdgzfpdk-home/profile/share/fonts and >> /gnu/store/1y84hzz1m1c3jw03n2g8hn9wwyxngab3-home/profile/share/fonts... done (same) >> Evaling on-change gexps. >> >> On-change gexps evaluation finished. >> --8<---------------cut here---------------end--------------->8--- >> >> Oleg. --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmEuJMcACgkQIgjSCVjB 3rDUmw//a1IxwssRamJwRhFACw8IZ8vpTcp/GdWxaXZKY1oq1kVlp6PM6BzmQ9T9 NL5JcrKrR8uganqrIx7s+x+ONrIdMgGLRLsNb/pLnOtPd4kWuxDhw5KNTDL2KZku LqXZX3YnIJ+Ry9kxzk+p6q9/qVF50xGOERawBv3Z+DHl6kPK6DRPpr1gNh3eR3LP HBBk25bi1Xrd/lWMLTQkNqo9LHiJK7C1R8y62vsfbYKDBdc6lzkcP3kNIoZ9bZyw KkqQgNsibYGj+bC+F+uQpvj8zSy7HBapIkGq/gFnTlhTDvK36B3ZVm81BSLjOOlG FNfnUYb4HdHGdCrOU/vSlpJqN4vmcK7xS2NMVchMWo5+V4jCsINQkWIMHJqwL/WO 5k6tPLddHH5nwXkGdkIUschwt8qdzSz4RIKtF9uDnVkdYYtEZwKzMYDFZvs9tob1 uEDuzt0f9dbX/b2gJA8QYjmz5Bs/Jrc0A9MAHS9/cFdGu0DsDYAc1M9uATA9gfj4 7bDkuCcA0f4YutGMH+IvAl1AgFGauKSA6HKSTg8Zh7pL8plbvQKIDnL8ey2vY8fJ ndJlZjjX40wGSnGZnU7ErwKWk2JH30Q/sgJEL6+7kt15xUZt7b9jS6C9Mqd7GzXI lMENLia8TfZSLjxqc7bMH2X6zlwYX+/HxmipPZpcQKzc+hiWM/0= =z6Xh -----END PGP SIGNATURE----- --==-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 31 09:10:07 2021 Received: (at 50296) by debbugs.gnu.org; 31 Aug 2021 13:10:08 +0000 Received: from localhost ([127.0.0.1]:33291 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mL3Wh-0003XK-Lu for submit@debbugs.gnu.org; Tue, 31 Aug 2021 09:10:07 -0400 Received: from mail-qk1-f182.google.com ([209.85.222.182]:44953) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mL3Wd-0003WY-VC for 50296@debbugs.gnu.org; Tue, 31 Aug 2021 09:10:05 -0400 Received: by mail-qk1-f182.google.com with SMTP id c10so19379540qko.11 for <50296@debbugs.gnu.org>; Tue, 31 Aug 2021 06:10:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=vLOe/RWWzyQsXlVkzCVp6gP6rYKlzVuB8pFdTbUw8OI=; b=Xp6h4j3aZaVjUMwRkm6SLtxSW0yf2u5WqU4d6ISTm7D0UHihiaXyEzZq8+FaZiJrwi pTwZ3vRSUna/o7+nQzVmNiv6oOyhyc9ZrqDsPt5FO4wdpAFkv1lcrhdebon859sKgMUC Xdiu+DvdwGytnu1j7Cx1Og9sk8GP84VC5rpd1d7vpXOP6VQPyAK1R8Np/NEZjjxHa7jN N2XUvL8ndgv36rDB9ciINyUStHOxH6Xy9pjf31EpetuSsyZbcHhio59fKhsjWjvHOPnk 9GH5MjDMNWspwVhZaoR8BEPr95VWkPsR46pnSrD6vMJDs7r2AqOAVW02j/zwCuzBYQXi cMAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=vLOe/RWWzyQsXlVkzCVp6gP6rYKlzVuB8pFdTbUw8OI=; b=dA8B7X4BO2TpSHK6uXbPg1V8P1LNkJUGvw1h3OvviBmjfUDzduAGuO/x7/T+gzS/Ho P7EzgboyCvMEghqPsxwF2cXcSskOOKqqX9iCzGRgSNLVe5YQzeVIQCH9TTxwhVexWM08 ESPWUfzpgBnLJzUWSW1fc/LmFnmWvIqB6kDb9IcwYRfesrG9hK1fg1vwHtSBV9lLJoPV 4RomSRHD1yc/uXbVMXsfHLMqLnc8uGeFY/DSDBvlihFQt8YM/Ohn1rm4DVkVaR7bexlc RypQTsQ+XeJo8QVNozC2OmCh7GH5RqieJSxq55s/2jsCyMxpedS6XSGfsL0ekT6KhS84 tsjA== X-Gm-Message-State: AOAM533HjHRg3IyPY1YAwKoYY6+Lpeyg9L+W86izvr6vR8rzV+0PLF2n e+6vJD29kmYQON9K6STEPrxf+rgUp4+fA7wIpSw= X-Google-Smtp-Source: ABdhPJwF3HIpd/gs8d+HdzKRHNMPg9/Pk9Z4doz6MP4OmcAUuiPVSm25xKIdSKEEy+LH51e7r+skF+qevUyXmgjdJpk= X-Received: by 2002:a05:620a:1aa7:: with SMTP id bl39mr3084587qkb.304.1630415398535; Tue, 31 Aug 2021 06:09:58 -0700 (PDT) MIME-Version: 1.0 References: <874kb6j718.fsf@trop.in> <87y28ihs07.fsf@trop.in> <86pmttopfk.fsf@gmail.com> <87ilzlizit.fsf@trop.in> In-Reply-To: <87ilzlizit.fsf@trop.in> From: zimoun Date: Tue, 31 Aug 2021 15:09:47 +0200 Message-ID: Subject: Re: [bug#50296] [PATCH 1/2] scripts: Add 'guix home'. To: Andrew Tropin Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 50296 Cc: 50296@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 (-) Hi, On Tue, 31 Aug 2021 at 14:12, Andrew Tropin wrote: > On 2021-08-31 12:53, zimoun wrote: > > On Tue, 31 Aug 2021 at 12:40, Andrew Tropin wrote: > > > >> +(define-command (guix-home . args) > >> + (synopsis "build and deploy home environments") > >> + > >> + (define (parse-sub-command arg result) > >> + ;; Parse sub-command ARG and augment RESULT accordingly. > >> + (if (assoc-ref result 'action) > >> + (alist-cons 'argument arg result) > >> + (let ((action (string->symbol arg))) > >> + (case action > >> + ((build > >> + reconfigure > >> + extension-graph shepherd-graph > >> + list-generations describe > >> + delete-generations roll-back > >> + switch-generation search > >> + import) > >> + (alist-cons 'action action result)) > >> + (else (leave (G_ "~a: unknown action~%") action)))))) > > > > For parsing the actions, I would define elsewhere the list. Then if th= e > > action is unknown, you could use =E2=80=99string-closest=E2=80=99 and s= o return an hint > > if there is a typo. [...] > Sounds good, the same "issue" exists for guix system subcommands, it > would be cool to have such functionality, but I would like to have those > changes to both guix system and guix home after wip-guix-home merged, > because backporting changes to rde is a little tedious. Your point is to hint both "guix system" and "guix home" in the same time because they share the same pattern. Right? > Also, it seems related to subcommands/--arguments discussion and maybe > better to talk about it in a separate thread. Yes, and from my understanding, your answer is keep consistency with "guix system". :-) Cheers, simon From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 31 10:24:02 2021 Received: (at 50296-done) by debbugs.gnu.org; 31 Aug 2021 14:24:02 +0000 Received: from localhost ([127.0.0.1]:35140 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mL4gA-00084y-Kd for submit@debbugs.gnu.org; Tue, 31 Aug 2021 10:24:02 -0400 Received: from mail-lf1-f52.google.com ([209.85.167.52]:34626) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mL4g5-00084h-12 for 50296-done@debbugs.gnu.org; Tue, 31 Aug 2021 10:23:57 -0400 Received: by mail-lf1-f52.google.com with SMTP id z2so38981179lft.1 for <50296-done@debbugs.gnu.org>; Tue, 31 Aug 2021 07:23:52 -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=JICqXCpydXV0fwvGG4PGvoPp9DRRVftNQQ+868eMSUA=; b=VwiFoecUhgfMBzFbmBuZ0R2eYKPMMCtuV6G+t1zVKRJBz//WCPXNDAyFsCln1JIphB VRvYeuG+e7if4tACnWBmMG1Gp+GKsHAt3bdImZTfuHonUSqsBrvDVg56GKwwVHx5D1L9 3TlEgcF31mUQK6VwOnZss+Xj/O0IUT/jonwb17jExdSPla88R6bquie9hJGxt9udiOwv Lsxda17SkA7rXAwNxeM5ZUt0iATPTEyuQIboI/MC+ffZ+aSjPoILsf0n0oCd7HcyPn3/ cOYCHAI2Q0m5nNSNAGK6mvthTzzSdtieunL/2JPq/gHCOL7KMJAkYFxiYFlqMKjZHacv QUcw== 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=JICqXCpydXV0fwvGG4PGvoPp9DRRVftNQQ+868eMSUA=; b=W1Pp3l9TPBxDneEpQyDDmQuXBa+hTnUwMDmpMkixd7uHJJP/5iLPFly6DkIvfcP1ng a1pKzbehSkUKL/c5btgUs6g32OqaiYRWbqJPFoOQ5ae7F17AC7P3c6Bn76g7v03Cn5d5 v/gHi4VGnr7CFiGR4ZuMZY/tJ9QvxPjGg6w/6idhpyWoqjGrlfv6nq7rt5SPYHWG8E0+ 5XJt7yzFxHOTr9T5sg2JAGDoYxK5pOEeS7g4byNHpXIKWzWRBHE2zHawGY7ODQ1Ott61 aTc5elNQrIZ/CMSTMBwPVkNqGx1NmieCui4a6kK3zTiRCZgtPELApDjGtkz6l41cANrO w84g== X-Gm-Message-State: AOAM531U6a4LwDl+GCh4gm2fP8buyu4RhmVO8ktiAVwuKgpVgT6zmaAR mGG2P8ImwxJ3UfdWEZJZew+rZY8Z8w0= X-Google-Smtp-Source: ABdhPJwFPEE/q+jVAPkhdePqqa4clqDdYgyYDWJkgcrqqBWfoSl4sMOyzggmKKM3FooHiyxUAzKotw== X-Received: by 2002:a19:7101:: with SMTP id m1mr22500624lfc.156.1630419823410; Tue, 31 Aug 2021 07:23:43 -0700 (PDT) Received: from guixsd ([88.201.161.72]) by smtp.gmail.com with ESMTPSA id k12sm2140505ljm.65.2021.08.31.07.23.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Aug 2021 07:23:42 -0700 (PDT) From: Oleg Pykhalov To: Andrew Tropin Subject: Re: [bug#50296] [PATCH 0/2] Add 'guix home' command. References: <874kb6j718.fsf@trop.in> <87tuj598an.fsf@gmail.com> <87sfypj0qk.fsf@trop.in> <87eea9ixx4.fsf@trop.in> Date: Tue, 31 Aug 2021 17:23:39 +0300 In-Reply-To: <87eea9ixx4.fsf@trop.in> (Andrew Tropin's message of "Tue, 31 Aug 2021 15:47:03 +0300") Message-ID: <87pmtt8zh0.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: 50296-done Cc: 50296-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] > The functions from home-services-utils used by xdg now in home-services > utils: > > From efd3ea79905c12e2c1c594fa6b54cf62d741f92f Mon Sep 17 00:00:00 2001 > From: Andrew Tropin > Date: Tue, 31 Aug 2021 15:40:07 +0300 > Subject: [PATCH 2/2] home-services: configuration: Add > generic-serialize-alist. > > * gnu/home-services/configuration.scm (generic-serialize-alist) > (generic-serialize-alist-entry): New variables. As you said, no variables, but functions ;-) Also, we could join those functions in Git commit message with comma. Applied with changes above. [=E2=80=A6] >> run-on-change service doesn't handle the case, where the previous >> generation doesn't exists. Fix should be pretty simple, will send a >> patch once it done. Thank you for catching this) >> > > The fix: > > From a07541380d412b33c504e5811776062af4e38582 Mon Sep 17 00:00:00 2001 > From: Andrew Tropin > Date: Tue, 31 Aug 2021 15:24:25 +0300 > Subject: [PATCH 1/2] home-services: run-on-change: Handle first generation > case. > > --- > gnu/home-services.scm | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) [=E2=80=A6] Added Git changelog-like line. Applied. Pushed to wip-guix-home as 0c7bb26435513a61814d98af1c790e43a74afb6e. Oleg. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJIBAEBCgAyFiEEcjhxI46s62NFSFhXFn+OpQAa+pwFAmEuO2sUHGdvLndpZ3Vz dEBnbWFpbC5jb20ACgkQFn+OpQAa+pzgKhAAx1ie4fYYIz8iCcVhiloGnVN4N4pE iLNeGAvWG64wrI9GMyWlKrm2QSIrlwlqW1mKtUA6M2OLF5FaeSbZWOGbQ+qVcVJR xwKdLNS8qn+eNO3DeJyYBxb7PoOgPYMmHTwRgN4IpDtyqj3w+Zn+vKB4f6hpAqDt 4NoYDa0/32mntwvoQDkggvRNVaRxHd9T1T8yuHv2E2MZN7oqPvKmPUdo/GR5Czrx Aa3lSiyPPqKDZSR5b0LK2wEVDAhZDrlH27lQ8RvbJ8sDO4kACZGhj2DXcLidoS2x 6qO5wRpFSxJ0CfO9qLl0gaxBlG5mPx3QrFHhcBEnZltmQK9dwTv8Jwrf1Zzq4QdA EUvdt8XcgSddlNVzFaA3AZGpeCtLw3uSEmLrUvITHKzfJvcckTHLEj3L6SpDADLk w88SjZM5mgEL4YYO67MGSwj/hUQMch7jDbTQTdkzHdHi81l34Ebc64QmoR0a2XH7 eYeKWDT8PvDTc9UOIUAxIrlAbR3LgUN+T2tOnirjbHvDe4w5zOVh6+6m4QVW6BcX +svmbfjGBieeUmaxaqGiAAP1lg0Dzawkm5T6OX4F1+UIhbfxYNUxrn0FWzqKLNnt imCWrxUl4h3ddqn/VrV83J84UH+/4cd7Ez5OfhKH3rOVSPzWdtcWUhnr9lQV3Khe iu4/cf3OKBFPBys= =uX5l -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 01 01:20:38 2021 Received: (at 50296) by debbugs.gnu.org; 1 Sep 2021 05:20:38 +0000 Received: from localhost ([127.0.0.1]:35909 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLIfq-0008FA-J2 for submit@debbugs.gnu.org; Wed, 01 Sep 2021 01:20:38 -0400 Received: from mail-lf1-f48.google.com ([209.85.167.48]:45717) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLIfk-0008Ep-Je for 50296@debbugs.gnu.org; Wed, 01 Sep 2021 01:20:32 -0400 Received: by mail-lf1-f48.google.com with SMTP id g13so3809072lfj.12 for <50296@debbugs.gnu.org>; Tue, 31 Aug 2021 22:20:28 -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=ULjeHut6N0ipGjzDUgs93J1jmyLIPhRcKcQ5S1Iavo4=; b=CvPYlFNtY5VrKrZAXijXcN78vr0Q+8DG/feQTwA9cAf/zZ9ZiA7VUlQtWcpKiuXLjO mGe1WL+xpc+KmgwG0tqRD4a45q/CmStmOGEtet8UYvIWlV/x+kRHU6d4jjCktGtKflKX 595hFvB6Qv3aXblCdjsfWianayMAXJLBHd/dQveOx3aSp/osIAl/GQwzPBl9huq8+NQJ sSBq9Z2Ppq1JKaSr1J3+7XVaPtynDJqGFHuAeKaqdKs0PWBoCpnQ7zBmlCEf3vE+PfHl WdcCzsiwKju5Oj7Cv6vQZkUcBRryHCVfEPdkGxbkpSETh+idUDP2dXk7W6cUYkLuDcCc uiFQ== 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=ULjeHut6N0ipGjzDUgs93J1jmyLIPhRcKcQ5S1Iavo4=; b=dqL7oFOZzw5hGf/HeHPZ3gugl635iB0GeHXfTSTc8SyPcf4AzcnVXFuqDsXym2ZBYd zuXkMKe4+dwGV1Bk0/cJqslz91G/79mVR5hX4nJl89NVcb0jcP9ClWaUMhIJ1imTrqc9 vy8/X354SrZfEH4wq4PL/LYrdX7eMb6gd6exyWKDtpv7raas+NM56XGWAKophu8081DG gopiKuapEXGHM+OJlzf7LwKpyYIQ+5gqpJKSd0k+jZqh66XqkfyDCZOOFxZHRoY8eNY4 CfsECScrIregf8H7CQwP5anmeURWydKGJla6sFfe3gLAres5x4INkv98hBnNJT+p/aMJ +NfA== X-Gm-Message-State: AOAM532PbPMDQbZwSNc37FLQeZH5lnixapAqmMxLuHP6mWYECEIkE8ku ovNgKTfvE4Jfph4wDWOwMjOlbw== X-Google-Smtp-Source: ABdhPJyJcGJpnKQ4PBxCRDo9xGIj8lCd/imZrApWLuR4ewDD4JnkyvzRJVGrNQpzrmGXpPut75zBDQ== X-Received: by 2002:a05:6512:3311:: with SMTP id k17mr24612005lfe.520.1630473622396; Tue, 31 Aug 2021 22:20:22 -0700 (PDT) Received: from localhost ([109.252.93.92]) by smtp.gmail.com with ESMTPSA id h28sm1592076lfv.194.2021.08.31.22.20.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Aug 2021 22:20:21 -0700 (PDT) From: Andrew Tropin To: zimoun Subject: Re: [bug#50296] [PATCH 1/2] scripts: Add 'guix home'. In-Reply-To: References: <874kb6j718.fsf@trop.in> <87y28ihs07.fsf@trop.in> <86pmttopfk.fsf@gmail.com> <87ilzlizit.fsf@trop.in> Date: Wed, 01 Sep 2021 08:20:17 +0300 Message-ID: <87lf4gzxbi.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: 50296 Cc: 50296@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-31 15:09, zimoun wrote: > Hi, > > On Tue, 31 Aug 2021 at 14:12, Andrew Tropin wrote: >> On 2021-08-31 12:53, zimoun wrote: >> > On Tue, 31 Aug 2021 at 12:40, Andrew Tropin wrote: >> > >> >> +(define-command (guix-home . args) >> >> + (synopsis "build and deploy home environments") >> >> + >> >> + (define (parse-sub-command arg result) >> >> + ;; Parse sub-command ARG and augment RESULT accordingly. >> >> + (if (assoc-ref result 'action) >> >> + (alist-cons 'argument arg result) >> >> + (let ((action (string->symbol arg))) >> >> + (case action >> >> + ((build >> >> + reconfigure >> >> + extension-graph shepherd-graph >> >> + list-generations describe >> >> + delete-generations roll-back >> >> + switch-generation search >> >> + import) >> >> + (alist-cons 'action action result)) >> >> + (else (leave (G_ "~a: unknown action~%") action)))))) >> > >> > For parsing the actions, I would define elsewhere the list. Then if t= he >> > action is unknown, you could use =E2=80=99string-closest=E2=80=99 and = so return an hint >> > if there is a typo. > > [...] > >> Sounds good, the same "issue" exists for guix system subcommands, it >> would be cool to have such functionality, but I would like to have those >> changes to both guix system and guix home after wip-guix-home merged, >> because backporting changes to rde is a little tedious. > > Your point is to hint both "guix system" and "guix home" in the same > time because they share the same pattern. Right? > >> Also, it seems related to subcommands/--arguments discussion and maybe >> better to talk about it in a separate thread. > > Yes, and from my understanding, your answer is keep consistency with > "guix system". :-) > > Cheers, > simon Yep, corret (: --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmEvDZEACgkQIgjSCVjB 3rCBuhAAkFjmNkkx8CCD0n4ez7mhICxLwET6gZqHkCG5GYYIKNjk9wflPHFpvwD6 E4xBLhi13lhQvSVD38ZbYnFPWIvmG5ykZB9jHPjFATqU17TSI4FF/Sn1sXz5084n rD3qpAZJ1q6gSJMLCX/YJzzqUYqhaV/zGgX53qiN1hX4t0BBPxKuS9rGtS1CkIsT 100HROpQUJvT+XHyYhbOEYqYBVIYUI7G2nWwu/yyTNJWzBdAXbbybe27cUCdI/n/ 8aV75MtVr1XzA8hLieyvarpbU2PyqTmPYmTrVA4oFX8FitkQG5l3VMlPkTfsCm0l mqnVaXg2WKHPJVpBXjkuSnHPdcPhA02p09b98bSsPDXNqSDUzLSBIX9LGPZJpzWL 77GQ5i7J4gxakON7bW3yesygFO/fas2CG+kWYr2smV4l5SSFmdQzAjat8zh2dtTs /MSmJqIi0Zi251Eaek4lhLaRLbztQmJxmGvGngjsAW7qsORLNVjDImQx7coavD0U qXZAQ8+9w3kQuL4JlU9e0MOIwAziL0fKBu7ZIjTKbqPywwXCKmTOijekUXbVih0T Xikvt1ArSVyMpOCer5qoFfbj84UWTxsr9957YrAplZlj9p2JvtDcgl5IBCeW9r0h Pes5a+pAKRh9MhseD1XkZdi6ngeVE3nAPZ1f9CrCiJVy8Kz8seA= =s3J9 -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 01 01:36:41 2021 Received: (at 50296-done) by debbugs.gnu.org; 1 Sep 2021 05:36:41 +0000 Received: from localhost ([127.0.0.1]:35920 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLIvN-0000I3-4a for submit@debbugs.gnu.org; Wed, 01 Sep 2021 01:36:41 -0400 Received: from mail-lj1-f182.google.com ([209.85.208.182]:34426) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLIvH-0000He-3H for 50296-done@debbugs.gnu.org; Wed, 01 Sep 2021 01:36:35 -0400 Received: by mail-lj1-f182.google.com with SMTP id f2so2871760ljn.1 for <50296-done@debbugs.gnu.org>; Tue, 31 Aug 2021 22:36:30 -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=niEX/Y4FF0f8vqksr/E5q+xNMm5WasTsHLSuw7lI6ds=; b=avUFQ0kho6FQBZRT0WZEvzb7kfvCZWfXUeQJRzo5iM7djKyrIuZnQ9ufEG2XSJTZLx ql3yxLABbYH0GikfGVFQPHJ0Bu+DDam8vPRZZ3/pcNWc8xMjFdn3ii5qQOe0dXXeyy2Q IYSrwcvKfi12SCgZ8iWtQ8eMHuPKJvM03q89cVMSIavQyzyo9rubEaDZ39QGyi4DLota dHJoqZ0rF6nDKkfYN8V/nJtAXo05TvAa7f+OCCUrhstEkE5yIdqi3/hOrCCBidkLRO6Z nT4eiPe70KmI6+Zu0IZQ+VFw+XJ9pAFGBv4REwP8xzVG7Bq2VIqu4yBivAuiwP/gOskv gwcA== 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=niEX/Y4FF0f8vqksr/E5q+xNMm5WasTsHLSuw7lI6ds=; b=uCfzktEKjy9Kv1sesF/m8DGQ3rowBqwryHOTlmxWLIenW0LQ56XebcmGLW19XCGC4M Es0kxerPMPHe91cs0c2XAQHkL/vlg3kK/0jvB6tjHxpV4mFa6uMyxxOFVKhmvzola4KJ +yZlqe/tMqp9X0NZlH9B/cO5qO2jXeLgjvOgiwtJXACqEXpj6bhmBsEv+funqODHSMrU ciDKwueCZz4qireTtj1wuJN0c18w9h/ayDuicHy2Ns3bk7hbVMfAppgAj8DZ8Bcj40kG TmfyGNqlS4hVBc+GKcbcWxdCr6c7KOs8tukmuGwxFW4mZ6Otp24orxl/XfHCZvRkfokH 8luA== X-Gm-Message-State: AOAM530P03RiAcsMUc89ALFVyLVxzGDd2aoxNBEcFGQXETh0UWwlk2Tf B3urk1mKlCA7vpLiawYRhlOeFw== X-Google-Smtp-Source: ABdhPJyMBL0ZG+9AQ/ABMeFS1wPxQzU5rWvSH/iUGt2fsfo0X8QO2UJaO8WxApdDQrxBCABpemBQ1w== X-Received: by 2002:a05:651c:211c:: with SMTP id a28mr29046228ljq.8.1630474585007; Tue, 31 Aug 2021 22:36:25 -0700 (PDT) Received: from localhost (109-252-93-92.nat.spd-mgts.ru. [109.252.93.92]) by smtp.gmail.com with ESMTPSA id y17sm2414218ljy.94.2021.08.31.22.36.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Aug 2021 22:36:24 -0700 (PDT) From: Andrew Tropin To: Oleg Pykhalov Subject: Re: [bug#50296] [PATCH 0/2] Add 'guix home' command. In-Reply-To: <87pmtt8zh0.fsf@gmail.com> References: <874kb6j718.fsf@trop.in> <87tuj598an.fsf@gmail.com> <87sfypj0qk.fsf@trop.in> <87eea9ixx4.fsf@trop.in> <87pmtt8zh0.fsf@gmail.com> Date: Wed, 01 Sep 2021 08:36:21 +0300 Message-ID: <87ilzkzwkq.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: 50296-done Cc: 50296-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-31 17:23, Oleg Pykhalov wrote: > Andrew Tropin writes: > > [=E2=80=A6] > >> The functions from home-services-utils used by xdg now in home-services >> utils: >> >> From efd3ea79905c12e2c1c594fa6b54cf62d741f92f Mon Sep 17 00:00:00 2001 >> From: Andrew Tropin >> Date: Tue, 31 Aug 2021 15:40:07 +0300 >> Subject: [PATCH 2/2] home-services: configuration: Add >> generic-serialize-alist. >> >> * gnu/home-services/configuration.scm (generic-serialize-alist) >> (generic-serialize-alist-entry): New variables. > > As you said, no variables, but functions ;-) > > Also, we could join those functions in Git commit message with comma. > > Applied with changes above. > > [=E2=80=A6] > >>> run-on-change service doesn't handle the case, where the previous >>> generation doesn't exists. Fix should be pretty simple, will send a >>> patch once it done. Thank you for catching this) >>> >> >> The fix: >> >> From a07541380d412b33c504e5811776062af4e38582 Mon Sep 17 00:00:00 2001 >> From: Andrew Tropin >> Date: Tue, 31 Aug 2021 15:24:25 +0300 >> Subject: [PATCH 1/2] home-services: run-on-change: Handle first generati= on >> case. >> >> --- >> gnu/home-services.scm | 5 +++-- >> 1 file changed, 3 insertions(+), 2 deletions(-) > > [=E2=80=A6] > > Added Git changelog-like line. > > Applied. > > Pushed to wip-guix-home as 0c7bb26435513a61814d98af1c790e43a74afb6e. > > Oleg. Cool, seems now we have a working copy of guix home in wip-guix-home, I'll start cleaning up the documentation and prepare it for merging. Thank you for your help with all that stuff) --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmEvEVUACgkQIgjSCVjB 3rBnuQ//R+npgyFXQpWT4/bkahpRoRO4vn0l5owgNiRF82NoHQNckeGRtCYAmdB4 rFn7y/3VVK7B9eDyhCyWRQF+mfCpiyvdfSeKcJTBl8R3N33vRw8ggCRc2rz9OABK oi4wuHO4Yqp7rr0fS8lUnEAw5Jr65PeMvugGatIwMdOy4c1JePU5imKS5AA8SFMU vG1zYDLPKsJOfEQ4UuSPyL+UBTlL/ECvIEGe7p/Y+5InNKHh2Oah3np+v39TNmHA tBbgE1LnZNjtK4WdkAIT5zSFWRlFscqr2s88VYfxSILklL3OkBtavDlHZiMMot6F 0ZBQZLglqrTmY6HsSLMP0QfCO5wyfbUQdrPZEyZZMP6N0Ut7beCn78oAXWfLeySL wWjlS6u0wB0nmxkTVSaXG/Wk9d2pnOs0vB5/PVHs/MqrxLon4J1znbbk3LmOovNO wfPDQzGA2r/x6bfU/14zTg2fqtNwqV6s2KUkXbsbta3LLFtEICMtpUYQlWqKbke0 PzNwUqCrjVHbYaNTNoriV/Gesxmx451QwSgmRGBoMA0JEeb3vvtJhWjXQ+D98tig 4OduOftN9OSJUyPlo/J+ciDy/tQRvuqk+pd3OTbs6giDRCHI5ZipbELKMRo2IvK0 an9tJYXb9edrco6yut6CI2hpVri+VP9dbcldmv8zBBPmsyabHfU= =Vxn8 -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 09 02:10:31 2021 Received: (at 50296-done) by debbugs.gnu.org; 9 Sep 2021 06:10:31 +0000 Received: from localhost ([127.0.0.1]:33978 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mODGZ-0000e2-Ew for submit@debbugs.gnu.org; Thu, 09 Sep 2021 02:10:31 -0400 Received: from mail-lj1-f175.google.com ([209.85.208.175]:33308) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mODGU-0000do-V4 for 50296-done@debbugs.gnu.org; Thu, 09 Sep 2021 02:10:30 -0400 Received: by mail-lj1-f175.google.com with SMTP id s12so1274051ljg.0 for <50296-done@debbugs.gnu.org>; Wed, 08 Sep 2021 23:10:26 -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=G4lVm6d+fnL42OXBeV7kHmCdKtzrpx7KSZFgMxuIMeM=; b=KBwyo2CY/ngS2nctG5OHqNvwdP/x2AXvRpuaRyZCEllRL+Lxz6G8Jc4RhNt/lOQ2Ch CoCu+jAp6f7EKuhBj4Quj4uND2nQKSwj6khi5zY/xtp8jRDYV9KuDRAQB4s7Pyjcw/3R 8BAvAdWui3Pjo3/xaoXOeuTztUO0ZpIYl9hspbepHJ6JkjbDKoWdw7e3v/Uv1YdBXN1h tGAPIH/G5Lbpy8Sop87lO64eA+bgArKarLLuoD/7pPhMumbuMVuP5mRF6FYEzSEHFH54 d4OISKhSk1vQM1EPkl++rIBa0/S5v5MCklvaa/7GUARy+nBpVGZtRfXApM0sowCYsOAF sQJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=G4lVm6d+fnL42OXBeV7kHmCdKtzrpx7KSZFgMxuIMeM=; b=EzOyJ4cCJpDfRumxqmQDEbjaxuc1CVl6xnJLULr+CrmzJiXwVe6pDlgrTtnNxE6Ots B5hOk6oZkZdGdRBsnTg679CWEvnW1M2TanFY5Fg9xaGlwsddd8UGPm7eDsWdZIROJRIZ nisFLBY/yIYAKwCHhb36I91Y1+a8SSneqhMBEiO2ZIFw8JESL6sQ+jiVVAzRHMiY8+Xq u92QorNqASRH9thELPihwuOa+qZpFWy9xJXz1dYCoehUX+qKmXYu2XZ1BUXTRUR/Hdp2 VpskBiCXnEWTkKJ1gMUO7W3W21xY/nQUaSNeJqZ8IHDefdoyyRx8hNeMxuP9U+FmMh/l uw8Q== X-Gm-Message-State: AOAM532RyyM10N4WKdKd+UUjZTLIEvT59uuKarT0o/Vr+MKst3TbJoHK ryV1koDVzwR4xfYf0QPbNU1nSQ== X-Google-Smtp-Source: ABdhPJzgD+P/LeShP3Q3c1962kvW24q2Ypv2KT2m8a6IUlnCVlZwY33eunFR5W8iTKuSWOi+EpI7/g== X-Received: by 2002:a2e:a486:: with SMTP id h6mr975141lji.208.1631167820818; Wed, 08 Sep 2021 23:10:20 -0700 (PDT) Received: from localhost ([109.252.93.92]) by smtp.gmail.com with ESMTPSA id m5sm90795lfk.267.2021.09.08.23.10.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Sep 2021 23:10:19 -0700 (PDT) From: Andrew Tropin To: Oleg Pykhalov Subject: Re: [bug#50296] [PATCH 0/2] Add 'guix home' command. In-Reply-To: <87pmtt8zh0.fsf@gmail.com> References: <874kb6j718.fsf@trop.in> <87tuj598an.fsf@gmail.com> <87sfypj0qk.fsf@trop.in> <87eea9ixx4.fsf@trop.in> <87pmtt8zh0.fsf@gmail.com> Date: Thu, 09 Sep 2021 09:10:16 +0300 Message-ID: <87ee9yuvnb.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: 50296-done Cc: 50296-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: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2021-08-31 17:23, Oleg Pykhalov wrote: > Andrew Tropin writes: > > [=E2=80=A6] > >> The functions from home-services-utils used by xdg now in home-services >> utils: >> >> From efd3ea79905c12e2c1c594fa6b54cf62d741f92f Mon Sep 17 00:00:00 2001 >> From: Andrew Tropin >> Date: Tue, 31 Aug 2021 15:40:07 +0300 >> Subject: [PATCH 2/2] home-services: configuration: Add >> generic-serialize-alist. >> >> * gnu/home-services/configuration.scm (generic-serialize-alist) >> (generic-serialize-alist-entry): New variables. > > As you said, no variables, but functions ;-) > > Also, we could join those functions in Git commit message with comma. > > Applied with changes above. > > [=E2=80=A6] > >>> run-on-change service doesn't handle the case, where the previous >>> generation doesn't exists. Fix should be pretty simple, will send a >>> patch once it done. Thank you for catching this) >>> >> >> The fix: >> >> From a07541380d412b33c504e5811776062af4e38582 Mon Sep 17 00:00:00 2001 >> From: Andrew Tropin >> Date: Tue, 31 Aug 2021 15:24:25 +0300 >> Subject: [PATCH 1/2] home-services: run-on-change: Handle first generati= on >> case. >> >> --- >> gnu/home-services.scm | 5 +++-- >> 1 file changed, 3 insertions(+), 2 deletions(-) > > [=E2=80=A6] > > Added Git changelog-like line. > > Applied. > > Pushed to wip-guix-home as 0c7bb26435513a61814d98af1c790e43a74afb6e. > > Oleg. I did a little better solution for the first generation case for on-change service. Added it as fixup commit, so it's necessary to rebase with --autosquash to get it melded in the right place. Can you also rebase the whole branch on the latest master and recreate it, please? I'll test it and will be preparing for merge. Probably will send a few more patches, but they should be minor. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-fixup-home-services-run-on-change-Handle-first-gener.patch Content-Transfer-Encoding: quoted-printable From=206f3ec7f6bb4a6f495c4b7f38fce7cb31d179097b Mon Sep 17 00:00:00 2001 From: Andrew Tropin Date: Wed, 8 Sep 2021 08:15:35 +0300 Subject: [PATCH] fixup! home-services: run-on-change: Handle first generati= on case. =2D-- gnu/home-services.scm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/gnu/home-services.scm b/gnu/home-services.scm index 5608c65175..9f1e986616 100644 =2D-- a/gnu/home-services.scm +++ b/gnu/home-services.scm @@ -439,7 +439,10 @@ with one gexp, but many times, and all gexps must be i= dempotent."))) (define expressions-to-eval (map (lambda (x) =2D (let* ((file1 (string-append (getenv "GUIX_OLD_HOME") "/" (ca= r x))) + (let* ((file1 (string-append + (or (getenv "GUIX_OLD_HOME") + "/gnu/store/non-existing-generation") + "/" (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)) @@ -448,14 +451,14 @@ with one gexp, but many times, and all gexps must be = idempotent."))) (if any-changes? (cadr x) ""))) '#$pattern-gexp-tuples)) =20 =2D (if (and #$eval-gexps? (getenv "GUIX_OLD_HOME")) + (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 "\ =2DOn-change gexps won't evaluated, disabled by service configuration or =2Dthere are no previos generations.\n")))) +On-change gexps won't be evaluated, disabled by service +configuration.\n")))) =20 (define home-run-on-change-service-type (service-type (name 'home-run-on-change) =2D-=20 2.33.0 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmE5pUgACgkQIgjSCVjB 3rBXVA/6Ajk69Fqoq3JAwlQ6MmwEZ0u7DUDFWnP+tOA3Jp23yvN4cShWrHBMCDJU MVTgms7BMGKGb1uO0Z91J3WVKDQxYwOHa8QFic/+DWtkhYkLHX1Twu2veLrCgnuu hzbSJGBr8glsSQFyScnYvA+bEXKVJvQh3vQ4RtU8ofAJUcDGrF9afFoGIbrLFF9w hzb+fv2Rk8gpaPzJH/BCNI50nyJxS2ZOevQTsb8EPQWnCsh5/GO0LD4Dj64qA73O GHm1eMaa+BkRDmNlwczmpxdfh60gL5Xykh5GQNIBMndEQlqr4j/KNLYoluS5En0O HzPbaJtlikeuzXQw9MQOw8lPKXG/oQs/2BJ3WYIGf1H5gtVarNt2MJb4wKfuHCI4 07ZtsH9SuF99L4raZIbU/g5ULqRFzR6BRM22zfu3Jp8eolOaYLdNl120ZlXNev5e jjZTTBuek5zJF3go7PtXtWvFg/7hCwis/uo+KkxWHFqnobENoMVM1+xAtiopTQBv Ik7s/C79s+8dz0pGi2FKfjifKJfvx82T4v4amnMbzIr3xhOelW0Lpo5RXceX7Zod 6aTDUhdjw+QCUBEeV7PPiq1XF/u4wPQPnUF0+EF142CBrhRLOW1nMChZPcSxIGhH bBNp/XSUJRvnB/vK/mffPQkCICUaaVAvWfag+aFie1JkFBqcgH0= =jLqQ -----END PGP SIGNATURE----- --==-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 09 13:46:08 2021 Received: (at 50296-done) by debbugs.gnu.org; 9 Sep 2021 17:46:08 +0000 Received: from localhost ([127.0.0.1]:36151 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mOO7k-0007NI-2h for submit@debbugs.gnu.org; Thu, 09 Sep 2021 13:46:08 -0400 Received: from mail-lj1-f182.google.com ([209.85.208.182]:41907) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mOO7i-0007MZ-3c for 50296-done@debbugs.gnu.org; Thu, 09 Sep 2021 13:46:07 -0400 Received: by mail-lj1-f182.google.com with SMTP id m4so4240678ljq.8 for <50296-done@debbugs.gnu.org>; Thu, 09 Sep 2021 10:46:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=w3Rna0UxABw0JPxtuSzwaB88b9OR0wptuMisWgA/WKA=; b=MOOOxPqwOHWxcszv5Bh3CaZdU3lERr0FYzV6XI5XkyWne5z8FW1yXcvz1Rdd65EqAq N4AZAuf3A6+NmsgZMUCemI+BEDAGKjEKX0Zq7rICG2o3e6KQkQFlKTBifCVzkeLJkzwk CeDsq4UJW+dOjbKUdtE+NxAMuSxBaGCSlX867mTdOiS6k1ZQNYiLRfKyg2kWkR1igoEW NSwbIHqruj3Tj257bhwJsPWCpbch4bVFxwdnn7snNv6ruhhcdtz7MwzQPXiS9yaPXQlo X80svGRhusJbF12PL6Nt2mtj+acB1EpNYjCyKj16ewtzGWXCPselF598IuXKHBoPsWMd 2AOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=w3Rna0UxABw0JPxtuSzwaB88b9OR0wptuMisWgA/WKA=; b=YXqZfhGSGjFkSZkSQfAEJBHVKaVR1ffN2RjH+dSAR0OrhvYykoUijnGkQdbmTFaC3m JdW81U/4RQ4JVofG4wz/BH8e9sMfe/DlZlCNpHoI5P88Kg8nc9OfoTv7Yx28Bx5zuFrZ lwnZg4b8sPH3CpswC/lv8kVdXxkX45hkwepa7oHEQN60q2RR/OZafqLXU19/GEn5JBn4 lxaNauZkJUfVlaVkF5hJqPYtb3q9kdJWtJ4EY5ZwhfWAAatsd2CK+PfvUueH+7JxBcIl Tw3/C1XJWotZ0sFNxiriYWtEw854+oSKaiYakzg+LH5SiM3hRRHIb5wZK9ABmmjr9UHT oAcQ== X-Gm-Message-State: AOAM53027kSAnODmDQN+6vAb+5bA3JGRvpQpD0rCQWXPEYeDyqldAsTE YYsGJgYfhhG+4vwlZVods9iYmnrGjXk= X-Google-Smtp-Source: ABdhPJwEdR/7kMNLepxfbCgYNT0cpcoBFy33vGqG6fwXhiU+VC49zUIqRIy7MVVKMg1oA9pCAVedxg== X-Received: by 2002:a05:651c:1131:: with SMTP id e17mr857311ljo.15.1631209559567; Thu, 09 Sep 2021 10:45:59 -0700 (PDT) Received: from guixsd ([88.201.161.72]) by smtp.gmail.com with ESMTPSA id c11sm265511lfb.76.2021.09.09.10.45.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Sep 2021 10:45:58 -0700 (PDT) From: Oleg Pykhalov To: Andrew Tropin Subject: Re: [bug#50296] [PATCH 0/2] Add 'guix home' command. References: <874kb6j718.fsf@trop.in> <87tuj598an.fsf@gmail.com> <87sfypj0qk.fsf@trop.in> <87eea9ixx4.fsf@trop.in> <87pmtt8zh0.fsf@gmail.com> <87ee9yuvnb.fsf@trop.in> Date: Thu, 09 Sep 2021 20:45:55 +0300 In-Reply-To: <87ee9yuvnb.fsf@trop.in> (Andrew Tropin's message of "Thu, 09 Sep 2021 09:10:16 +0300") Message-ID: <875yv9lk18.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: 50296-done Cc: 50296-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] > I did a little better solution for the first generation case for > on-change service. Added it as fixup commit, so it's necessary to > rebase with --autosquash to get it melded in the right place. Can you > also rebase the whole branch on the latest master and recreate it, > please? I'll test it and will be preparing for merge. Probably will > send a few more patches, but they should be minor. > > From 6f3ec7f6bb4a6f495c4b7f38fce7cb31d179097b Mon Sep 17 00:00:00 2001 > From: Andrew Tropin > Date: Wed, 8 Sep 2021 08:15:35 +0300 > Subject: [PATCH] fixup! home-services: run-on-change: Handle first genera= tion > case. > > --- > gnu/home-services.scm | 11 +++++++---- > 1 file changed, 7 insertions(+), 4 deletions(-) I did what you asked, but please, don't depend on recreating the branch next time. Otherwise we will wait for other contributers decision about this approach. Every branch recreation guix-commits mailing list receives a batch of messages, which could annoy subscribers. Thanks, Oleg. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJIBAEBCgAyFiEEcjhxI46s62NFSFhXFn+OpQAa+pwFAmE6SFMUHGdvLndpZ3Vz dEBnbWFpbC5jb20ACgkQFn+OpQAa+px4rQ/+MCP5YSZ9Wt/rSNDBN74qwf6WBHL5 jeKAXSZ4pKsEvMaQu9HE8M55hzx1lwanP698EkfJ+9V5iR2Ggt1/TlPFFroTB8NN V343fbN5AKdYHEqn7abLvPL5mFL2lKxtcO+ExHKneQA6qzOC/7WXxouDqC5JDQ3r trWyFg742g/Pg4rwjbxnYf9+BIDjGIvZW/JzWshE5PiH2sjaddHecZI74fYqTE4E Co9jm7u/crRrWoCvqnrvLgXplEUbTxfE+zBL4PkfsF5uEOdTU8HUjkM1065ODox/ UqzeCnMeAK71HYdPZB7EwwM4qo567SfStrlype+6UNQGeiSh/VM30r3+wE9CQYyj ZSbPm5Wuqy191hYbtP0WjEidgP5H1fwmcZTnLHm/uahaVbuGFRjh11FFBipG3ib2 6smQWjpusWtwXxhQjOMVMcbe3Z+5gyx6yJPyRAEvB3G0XiBlMV5u9cjLyAa/gSGS BNPT9sEJhbPY5nDqQUsYA8ow+VAQbR3N6b8uhLqBDWZnWV0GJ+4faJtt1DNHGcgb whkb61LtLzJFtcqDt/LZ+Ki/JG2OX3fF80LPiv1DG/V+Xiejpq6KNXUMG8eifcVa yUj4s8YMIrf5v1L+zeGSgML5de3fzvbEeGouxrrrrEmFFCBNGpWRlHmrQyJ3ATlT /Sll5a7RTPjxJ+8= =qkRr -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 10 01:31:50 2021 Received: (at 50296-done) by debbugs.gnu.org; 10 Sep 2021 05:31:50 +0000 Received: from localhost ([127.0.0.1]:36685 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mOZ8f-0008MK-Vn for submit@debbugs.gnu.org; Fri, 10 Sep 2021 01:31:50 -0400 Received: from mail-lf1-f54.google.com ([209.85.167.54]:43795) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mOZ8d-0008M4-VO for 50296-done@debbugs.gnu.org; Fri, 10 Sep 2021 01:31:49 -0400 Received: by mail-lf1-f54.google.com with SMTP id h16so1658749lfk.10 for <50296-done@debbugs.gnu.org>; Thu, 09 Sep 2021 22:31:47 -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=7IbDtvECms4/WBKlMdVbTE1ApefLgxtI7Zz/E+5LdMY=; b=bzn7G79TAUjGDLeuDHNc8qnUtHDS2d8MFHy2iXD8csCL/rghYI7/kkd15OBgDUktv2 ubdDaa/1zvcYQd2U2kyxgPmYZkeBlflDSExTbJxe/NMG+EszblDJFbuoMIkQqLZ+x5Y5 9XiUnf0+C/dRVFiy6sy/fKKQpKxRIHdGVPAGC6HovlIFdPIK1tJVPJyQYKFjKO5ZgYtp u7NCM4vokQnXDPp4RaFnN7Bw5e/lvctOyT/q8qscecpGjQ0hsdv00vpAYXlPEAuzry9L BZIUYA2AoTbVTuctaKuSs4zHlmZJ4x1UtTmkMfda8dojNoYRHosFLrQXhYYeJCmpiD5r lDOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=7IbDtvECms4/WBKlMdVbTE1ApefLgxtI7Zz/E+5LdMY=; b=72Okk8f42idkt1Ue+dXikzV4vOBQUWz8dfRQOR1YKq+amwY/6OGtc/aglvpNi8jiHs ZcaqeUvHXncNH+cdAJGCkRM9E6EwsNIczePPvzv5E7lSq2us/sZDodJpbdb9j9bT+7qG eobSduhIsEZg9wmQSOFJ+qcAlFr+3Eakvhq4ibPxvHQcc9R9tQwZ8GASZc4Hutt/360J jXuXhZ5PZQ7fJejLWTJgWRj5eeWSX4X8aLwgWsHQWIUujn6crZGVhEtFxAHiwJStsPFC CjcAlv67uOxthzyPCcK1JlBD2W5O4hE+GCDJqDL70GbzCD2y/LDbHsCNCHMJB/9+hrT6 blfg== X-Gm-Message-State: AOAM532lCkUuxnnCogJdl68Y/AHaMGKxZA0Csv4vLq9KMEPRSSZTlhm/ DqRpm0rrC4ZZoafmQrRNFsVvxw== X-Google-Smtp-Source: ABdhPJyH3jfaivNfUwbh6bAEaOgFGCQUgT8IcMS2s4EXvVFnlrtOy0ADPfjF59PJBY5mfNpezVDtmw== X-Received: by 2002:ac2:4106:: with SMTP id b6mr2617494lfi.89.1631251901720; Thu, 09 Sep 2021 22:31:41 -0700 (PDT) Received: from localhost ([109.252.93.92]) by smtp.gmail.com with ESMTPSA id z26sm421530lfe.16.2021.09.09.22.31.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Sep 2021 22:31:40 -0700 (PDT) From: Andrew Tropin To: Oleg Pykhalov Subject: Re: [bug#50296] [PATCH 0/2] Add 'guix home' command. In-Reply-To: <875yv9lk18.fsf@gmail.com> References: <874kb6j718.fsf@trop.in> <87tuj598an.fsf@gmail.com> <87sfypj0qk.fsf@trop.in> <87eea9ixx4.fsf@trop.in> <87pmtt8zh0.fsf@gmail.com> <87ee9yuvnb.fsf@trop.in> <875yv9lk18.fsf@gmail.com> Date: Fri, 10 Sep 2021 08:31:37 +0300 Message-ID: <87h7etyp1i.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: 50296-done Cc: 50296-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-09-09 20:45, Oleg Pykhalov wrote: > Andrew Tropin writes: > > [=E2=80=A6] > >> I did a little better solution for the first generation case for >> on-change service. Added it as fixup commit, so it's necessary to >> rebase with --autosquash to get it melded in the right place. Can you >> also rebase the whole branch on the latest master and recreate it, >> please? I'll test it and will be preparing for merge. Probably will >> send a few more patches, but they should be minor. >> >> From 6f3ec7f6bb4a6f495c4b7f38fce7cb31d179097b Mon Sep 17 00:00:00 2001 >> From: Andrew Tropin >> Date: Wed, 8 Sep 2021 08:15:35 +0300 >> Subject: [PATCH] fixup! home-services: run-on-change: Handle first gener= ation >> case. >> >> --- >> gnu/home-services.scm | 11 +++++++---- >> 1 file changed, 7 insertions(+), 4 deletions(-) > > I did what you asked, but please, don't depend on recreating the branch > next time. Otherwise we will wait for other contributers decision about > this approach. Every branch recreation guix-commits mailing list > receives a batch of messages, which could annoy subscribers. > > Thanks, > Oleg. Thank you! Didn't think about guix-commits ML, ok, will try to avoid this next time) --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmE67bkACgkQIgjSCVjB 3rB3ew//cR3vEAagmvS2jMOm2zIpqHyhm4FuWIK9vd87XE66OKpnZCJrh8ShbVQB 730qkRTqD49C1ddRun25PzGEeGpS3AToSIQ436vZ7Ps0/0MjiCsii5gTyUD9QsbI Om57DQqzX4yiT+AKJdXoIMDRrN6Im+dx6VUCwj1SI2iy9QVCPpv3YUfdBQHCgMhi xwcS2HGpNcaE2tK2o/5pVwMhrWwO1UTVMY1hr8gQIlTFB95nnihE/dHi89f/rS3d PF26xwFvqDRzBE83WerS7pcxYsr+Vn/aPCIqh6vaQjRlVii3KeGuaQ/IQteSeuC+ JScfij4F3JR6vAmW7mnpc44aoA0/Ot2WRCamAamLd4h3FRlrLaoTiMwphVWhaelD UhNSt+dGD3J0oO/h7NO3okHyAcjo7R9rbHu4Vwas3yHIqisXvxmaRhPwRXAGpcUZ EjTJBZHaV7mYoypgvrh5LJIQy2YWJaDEU5p2Kvl+0ifgz78tJNoJKAxQusd7huvL VEDLUabYxjllczchVAbmOsRbkwuAcsL74ivo08l+vULO8wiEP4A3WBPL/ICU56H4 dtEBcHKvzE+QBL9nRXlYkpcbk/Ocn9YjcaIJqA7meTRfXNZFkD4zhA6WaBlsZOpR obpTLH0HHaCmI9nexq3aw15ulyT3BRbKlANocSkUNB2CqUkLW3w= =e5rh -----END PGP SIGNATURE----- --=-=-=-- From unknown Thu Sep 11 16:39:30 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 08 Oct 2021 11:24:04 +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