From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 28 13:33:25 2021 Received: (at submit) by debbugs.gnu.org; 28 Sep 2021 17:33:25 +0000 Received: from localhost ([127.0.0.1]:46914 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mVGyq-00018F-Ou for submit@debbugs.gnu.org; Tue, 28 Sep 2021 13:33:24 -0400 Received: from lists.gnu.org ([209.51.188.17]:44772) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mVGyo-000187-HZ for submit@debbugs.gnu.org; Tue, 28 Sep 2021 13:33:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51066) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mVGyo-0002DL-BP for guix-patches@gnu.org; Tue, 28 Sep 2021 13:33:22 -0400 Received: from h87-96-130-155.cust.a3fiber.se ([87.96.130.155]:53170 helo=mail.yoctocell.xyz) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mVGym-0003N6-5G for guix-patches@gnu.org; Tue, 28 Sep 2021 13:33:22 -0400 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yoctocell.xyz; s=mail; t=1632850395; bh=vteuw7v/PF23xOJwEas2evOTMCZyT38pQ5w2h5r9SXU=; h=From:To:Subject:Date; b=uHbi2SrC9sJh69YIbyIdvauN7xvZsuHBUI9bVz95S8Zcrvrc/nQqQ48y/rYzVtXdE TRz2HYyonF+/rBkf3B2lMJFLfMNEooOhLsiib+YksPhmxvixZPRwRyS1ccxNVLVqzI bZDHYB/59x6OPi7kzuHRFeCeZglwd+2ywhWVjIDE= To: guix-patches@gnu.org Subject: [PATCH 0/5] Fixes to =?utf-8?Q?=E2=80=98guix?= home =?utf-8?Q?imp?= =?utf-8?Q?ort=E2=80=99?= X-Debbugs-CC: Ludovic =?utf-8?Q?Court=C3=A8s?= , Andrew Tropin Message-Id: Date: Tue, 28 Sep 2021 19:33:09 +0200 MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Received-SPF: pass client-ip=87.96.130.155; envelope-from=public@yoctocell.xyz; helo=mail.yoctocell.xyz X-Spam_score_int: 39 X-Spam_score: 3.9 X-Spam_bar: +++ X-Spam_report: (3.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FROM_SUSPICIOUS_NTLD=0.499, FROM_SUSPICIOUS_NTLD_FP=0.229, PDS_OTHER_BAD_TLD=1.999, PDS_RDNS_DYNAMIC_FP=0.001, RDNS_DYNAMIC=0.982, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, TO_NO_BRKTS_DYNIP=2.299 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.7 (+) 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: This series makes some fixes to the ‘guix home import’ subcommand which brings it into a usable state. The last patch documents the subcommand in the manual. As a sidenote, the ‘manifest->code’ procedure in (guix scripts home import), which is based on ‘manifest->code’ from (guix profiles) should probably be factorized with the original ‘manifest [...] Content analysis details: (1.7 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: yoctocell.xyz (xyz)] 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.51.188.17 listed in wl.mailspike.net] -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [209.51.188.17 listed in list.dnswl.org] 0.5 FROM_SUSPICIOUS_NTLD_FP From abused NTLD 0.5 FROM_SUSPICIOUS_NTLD From abused NTLD 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: 0.2 (/) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable This series makes some fixes to the =E2=80=98guix home import=E2=80=99 subc= ommand which brings it into a usable state. The last patch documents the subcommand in the manual. As a sidenote, the =E2=80=98manifest->code=E2=80=99 procedure in (guix scri= pts home import), which is based on =E2=80=98manifest->code=E2=80=99 from (guix prof= iles) should probably be factorized with the original =E2=80=98manifest->code=E2=80=99 p= rocedure. Xinglu Chen (5): guix home: import: Make the user to specify a destination directory. guix home: import: Allow multiple modules to be imported for each service. guix home: import: Fix module name for Bash service. guix home: import: Delete duplicate modules when importing. doc: Document the =E2=80=98guix home import=E2=80=99 subcommand. doc/guix.texi | 33 ++++++++++ guix/scripts/home.scm | 25 +++++--- guix/scripts/home/import.scm | 118 ++++++++++++++++++++--------------- 3 files changed, 116 insertions(+), 60 deletions(-) base-commit: 5edfa6d15e5bb92609ecff7e37e3985eced1dd4d =2D-=20 2.33.0 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJJBAEBCAAzFiEEAVhh4yyK5+SEykIzrPUJmaL7XHkFAmFTUdYVHHB1YmxpY0B5 b2N0b2NlbGwueHl6AAoJEKz1CZmi+1x5tMkP/RaFKrwuVlmXoVx4nTb8gV7oQErP Ktc+q8zhehNgLX+CTgOXUDp0PJ6XRQ6Z+BfMITogrxPBIzuhvx2VksNIpxIVpKn5 HP7hH1u8rbApeONLyTdbuluQRP40Oj4yUvB/g6Art1Qeqg5ZBfagCaVEAYaFGuPc 5TyT+b53NfATrLysWX5q4MnEMIHllJR/Ku8QLB59Uu31oCAoDfF1ANs0CNMIwrWX JR0nG6PUX/ic1SMuWZxcy+TcjLdeY5JhXfYK/9S8I2XkWjFTYE32RpF3xjpj3F1z 8ewzIpRZKDqlFVDawMyigH8fyOSwQxLi5tTwEnnnJS9h/oBmEa879uOxkBjwn/Dm SGUbazquk2q84IwJNi9SpXCfwPjxXtIVhc+ryPa93BSr9a9812PTC1jtlt3P1fWc x+KaE8neCAOe8RXy7AsRg9C6G5+Gv/FaI3kLVZ0Y5vRa27Bc9RnnRhLEVNMTA/bC jXKeuuXMaPg9UWDOcL4vEznrK6xJj39qqmtyF8IgESbK0MKOsXk8YGT355NbCbsz wspv+EPo88NhdAO/NhWK7oXYNHW8Mixgqs5NfQ33aUTXxp6nMFkjRDdSZr1nWFAg oEFoHvowz5ymk4WLXWgBwcBmCwGUwQYzWtFjA0+uH6aaik1RNTrtXIqKdxsKloiz t2pB2PFHZBj0WnBk =a4L2 -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 28 13:35:44 2021 Received: (at 50873) by debbugs.gnu.org; 28 Sep 2021 17:35:44 +0000 Received: from localhost ([127.0.0.1]:46920 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mVH16-0001C8-55 for submit@debbugs.gnu.org; Tue, 28 Sep 2021 13:35:44 -0400 Received: from h87-96-130-155.cust.a3fiber.se ([87.96.130.155]:33258 helo=mail.yoctocell.xyz) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mVH14-0001Bs-3S for 50873@debbugs.gnu.org; Tue, 28 Sep 2021 13:35:42 -0400 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yoctocell.xyz; s=mail; t=1632850536; bh=8204i1p8k/yCcQOFyl3weMDTCmOJgLPRH+CH29SV5KQ=; h=From:To:Subject:In-Reply-To:References:Date; b=OCHgu16TLyGwFG+Kz75jJVa6BrBoqz6DDjo9xJq9ATAhFzv84z23luGe2UA1Uskfe AYDaMgxftsW7PPhwb/UoPGOCqKj7P89zQ7RrvYVhBSPl15Stb7zHZcyQpGCmszBd+O Bpi6V7P9o34aBpAvnwR6sN3OmcNPuppYo5IJEztc= To: 50873@debbugs.gnu.org Subject: [PATCH 1/5] guix home: import: Make the user to specify a destination directory. In-Reply-To: References: X-Debbugs-Cc: Ludovic =?utf-8?Q?Court=C3=A8s?= , Andrew Tropin Message-Id: <649c8f3218460dea0ec6cca46064150224374f89.1632849969.git.public@yoctocell.xyz> Date: Tue, 28 Sep 2021 19:35:35 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 2.9 (++) 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: Copy the appropriate the relevant configuration files to the destination directory, and call ‘local-file’ on them. Without this, ‘guix home import’ will generate a service declaration like this Content analysis details: (2.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches 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.5 FROM_SUSPICIOUS_NTLD From abused NTLD 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS 0.0 PDS_RDNS_DYNAMIC_FP RDNS_DYNAMIC with FP steps X-Debbugs-Envelope-To: 50873 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.9 (+) 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: Copy the appropriate the relevant configuration files to the destination directory, and call ‘local-file’ on them. Without this, ‘guix home import’ will generate a service declaration like this Content analysis details: (1.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches 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.5 FROM_SUSPICIOUS_NTLD From abused NTLD 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager 0.0 PDS_RDNS_DYNAMIC_FP RDNS_DYNAMIC with FP steps Copy the appropriate the relevant configuration files to the destination directory, and call =E2=80=98local-file=E2=80=99 on them. Without this, =E2=80=98guix home import=E2=80=99 will generate a service de= claration like this (service home-bash-service-type (home-bash-configuration (bashrc (list (slurp-file-gexp (local-file "/home/yoctocell/.bashrc")))))) but when running =E2=80=98guix home reconfigure=E2=80=99, the ~/.bashrc fil= e would be moved, so when running =E2=80=98guix home reconfigure=E2=80=99 for the second time, i= t would read the ~/.bashrc which is itself a symlink to a file the store. * guix/scripts/home/import.scm (%destination-directory): New parameter. (generate-bash-module+configuration): Adjust accordingly. (modules+configurations): Copy the user=E2=80=99s configuration file to =E2=80=98%destination-directory=E2=80=99. * guix/scripts/home.scm (process-command): Adjust accordingly; create =E2=80=98%destination-directory=E2=80=99 if it doesn=E2=80=99t exist. --- guix/scripts/home.scm | 25 +++++++----- guix/scripts/home/import.scm | 75 +++++++++++++++++++++--------------- 2 files changed, 60 insertions(+), 40 deletions(-) diff --git a/guix/scripts/home.scm b/guix/scripts/home.scm index 75df6d707d..0f638b643e 100644 --- a/guix/scripts/home.scm +++ b/guix/scripts/home.scm @@ -38,6 +38,7 @@ (define-module (guix scripts home) #:autoload (guix scripts pull) (channel-commit-hyperlink) #:use-module (guix scripts home import) #:use-module ((guix status) #:select (with-status-verbosity)) + #:use-module ((guix build utils) #:select (mkdir-p)) #:use-module (guix gexp) #:use-module (guix monads) #:use-module (srfi srfi-1) @@ -248,15 +249,21 @@ (define-syntax-rule (with-store* store exp ...) (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)))) + (match (filter-map (match-lambda + (('profile . p) p) + (_ #f)) + opts) + (() (list %current-profile)) + (lst (reverse lst))))) + (manifest (concatenate-manifests + (map profile-manifest profiles))) + (destination (match args + ((destination) destination) + (_ (leave (G_ "wrong number of arguments~%"))))= )) + (unless (file-exists? destination) + (mkdir-p destination)) + (parameterize ((%destination-directory destination)) + (import-manifest manifest (current-output-port))))) ((describe) (match (generation-number %guix-home) (0 diff --git a/guix/scripts/home/import.scm b/guix/scripts/home/import.scm index 79fb23a2fd..a6ab68a32c 100644 --- a/guix/scripts/home/import.scm +++ b/guix/scripts/home/import.scm @@ -27,7 +27,8 @@ (define-module (guix scripts home import) #:use-module (ice-9 pretty-print) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) - #:export (import-manifest)) + #:export (import-manifest + %destination-directory)) =20 ;;; Commentary: ;;; @@ -36,29 +37,34 @@ (define-module (guix scripts home import) ;;; ;;; Code: =20 +(define %destination-directory + (make-parameter (string-append (getenv "HOME") "/src/guix-config"))) =20 (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"))) + (define (destination-append path) + (string-append (%destination-directory) "/" path)) + + (let ((rc (destination-append ".bashrc")) + (profile (destination-append ".bash_profile")) + (logout (destination-append ".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))))) - '())))))) - + (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))))) + '())))))) =20 (define %files-configurations-alist `((".bashrc" . ,generate-bash-module+configuration) @@ -66,17 +72,24 @@ (define %files-configurations-alist (".bash_logout" . ,generate-bash-module+configuration))) =20 (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))) + (define configurations + (delete-duplicates + (filter-map (match-lambda + ((file . proc) + (let ((absolute-path (string-append (getenv "HOME") + "/" file))) + (if (file-exists? absolute-path) + (begin + (copy-file absolute-path + (string-append + (%destination-directory) "/" file)) + proc) + #f)))) + %files-configurations-alist) + (lambda (x y) + (equal? (procedure-name x) (procedure-name y))))) +=20=20 + (map (lambda (proc) (proc)) configurations)) =20 ;; Based on `manifest->code' from (guix profiles) ;; MAYBE: Upstream it? --=20 2.33.0 From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 28 13:36:05 2021 Received: (at 50873) by debbugs.gnu.org; 28 Sep 2021 17:36:05 +0000 Received: from localhost ([127.0.0.1]:46923 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mVH1G-0001CW-Jf for submit@debbugs.gnu.org; Tue, 28 Sep 2021 13:36:05 -0400 Received: from h87-96-130-155.cust.a3fiber.se ([87.96.130.155]:33270 helo=mail.yoctocell.xyz) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mVH1F-0001CJ-2K for 50873@debbugs.gnu.org; Tue, 28 Sep 2021 13:35:53 -0400 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yoctocell.xyz; s=mail; t=1632850547; bh=RylSVc8nuJeWHmXsVlgB+ho4C05ujXWj1OBhUFCaHpA=; h=From:To:Subject:In-Reply-To:References:Date; b=LIaTdDgNdqDhaww0r7qWW/Qrf42p3JhR3CymYzhBL4H/Heo3R8csPCFwWW001s9S8 WxgSTkfCQTlqqyre93CPCDw7dGBlZWthVxNM9WqJWM3EBLNORl6PMWNY/Zw567Y03P 39A0mQI0iixW+XTIt+I1CubVLzcBkydU+sego3n4= To: 50873@debbugs.gnu.org Subject: [PATCH 2/5] guix home: import: Allow multiple modules to be imported for each service. In-Reply-To: References: X-Debbugs-Cc: Ludovic =?utf-8?Q?Court=C3=A8s?= , Andrew Tropin Message-Id: <100bd160a58a65442ec68fb2f83e2dc3291224e0.1632849969.git.public@yoctocell.xyz> Date: Tue, 28 Sep 2021 19:35:47 +0200 MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 2.9 (++) 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: Previously, only one module could be imported for each service, e.g., only (gnu home-services shell) could be imported when generating the Bash service declaration. However, for some services, multipl [...] Content analysis details: (2.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches 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.5 FROM_SUSPICIOUS_NTLD From abused NTLD 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS 0.0 PDS_RDNS_DYNAMIC_FP RDNS_DYNAMIC with FP steps X-Debbugs-Envelope-To: 50873 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.9 (+) 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: Previously, only one module could be imported for each service, e.g., only (gnu home-services shell) could be imported when generating the Bash service declaration. However, for some services, multipl [...] Content analysis details: (1.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches 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.5 FROM_SUSPICIOUS_NTLD From abused NTLD 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager 0.0 PDS_RDNS_DYNAMIC_FP RDNS_DYNAMIC with FP steps Previously, only one module could be imported for each service, e.g., only (gnu home-services shell) could be imported when generating the Bash service declaration. However, for some services, multiple modules might need to be imported in order for it to work. * guix/scripts/home/import.scm (generate-bash-module+configuration): Rename to ... (generate-bash-configuration+modules): ... this. (%files-configurations-alist): Rename to ... (%files+configurations-alist): ... this. (modules+configurations): Rename to ... (configurations+modules): ... this. (manifest->code): Adjust accordingly. --- guix/scripts/home/import.scm | 43 ++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/guix/scripts/home/import.scm b/guix/scripts/home/import.scm index a6ab68a32c..ad926fa202 100644 --- a/guix/scripts/home/import.scm +++ b/guix/scripts/home/import.scm @@ -40,15 +40,14 @@ (define-module (guix scripts home import) (define %destination-directory (make-parameter (string-append (getenv "HOME") "/src/guix-config"))) -(define (generate-bash-module+configuration) +(define (generate-bash-configuration+modules) (define (destination-append path) (string-append (%destination-directory) "/" path)) (let ((rc (destination-append ".bashrc")) (profile (destination-append ".bash_profile")) (logout (destination-append ".bash_logout"))) - `((gnu home-services bash) - (service home-bash-service-type + `((service home-bash-service-type (home-bash-configuration ,@(if (file-exists? rc) `((bashrc @@ -64,14 +63,16 @@ (define (destination-append path) `((bash-logout (list (slurp-file-gexp (local-file ,logout))))) - '())))))) + '()))) + (gnu home-services bash)))) -(define %files-configurations-alist - `((".bashrc" . ,generate-bash-module+configuration) - (".bash_profile" . ,generate-bash-module+configuration) - (".bash_logout" . ,generate-bash-module+configuration))) -(define (modules+configurations) +(define %files+configurations-alist + `((".bashrc" . ,generate-bash-configuration+modules) + (".bash_profile" . ,generate-bash-configuration+modules) + (".bash_logout" . ,generate-bash-configuration+modules))) + +(define (configurations+modules) (define configurations (delete-duplicates (filter-map (match-lambda @@ -85,11 +86,11 @@ (define configurations (%destination-directory) "/" file)) proc) #f)))) - %files-configurations-alist) + %files+configurations-alist) (lambda (x y) (equal? (procedure-name x) (procedure-name y))))) - (map (lambda (proc) (proc)) configurations)) + (map (lambda (proc) (proc)) configurations)) ;; Based on `manifest->code' from (guix profiles) ;; MAYBE: Upstream it? @@ -144,14 +145,14 @@ (define (qualified-name entry) ":" output)))) (manifest-entries manifest)))) (if home-environment? - (let ((modules+configurations (modules+configurations))) + (let ((configurations+modules (configurations+modules))) `(begin - (use-modules (gnu home) - (gnu packages) - ,@(map first modules+configurations)) - ,(home-environment-template - #:specs specs - #:services (map second modules+configurations)))) + (use-modules (gnu home) + (gnu packages) + ,@(concatenate (map cdr configurations+modules))) + ,(home-environment-template + #:specs specs + #:services (map first configurations+modules)))) `(begin (use-modules (gnu packages)) @@ -186,18 +187,18 @@ (define name (options->transformation ',options)))) transformation-procedures))) (if home-environment? - (let ((modules+configurations (modules+configurations))) + (let ((configurations+modules (configurations+modules))) `(begin (use-modules (guix transformations) (gnu home) (gnu packages) - ,@(map first modules+configurations)) + ,@(concatenate (map cdr configurations+modules))) ,@transformations ,(home-environment-template #:packages packages - #:services (map second modules+configurations)))) + #:services (map first configurations+modules)))) `(begin (use-modules (guix transformations) (gnu packages)) -- 2.33.0 From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 28 13:36:05 2021 Received: (at 50873) by debbugs.gnu.org; 28 Sep 2021 17:36:05 +0000 Received: from localhost ([127.0.0.1]:46928 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mVH1R-0001DF-Ga for submit@debbugs.gnu.org; Tue, 28 Sep 2021 13:36:05 -0400 Received: from h87-96-130-155.cust.a3fiber.se ([87.96.130.155]:33280 helo=mail.yoctocell.xyz) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mVH1K-0001CP-T5 for 50873@debbugs.gnu.org; Tue, 28 Sep 2021 13:35:59 -0400 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yoctocell.xyz; s=mail; t=1632850553; bh=WdGWlYN8AYbycU8YeDTnp965qSc1o7PAFb9CV2VtQp4=; h=From:To:Subject:In-Reply-To:References:Date; b=KJ9Au9VnPcaVyafLOZKIq/vym7jjk5a0CGrsll57GeDuRVTK7H6DhQ4rm8KV1Qw4R wCiivZsvggYqU74xRt/UFxqfmHhBrKP7KcnvLZCf3OYFPIR0GczoeH8Fh6azJZEu5H K5bfly76udAuKu3/u6rplHtSMSrA2SRBWpC8Jbek= To: 50873@debbugs.gnu.org Subject: [PATCH 3/5] guix home: import: Fix module name for Bash service. In-Reply-To: References: X-Debbugs-Cc: Ludovic =?utf-8?Q?Court=C3=A8s?= , Andrew Tropin Message-Id: <4c4666a12f67c76b463cc7701319e68b9b809def.1632849969.git.public@yoctocell.xyz> Date: Tue, 28 Sep 2021 19:35:52 +0200 MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 2.9 (++) 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 (generate-bash-configuration+modules): Change (gnu home-services bash) to (gnu home-services shells). --- guix/scripts/home/import.scm | 2 +- 1 file changed, 1 insertion [...] Content analysis details: (2.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches 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.5 FROM_SUSPICIOUS_NTLD From abused NTLD 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS 0.0 PDS_RDNS_DYNAMIC_FP RDNS_DYNAMIC with FP steps X-Debbugs-Envelope-To: 50873 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.9 (+) 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 (generate-bash-configuration+modules): Change (gnu home-services bash) to (gnu home-services shells). --- guix/scripts/home/import.scm | 2 +- 1 file changed, 1 insertion [...] Content analysis details: (1.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches 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.5 FROM_SUSPICIOUS_NTLD From abused NTLD 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager 0.0 PDS_RDNS_DYNAMIC_FP RDNS_DYNAMIC with FP steps * guix/scripts/home/import.scm (generate-bash-configuration+modules): Change (gnu home-services bash) to (gnu home-services shells). --- guix/scripts/home/import.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guix/scripts/home/import.scm b/guix/scripts/home/import.scm index ad926fa202..6d9ca98f28 100644 --- a/guix/scripts/home/import.scm +++ b/guix/scripts/home/import.scm @@ -64,7 +64,7 @@ (define (destination-append path) (list (slurp-file-gexp (local-file ,logout))))) '()))) - (gnu home-services bash)))) + (gnu home-services shells)))) (define %files+configurations-alist -- 2.33.0 From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 28 13:36:08 2021 Received: (at 50873) by debbugs.gnu.org; 28 Sep 2021 17:36:08 +0000 Received: from localhost ([127.0.0.1]:46931 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mVH1T-0001DZ-P7 for submit@debbugs.gnu.org; Tue, 28 Sep 2021 13:36:07 -0400 Received: from h87-96-130-155.cust.a3fiber.se ([87.96.130.155]:33286 helo=mail.yoctocell.xyz) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mVH1S-0001Cj-8g for 50873@debbugs.gnu.org; Tue, 28 Sep 2021 13:36:06 -0400 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yoctocell.xyz; s=mail; t=1632850560; bh=noR8bcNYCpsS7urz40MGuCN1Dw4WfxLNXQpd0Scl5Zg=; h=From:To:Subject:In-Reply-To:References:Date; b=r+Fy5q/jJHbJ5HLE0TS/Tna/RGOYHxzwTInNtYs7eCdsCdflZnlfXq6NofAAmmflQ f7dTV1E2liwYIXWypkoEcDFUA5NTEpfPq5P8bHjKjEoqea1j6rEelOd9kPzuumota1 HTa7jRF0lbPwtmmz9WKLK/vCjlfKOcykR0SauiYY= To: 50873@debbugs.gnu.org Subject: [PATCH 4/5] guix home: import: Delete duplicate modules when importing. In-Reply-To: References: X-Debbugs-Cc: Ludovic =?utf-8?Q?Court=C3=A8s?= , Andrew Tropin Message-Id: <7063704a274d99c8ea0bdc437a05b74e9fd78a49.1632849969.git.public@yoctocell.xyz> Date: Tue, 28 Sep 2021 19:36:00 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 2.9 (++) 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: Two different services might require the same module(s), so delete duplicates when generating the ‘use-modules’ form. * import.scm (manifest->code): Delete duplicate modules. --- guix/scripts/home/import.scm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) Content analysis details: (2.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches 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.5 FROM_SUSPICIOUS_NTLD From abused NTLD 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS 0.0 PDS_RDNS_DYNAMIC_FP RDNS_DYNAMIC with FP steps X-Debbugs-Envelope-To: 50873 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.9 (+) 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: Two different services might require the same module(s), so delete duplicates when generating the ‘use-modules’ form. * import.scm (manifest->code): Delete duplicate modules. --- guix/scripts/home/import.scm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) Content analysis details: (1.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches 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.5 FROM_SUSPICIOUS_NTLD From abused NTLD 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager 0.0 PDS_RDNS_DYNAMIC_FP RDNS_DYNAMIC with FP steps Two different services might require the same module(s), so delete duplicat= es when generating the =E2=80=98use-modules=E2=80=99 form. * import.scm (manifest->code): Delete duplicate modules. --- guix/scripts/home/import.scm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/guix/scripts/home/import.scm b/guix/scripts/home/import.scm index 6d9ca98f28..5ba99378af 100644 --- a/guix/scripts/home/import.scm +++ b/guix/scripts/home/import.scm @@ -149,7 +149,8 @@ (define (qualified-name entry) `(begin (use-modules (gnu home) (gnu packages) - ,@(concatenate (map cdr configurations+modul= es))) + ,@((compose delete-duplicates concatenate) + (map cdr configurations+modules))) ,(home-environment-template #:specs specs #:services (map first configurations+modules)))) @@ -192,7 +193,8 @@ (define name (use-modules (guix transformations) (gnu home) (gnu packages) - ,@(concatenate (map cdr configurations+modul= es))) + ,@((compose delete-duplicates concatenate) + (map cdr configurations+modules))) =20 ,@transformations =20 --=20 2.33.0 From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 28 13:36:13 2021 Received: (at 50873) by debbugs.gnu.org; 28 Sep 2021 17:36:13 +0000 Received: from localhost ([127.0.0.1]:46934 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mVH1Y-0001Dr-Vj for submit@debbugs.gnu.org; Tue, 28 Sep 2021 13:36:13 -0400 Received: from h87-96-130-155.cust.a3fiber.se ([87.96.130.155]:33292 helo=mail.yoctocell.xyz) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mVH1U-0001DB-MJ for 50873@debbugs.gnu.org; Tue, 28 Sep 2021 13:36:08 -0400 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yoctocell.xyz; s=mail; t=1632850563; bh=TUtWXEuGN7p9CKtrdQJ102+DBZNfc2RxrCTbv4yjRA0=; h=From:To:Subject:In-Reply-To:References:Date; b=VhTB1R460wWAgmWKEBeFPvF8byYXfv1U7WaTChVrxy4UZ1/H7wxa/iLH2H3N7vnkU hs3mBknzmfGZeK0oo1lZpamx1vVCOBygHYoafcw88y4l5z6YdORc9wXQ6ILc4wZ9+s zK76HYIFx+u535rC+Ls2HBu/DmP/oxxf5iw4mWBg= To: 50873@debbugs.gnu.org Subject: [PATCH 5/5] =?UTF-8?q?doc:=20Document=20the=20=E2=80=98guix=20hom?= =?UTF-8?q?e=20import=E2=80=99=20subcommand.?= In-Reply-To: References: X-Debbugs-Cc: Ludovic =?utf-8?Q?Court=C3=A8s?= , Andrew Tropin Message-Id: Date: Tue, 28 Sep 2021 19:36:02 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 2.9 (++) 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: * doc/guix.texi (Invoking guix home): Document ‘guix home import’. --- doc/guix.texi | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/doc/guix.texi b/doc/guix.texi index 7956652050..2c268705d0 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -36088,6 +36088,39 @@ $ guix home list-generations 10d @end example Content analysis details: (2.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches 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.5 FROM_SUSPICIOUS_NTLD From abused NTLD 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS 0.0 PDS_RDNS_DYNAMIC_FP RDNS_DYNAMIC with FP steps X-Debbugs-Envelope-To: 50873 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.9 (+) 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: * doc/guix.texi (Invoking guix home): Document ‘guix home import’. --- doc/guix.texi | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/doc/guix.texi b/doc/guix.texi index 7956652050..2c268705d0 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -36088,6 +36088,39 @@ $ guix home list-generations 10d @end example Content analysis details: (1.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches 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.5 FROM_SUSPICIOUS_NTLD From abused NTLD 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager 0.0 PDS_RDNS_DYNAMIC_FP RDNS_DYNAMIC with FP steps * doc/guix.texi (Invoking guix home): Document =E2=80=98guix home import=E2= =80=99. --- doc/guix.texi | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/doc/guix.texi b/doc/guix.texi index 7956652050..2c268705d0 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -36088,6 +36088,39 @@ $ guix home list-generations 10d @end example =20 +@item import +Generate a @dfn{home environment} from the packages in the default +profile and configuration files found in the user's home directory. The +configuration files will be copied to the specified directory. Note +that not every home service that exists is supported (@pxref{Home +Services}). + +@example +$ guix home import ~/guix-config +;; 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. + +(use-modules + (gnu home) + (gnu packages) + (gnu home-services bash)) + +(home-environment + (packages + (map specification->package + (list "glibc-locales" "nss-certs" "nss"))) + (services + (list (service + home-bash-service-type + (home-bash-configuration + (bashrc + (list (slurp-file-gexp + (local-file "/home/alice/guix-config/.bashrc")))))= )))) +@end example + @end table =20 @node Documentation --=20 2.33.0 From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 28 15:00:08 2021 Received: (at 50873) by debbugs.gnu.org; 28 Sep 2021 19:00:08 +0000 Received: from localhost ([127.0.0.1]:46983 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mVIKl-0005Qx-Ij for submit@debbugs.gnu.org; Tue, 28 Sep 2021 15:00:07 -0400 Received: from h87-96-130-155.cust.a3fiber.se ([87.96.130.155]:35054 helo=mail.yoctocell.xyz) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mVIKj-0005Ov-5K for 50873@debbugs.gnu.org; Tue, 28 Sep 2021 15:00:06 -0400 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yoctocell.xyz; s=mail; t=1632855597; bh=I3+vKjvVEU+BvmdcCEqPRwJFryDUq7b6fVQxN31/IYs=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=GVlpQU7UbD+Wq+Gl62YnGRKAdaDDP5iue4/7WYNGp+TyuiNaJQ+NuSKbQ7KzFJQ/h 88yZwsF11C7//jaiphjuvb9y9bp1/hQeFUaXSgjSnEVtgF35Ctgpmdj3nqGR0TQi1g z5aQNLwQLgC02sbobfMS5/7Q4a+NNr43hPlEfy9M= To: 50873@debbugs.gnu.org Subject: Re: [bug#50796] [PATCH] gnu: Add pn. In-Reply-To: <20210925032815.68194-1-antero@mailbox.org> References: <20210925032815.68194-1-antero@mailbox.org> X-Debbugs-Cc: Ludovic =?utf-8?Q?Court=C3=A8s?= , Andrew Tropin Date: Tue, 28 Sep 2021 20:59:52 +0200 Message-ID: <87lf3g34rb.fsf@yoctocell.xyz> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Spam-Score: 2.9 (++) 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 Fri, Sep 24 2021, Antero Mejr via Guix-patches via wrote: > * gnu/packages/telephony.scm (pn): New variable. The ‘libphonenumber’ package is also added; this should be split into patches, each adding one new package. Content analysis details: (2.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches 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.5 FROM_SUSPICIOUS_NTLD From abused NTLD 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS 0.0 PDS_RDNS_DYNAMIC_FP RDNS_DYNAMIC with FP steps X-Debbugs-Envelope-To: 50873 Cc: Antero Mejr 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: 2.9 (++) 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 Fri, Sep 24 2021, Antero Mejr via Guix-patches via wrote: > * gnu/packages/telephony.scm (pn): New variable. The ‘libphonenumber’ package is also added; this should be split into patches, each adding one new package. Content analysis details: (2.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches 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.5 FROM_SUSPICIOUS_NTLD From abused NTLD 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS 1.0 BULK_RE_SUSP_NTLD Precedence bulk and RE: from a suspicious TLD -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager 0.0 PDS_RDNS_DYNAMIC_FP RDNS_DYNAMIC with FP steps --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Fri, Sep 24 2021, Antero Mejr via Guix-patches via wrote: > * gnu/packages/telephony.scm (pn): New variable. The =E2=80=98libphonenumber=E2=80=99 package is also added; this should be = split into patches, each adding one new package. > --- > Add pn and its dependencies. > It's a phone number CLI tool used by Linux phone GUIs like SXMO. > > gnu/packages/telephony.scm | 72 ++++++++++++++++++++++++++++++++++++++ > 1 file changed, 72 insertions(+) > > diff --git a/gnu/packages/telephony.scm b/gnu/packages/telephony.scm > index 48bbe12920..9015cf536a 100644 > --- a/gnu/packages/telephony.scm > +++ b/gnu/packages/telephony.scm > @@ -20,6 +20,7 @@ > ;;; Copyright =C2=A9 2020, 2021 Maxim Cournoyer > ;;; Copyright =C2=A9 2020 Vincent Legoll > ;;; Copyright =C2=A9 2021 LibreMiami > +;;; Copyright =C2=A9 2021 Antero Mejr > ;;; > ;;; This file is part of GNU Guix. > ;;; > @@ -54,12 +55,14 @@ > #:use-module (gnu packages documentation) > #:use-module (gnu packages file) > #:use-module (gnu packages protobuf) > + #:use-module (gnu packages gawk) > #:use-module (gnu packages gettext) > #:use-module (gnu packages gl) > #:use-module (gnu packages glib) > #:use-module (gnu packages gnome) > #:use-module (gnu packages gnupg) > #:use-module (gnu packages gtk) > + #:use-module (gnu packages icu4c) > #:use-module (gnu packages image) > #:use-module (gnu packages libcanberra) > #:use-module (gnu packages linphone) > @@ -907,3 +910,72 @@ Initiation Protocol (SIP) and a multimedia framework= .") > telephony functionality into custom Telegram clients.") > (home-page "https://github.com/zevlg/libtgvoip") > (license license:unlicense))) > + > +(define-public libphonenumber > + (package > + (name "libphonenumber") > + (version "8.12.33") > + (source > + (origin > + (method git-fetch) > + (uri (git-reference > + (url "https://github.com/google/libphonenumber") > + (commit (string-append "v" version)))) > + (file-name (git-file-name name version)) > + (sha256 > + (base32 > + "0r12icyig6jy0v87j9n3w14acfa2yfckzzfbmnjx1hww6qc9ih25")))) > + (build-system cmake-build-system) > + (arguments > + `(#:tests? #f There should be a comment explaining why tests are disabled. > + #:phases > + (modify-phases %standard-phases > + (add-after 'unpack 'enter-dir > + (lambda _ (chdir "cpp") #t))))) Phases don=E2=80=99t have to return #t. > + (inputs > + `(("boost" ,boost) > + ("googletest" ,googletest) > + ("protobuf" ,protobuf) > + ("icu4c" ,icu4c))) > + (home-page "https://github.com/google/libphonenumber") > + (synopsis "C++ library for phone number parsing") > + (description > + "libphonenumber is Google's common Java, C++ and JavaScript library= for > +parsing, formatting, and validating international phone numbers.") I would use @code{libphonenumber}. The package doesn=E2=80=99t seem to be reproducible; =E2=80=98guix build li= bphonenumber =2D-rounds=3D2=E2=80=99 fails with =2D-8<---------------cut here---------------start------------->8--- guix build: error: derivation `/gnu/store/a0vycg9ic70bziygn098bbvw4hy39zzb-= libphonenumber-8.12.33.drv' may not be deterministic: output `/gnu/store/1i= fj4ndpf3mv8nwbjp0gzrx5jpjvghgb-libphonenumber-8.12.33' differs =2D-8<---------------cut here---------------end--------------->8--- Could you look into this? > + (license license:asl2.0))) > + > +(define-public pn > + (package > + (name "pn") > + (version "0.9.0") > + (source > + (origin > + (method git-fetch) > + (uri (git-reference > + (url "https://github.com/Orange-OpenSource/pn") > + (commit (string-append "v" version)))) > + (file-name (git-file-name name version)) > + (sha256 > + (base32 > + "1lvzb0yixj7wmmqzsri20k9nn3gf06j0yjvmg2mi1zihywq7s4dx")))) > + (build-system cmake-build-system) > + (arguments > + `(#:tests? #f Why are tests disabled? > + #:phases > + (modify-phases %standard-phases > + (add-after 'unpack 'sub-bin-path > + (lambda _ > + (substitute* "CMakeLists.txt" (("DESTINATION \\$\\{AWKLIBPA= TH\\}") > + "DESTINATION bin"))))))) > + (inputs > + `(("libphonenumber" ,libphonenumber) > + ("icu4c" ,icu4c) > + ("protobuf" ,protobuf) > + ("gawk" ,gawk))) > + (home-page "https://github.com/Orange-OpenSource/pn") > + (synopsis "Command-line validation tool for phone numbers") > + (description > + "pn is a tool that allows command line user/programmers to operate = on > +phone numbers (get validity information, reformat them, or extract numbe= rs > +from a text snippet), using libphonenumber.") I suggest @code{pn} provides a command line tools that allows on to operate on phone numbers (get validity information, reformat them, or extract numbers from a text snippet), using @code{libphonenumber}. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJJBAEBCAAzFiEEAVhh4yyK5+SEykIzrPUJmaL7XHkFAmFTZikVHHB1YmxpY0B5 b2N0b2NlbGwueHl6AAoJEKz1CZmi+1x5OO0P/1Rxx51OXlTRsGt1+4D5VatanM5t yBNIjzUdPVdJF4q3JYgH9WWwSHEysUlI18taLmVn+XcTUOcMiBiMf8cU8rLEgcol 2TYpzU8E4s6qijF5VSF7GN8+6fT3SvgbgneGSriCnGTOM1DaZM2ZRCdtX4rOYK3t aKNbTdKjUD5PDlNycoRQY/SSvrOftSuWLcUhcjS0kDjoQFL8QG7ZP2OUalBf4kfE IzoUOPJe5AYGor9b15YPiEGdghgMVRBWdSGlmkEO9PREtZPkSpilg4OicOkDuhrJ NadhOuTvAwFKFdMUcaTyg1nqvQdwqWUYcHDIDsYDga5gDM4TrdzgUdhpd44qirRn JW3lEbiDkj7+SO+jd1yYcUTaTMcDimlzuGuGFVyyX0U/rtYI2kNeESpGyab7zdPt M+oO0YkrWfDG1itr1jhGbluJk10PGqUA4M44o76uTTkqsI1F5U+90oZ3ulgZnLxb 7iBT4sJvjHOodRW/swUZkmvbgkhGx1A+kpCpz7Cg+yb6Qr4Q47BuPpwg6zKVFmIW TEsFH4GpPR1eVKTkjycXwpxHWyWZnc1eyBi9EO3DqZXxvOVJxzZRGPx+dYJ3Jznl I6oGCIt3X4IQ2bHEc2lW1dcFG0+APTM5fxYNOyMnqcMsjJu7+d/BkYZRL5RHTFsv QfwZdt6NmeGYSmUg =1DBg -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 28 16:52:57 2021 Received: (at 50873) by debbugs.gnu.org; 28 Sep 2021 20:52:57 +0000 Received: from localhost ([127.0.0.1]:47161 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mVK5x-0008Gt-At for submit@debbugs.gnu.org; Tue, 28 Sep 2021 16:52:57 -0400 Received: from mout-p-101.mailbox.org ([80.241.56.151]:44166) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mVK5v-0008Gd-LF for 50873@debbugs.gnu.org; Tue, 28 Sep 2021 16:52:56 -0400 Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:105:465:1:2:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-101.mailbox.org (Postfix) with ESMTPS id 4HJsCP42yczQkJ1 for <50873@debbugs.gnu.org>; Tue, 28 Sep 2021 22:52:49 +0200 (CEST) Authentication-Results: spamfilter01.heinlein-hosting.de (amavisd-new); dkim=pass (2048-bit key) reason="pass (just generated, assumed good)" header.d=mailbox.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1632862367; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gefl5fw8JWRwmqF6izeWg+SAsD7a8rgwYRrvjWIFZKQ=; b=deRn8w1Vv255J1wV8IvF/wzJxzbEbMFTYlhOnrc1oRsTQpcNJCs71N12xzpU/BgKPEx21v TJNW0wLEjBwGnHYXCAxg1CcaY57GO9RddtMOT61ewZMZ7KgcVveEm1isu+NpfVaS0vnRJ3 WLQSRi0h1pJRx9iDQYHe+9huznTiUe9bTgkZBbK9y1rpS6HoskXe0jco5iF+hqG6nr16pK WeuauP4ZzF63qyc3yYhNjojZlvxn6JUzBxOLqpQo876+6WJt4/pBM/bqDrkSwIUUUqgrHH D/EKDtbFjlyV6I/bF/3G+golopEvoSRN+pG9N1ymQIr4y86yBKgGGS4xDpb38Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mailbox.org; h= content-transfer-encoding:content-type:content-type:mime-version :references:in-reply-to:message-id:date:date:subject:subject :from:from:received; s=mail20150812; t=1632862366; bh=kAWSSR2+Iy g4aV234lx3dzgD+FmfJkYZMM8gK1+5KF4=; b=heMaFizn7TVLpF+9bBQ08uBv1B xrwSaEaZJadfDwqJIqAqCThLHXXJjDaM/kseK6wGueZ2zP423PrL4fheYftYVn0r l3jdAhiqCzuyoPY+BGZJANSBfYNVs1irrc3wc/NN00NHVnnYb6W2eN6ZCsQWKRQi MpON7nbiLtMRbP6a8CbeA4/peSwMv1BWWL75co2K0EQZaj01L2L3p9MsX0KS7pFS X7hnF3XrrX72OprJkP4vugw0zB/L9lFuUczmECl6i0p5g/hfuFyXdWxatUtTdr+w w94x4vtQrdGxHBw2MsTxzvI4rHVgfXZrxRKbdqcJ9TK4OXxEalC7WWtETlhQ== X-Virus-Scanned: amavisd-new at heinlein-support.de From: Antero Mejr To: 50873@debbugs.gnu.org Subject: [PATCH 1/2] gnu: Add libphonenumber. Date: Tue, 28 Sep 2021 16:52:26 -0400 Message-Id: <20210928205227.25833-2-antero@mailbox.org> In-Reply-To: <20210928205227.25833-1-antero@mailbox.org> References: <20210928205227.25833-1-antero@mailbox.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8546B1702 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 50873 Cc: Antero Mejr X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) * gnu/packages/telephony.scm (libphonenumber): New variable. --- gnu/packages/telephony.scm | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/gnu/packages/telephony.scm b/gnu/packages/telephony.scm index 48bbe12920..50b5790ae3 100644 --- a/gnu/packages/telephony.scm +++ b/gnu/packages/telephony.scm @@ -20,6 +20,7 @@ ;;; Copyright © 2020, 2021 Maxim Cournoyer ;;; Copyright © 2020 Vincent Legoll ;;; Copyright © 2021 LibreMiami +;;; Copyright © 2021 Antero Mejr ;;; ;;; This file is part of GNU Guix. ;;; @@ -54,12 +55,14 @@ #:use-module (gnu packages documentation) #:use-module (gnu packages file) #:use-module (gnu packages protobuf) + #:use-module (gnu packages gawk) #:use-module (gnu packages gettext) #:use-module (gnu packages gl) #:use-module (gnu packages glib) #:use-module (gnu packages gnome) #:use-module (gnu packages gnupg) #:use-module (gnu packages gtk) + #:use-module (gnu packages icu4c) #:use-module (gnu packages image) #:use-module (gnu packages libcanberra) #:use-module (gnu packages linphone) @@ -907,3 +910,38 @@ Initiation Protocol (SIP) and a multimedia framework.") telephony functionality into custom Telegram clients.") (home-page "https://github.com/zevlg/libtgvoip") (license license:unlicense))) + +(define-public libphonenumber + (package + (name "libphonenumber") + (version "8.12.33") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/google/libphonenumber") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0r12icyig6jy0v87j9n3w14acfa2yfckzzfbmnjx1hww6qc9ih25")))) + (build-system cmake-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (add-after 'unpack 'enter-dir + (lambda _ (chdir "cpp"))) + (replace 'check + (lambda _ (invoke "./libphonenumber_test")))))) + (inputs + `(("boost" ,boost) + ("googletest" ,googletest) + ("protobuf" ,protobuf) + ("icu4c" ,icu4c))) + (home-page "https://github.com/google/libphonenumber") + (synopsis "C++ library for phone number parsing") + (description + "@code{libphonenumber} is Google's common Java, C++ and JavaScript +library for parsing, formatting, and validating international phone numbers.") + (license license:asl2.0))) + -- 2.30.2 From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 28 16:53:03 2021 Received: (at 50873) by debbugs.gnu.org; 28 Sep 2021 20:53:03 +0000 Received: from localhost ([127.0.0.1]:47165 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mVK62-0008He-O6 for submit@debbugs.gnu.org; Tue, 28 Sep 2021 16:53:02 -0400 Received: from mout-p-202.mailbox.org ([80.241.56.172]:41784) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mVK5x-0008Gg-29 for 50873@debbugs.gnu.org; Tue, 28 Sep 2021 16:52:57 -0400 Received: from smtp2.mailbox.org (smtp2.mailbox.org [80.241.60.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4HJsCR4NWDzQkBx for <50873@debbugs.gnu.org>; Tue, 28 Sep 2021 22:52:51 +0200 (CEST) Authentication-Results: spamfilter03.heinlein-hosting.de (amavisd-new); dkim=pass (2048-bit key) reason="pass (just generated, assumed good)" header.d=mailbox.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1632862369; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kVda2M8rJ3I5ztqRaOiAmPnGhDfJ5CWc7pVyzxJG7iA=; b=elBtQMKwYAlP9EnWH3Vbu0c3qYyOI6h6HllGJa8FGtuqcilLryVwnq+Q8jOkoIMwf+T6AA opuIxBtboFb1p9KAFBVUO1IbrxRTDo4JLX+MYvA5HwY8UnylxkZua6tGdE5tT0oO55yhwu SYPiV6anDwoC0xMrp5GiaWMFUB+UTNbV5dOY+kKWWJW8gcwXJadJyqFLf2dw4Tc4iCZYpH 8zcuvu8WXqTXyVsjkKRR6+13RqLYHwGRLI2pFg7vaOIYQ6P1I9bHhsoZT7mC7PpUq1wdkl gmDPFipDdfC7PnQbO3YH34rYIxFtP1h5xmZDjiMQ5EIXcFmqWCA33o0PkG65/g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mailbox.org; h= content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:date:subject:subject:from:from:received; s= mail20150812; t=1632862368; bh=RzX1DZTPz6nEgVXKLKrxk/8x3L0mLh/rI 9QaxBER1Vg=; b=H2rGLAYl2qSOpQnBtCPnFOy7obYSN3H1/HzikdJqiVa0BvzzC Fql8aaSVeaJrO7RWP9kkfVnr1Wrigfnl7sJbimT3kLt84M/5+Ylg6FZmFI8rjqNM sUkrBwtbxdMSptwrUzx4/gA97/mDEjKtKk1KcH1Xb362V581ELkgFK1rMG0cpZpg 3HqrgU3AM0g5hXxWKVN2zFt5RPEY/q4Ls6BGbWlGGDYIERzjp3kerI04tTGqrCo3 b+0XE+c1b93dEil+dX08i0x+37Um25IRvun1/+9pSQWHExkGef95PO5ucKd1dq0+ sW+z5mf81XcQO0t6W155qyn8ajCDQi9+H2IdA== X-Virus-Scanned: amavisd-new at heinlein-support.de From: Antero Mejr To: 50873@debbugs.gnu.org Subject: [PATCH 2/2] gnu: Add pn. Date: Tue, 28 Sep 2021 16:52:27 -0400 Message-Id: <20210928205227.25833-3-antero@mailbox.org> In-Reply-To: <20210928205227.25833-1-antero@mailbox.org> References: <20210928205227.25833-1-antero@mailbox.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A20CF881 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 50873 Cc: Antero Mejr X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) * gnu/packages/telephony.scm (pn): New variable. --- gnu/packages/telephony.scm | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/gnu/packages/telephony.scm b/gnu/packages/telephony.scm index 50b5790ae3..d30c8aa661 100644 --- a/gnu/packages/telephony.scm +++ b/gnu/packages/telephony.scm @@ -945,3 +945,38 @@ telephony functionality into custom Telegram clients.") library for parsing, formatting, and validating international phone numbers.") (license license:asl2.0))) +(define-public pn + (package + (name "pn") + (version "0.9.0") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/Orange-OpenSource/pn") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1lvzb0yixj7wmmqzsri20k9nn3gf06j0yjvmg2mi1zihywq7s4dx")))) + (build-system cmake-build-system) + (arguments + `(#:tests? #f ; no tests + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'sub-bin-path + (lambda _ + (substitute* "CMakeLists.txt" (("DESTINATION \\$\\{AWKLIBPATH\\}") + "DESTINATION bin"))))))) + (inputs + `(("libphonenumber" ,libphonenumber) + ("icu4c" ,icu4c) + ("protobuf" ,protobuf) + ("gawk" ,gawk))) + (home-page "https://github.com/Orange-OpenSource/pn") + (synopsis "Command-line validation tool for phone numbers") + (description + "@code{pn} provides a command line tool that allows users to operate on +phone numbers (get validity information, reformat them, or extract +numbers from a text snippet), using @code{libphonenumber}.") + (license license:asl2.0))) -- 2.30.2 From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 28 16:53:03 2021 Received: (at 50873) by debbugs.gnu.org; 28 Sep 2021 20:53:03 +0000 Received: from localhost ([127.0.0.1]:47167 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mVK63-0008Hg-11 for submit@debbugs.gnu.org; Tue, 28 Sep 2021 16:53:03 -0400 Received: from mout-p-202.mailbox.org ([80.241.56.172]:41782) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mVK5s-0008GZ-66 for 50873@debbugs.gnu.org; Tue, 28 Sep 2021 16:52:59 -0400 Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:105:465:1:2:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4HJsCK5QktzQk14 for <50873@debbugs.gnu.org>; Tue, 28 Sep 2021 22:52:45 +0200 (CEST) Authentication-Results: spamfilter04.heinlein-hosting.de (amavisd-new); dkim=pass (2048-bit key) reason="pass (just generated, assumed good)" header.d=mailbox.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1632862364; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=19704WD8R3+4o07N+l3wpcufSwnpCXcSNZDIFu2iFiE=; b=qwY07WlYn2FNwYmwSTTY/ZCgWR1U1JhyhMsWxPvCa51p+DvdHkNCKV+auhzVUikcPr9exe B9L0mau3FkMzIjITdqLtCNIoKnQEWX+Dv9NhIaymlUmtQMn6ISC73hTa6QgoMU8+jFkv5Q kWEHpQBIFdbLnQS+/4q1I7hvPTiLz30yLNPC9RlUDr98R4Jal69/ehH3IPRODjgSBGVpem 3X2CJcuw8W1fj9fJZkJM6NDzVEPRfNLw4y5BhDXxL2QRtOCNk9QdWErGb892jlI7oUcmFV ONh0Yk7QMxzgI5oWT/0s7Gn7e8liyrG02FAdqv6R0yeUvTlLzoOo//vezQOoDw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mailbox.org; h= content-transfer-encoding:content-type:content-type:mime-version :message-id:date:date:subject:subject:from:from:received; s= mail20150812; t=1632862362; bh=19704WD8R3+4o07N+l3wpcufSwnpCXcSN ZDIFu2iFiE=; b=cyaopgbB7wKvplvN/2BbV9DkqloMYfMFZQqOIOQml81tLWpW1 aAQ83bpRrE3ZWO3ufug+KPFno8rbkW5WESitlVyrornJO05kCxIMrdPK0EOrJugW +o7MbfJEdEDFLxlu4ozv3Q9YgfN4KqnBemCC3dTHNbAaR7si9OgRlx9eP/2yHPdv 6beGSnHLgm2VBgvp9LVKotISXXHGWBXDy9YSacDl+tPWPleT51VzRUtVgpExOew6 kBeYgrVvY3t5I9hKXudt4BFDY3o+uvvb8/FjvgYkmbH1OOEucbeSCLb+0kzsJqmB MxtscAqOlGzlwORqlRYx9QcKfRMixPJ2CHx9Q== X-Virus-Scanned: amavisd-new at heinlein-support.de From: Antero Mejr To: 50873@debbugs.gnu.org Subject: [PATCH 0/2] Add pn. Date: Tue, 28 Sep 2021 16:52:25 -0400 Message-Id: <20210928205227.25833-1-antero@mailbox.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C1FE7181B X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 50873 Cc: Antero Mejr X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Thanks for the suggestions Xinglu, I updated with the changes. > The package doesn’t seem to be reproducible; ‘guix build libphonenumber > --rounds=2’ fails libphonenumber reproduces on my main computer, I can try again with a different one later: successfully built /gnu/store/dyf2a70slkvfxf4qcims3q69a51ydb0x-libphonenumber-8.12.33.drv successfully built /gnu/store/dyf2a70slkvfxf4qcims3q69a51ydb0x-libphonenumber-8.12.33.drv From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 30 03:09:00 2021 Received: (at 50873) by debbugs.gnu.org; 30 Sep 2021 07:09:00 +0000 Received: from localhost ([127.0.0.1]:51298 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mVqBf-00024I-U8 for submit@debbugs.gnu.org; Thu, 30 Sep 2021 03:09:00 -0400 Received: from mail-lf1-f49.google.com ([209.85.167.49]:34419) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mVqBc-000241-9Q for 50873@debbugs.gnu.org; Thu, 30 Sep 2021 03:08:58 -0400 Received: by mail-lf1-f49.google.com with SMTP id g41so21202003lfv.1 for <50873@debbugs.gnu.org>; Thu, 30 Sep 2021 00:08:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop-in.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=bTeuW3+LMqEhwU25kEL+7oYUHmV1P6LodFInKksU4jQ=; b=rjydLJyTQmdzUI2bsvxAyuCOTwgw6y8CToVQdHqMwnxiGl+8UqhjlR7jRlJbNj47nd OKvMfGiN5knINtIm6Luiao6MSt9+k4qsjFhx0ar1eVg5ezcUPyOsm+1j+NaHUchoukki XxUcM/3ifYAcTZXOS6GIlHYy1lVoWb0UQ+6uhdXdEHfdAg8h9K5aiel3+Cljz+JXzzIP mlx12eJtMABYrT5QwW1Njy8MLuQxvIWUB5iGbWpH7abpsqeHNDIsshkiizIyHXeOBo5b VftHCc/IZQJBr2kozar9g1mBa5iCZCPDqnSNZjEvRJ9fWFvGskI68lvJec3MC6/oYoHB qiTQ== 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=bTeuW3+LMqEhwU25kEL+7oYUHmV1P6LodFInKksU4jQ=; b=rBg1P+8BuPXkGQ+g/0HsyMoTlWKzU1f3m5ppxnSuJNrf87TBd/H3fQMmShLDl/wqoa mZlTyQP8j5GVMfCukyWcsPii17HfDpCN73QT3HxMTlmVL2eyvbY7VEcb7rrGaKwbofVt yOj5l1zluBUtnm++cWnG5ghpvy9i1P0UOS1Rqu1KTQmFaJIvGZve/y6OT5Ynr69JGX0I ogIGCFNQU/N+8wqRTzEX9V5qw2pJmmUjXUzGsg5UDURjJeQrJ8hLk+fcEHmxXblXKYrZ Yd2WExZY4G52kAHI0rvYBfOBjHuglXXjVLU9cWc8W5hh46Gb/GU0TIP0vpFjFjdzMyug jcRw== X-Gm-Message-State: AOAM5318PX0j/cALNCcleIiKdZqaxn8DoPCkr/sM7B2i/yqfjOUFhB5c HV60tTTVLcjEerSWQDDISGm3AQ== X-Google-Smtp-Source: ABdhPJwn48xORd89V96fCgRcbsToGq9UvuFENEh1Ohefp6oFdR5u9vUQcMo62rkVfs9uvfevJCW9yA== X-Received: by 2002:a2e:9b13:: with SMTP id u19mr4265647lji.41.1632985729947; Thu, 30 Sep 2021 00:08:49 -0700 (PDT) Received: from localhost (109-252-140-132.dynamic.spd-mgts.ru. [109.252.140.132]) by smtp.gmail.com with ESMTPSA id k26sm267316lfj.69.2021.09.30.00.08.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Sep 2021 00:08:49 -0700 (PDT) From: Andrew Tropin To: Xinglu Chen , 50873@debbugs.gnu.org Subject: Re: [bug#50873] [PATCH 5/5] doc: Document the =?utf-8?Q?=E2=80=98?= =?utf-8?Q?guix?= home =?utf-8?Q?import=E2=80=99?= subcommand. In-Reply-To: References: Date: Thu, 30 Sep 2021 10:08:45 +0300 Message-ID: <87h7e2o802.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: 50873 Cc: Ludovic =?utf-8?Q?Court=C3=A8s?= 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-28 19:36, Xinglu Chen wrote: > * doc/guix.texi (Invoking guix home): Document =E2=80=98guix home import= =E2=80=99. > --- > doc/guix.texi | 33 +++++++++++++++++++++++++++++++++ > 1 file changed, 33 insertions(+) > > diff --git a/doc/guix.texi b/doc/guix.texi > index 7956652050..2c268705d0 100644 > --- a/doc/guix.texi > +++ b/doc/guix.texi > @@ -36088,6 +36088,39 @@ > $ guix home list-generations 10d > @end example >=20=20 > +@item import > +Generate a @dfn{home environment} from the packages in the default > +profile and configuration files found in the user's home directory. The > +configuration files will be copied to the specified directory. Note > +that not every home service that exists is supported (@pxref{Home > +Services}). > + > +@example > +$ guix home import ~/guix-config > +;; 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 al= so > +;; need to capture the channels being used, as returned by "guix describ= e". > +;; See the "Replicating Guix" section in the manual. > + > +(use-modules > + (gnu home) > + (gnu packages) > + (gnu home-services bash)) > + > +(home-environment > + (packages > + (map specification->package > + (list "glibc-locales" "nss-certs" "nss"))) > + (services > + (list (service > + home-bash-service-type > + (home-bash-configuration > + (bashrc > + (list (slurp-file-gexp It still uses slurp-file-gexp, which is not upstreamed, but overall looks ok. I'll make a rationale behind this function and the approach I picked in home services config serializers and will prepare some examples next week. Maybe it will convince Ludovic or maybe I'll change my mind and rework configuration records for home services to use file-like objects. > + (local-file "/home/alice/guix-config/.bashrc")))= )))))) > +@end example > + > @end table >=20=20 > @node Documentation --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmFVYn0ACgkQIgjSCVjB 3rAXpw//Xy3kH7/bzCT5yRf1wKEsHX7Bs1eN0S51kkZY5fYQy9oqa9GwmQe0bMX7 xu3UMJhRt8ndFjLPtUIArVeSBhHFOi8uPpfBJPZzJQh1lp2XXxNx+ldp1VKHCuzO E/AxP21BJLKYZ3x+C2gO33nD/EhAg2d2NvRmC7sYG81EloDmOrgoVgfnp9REtbP/ hsK0S4H+XFNIbHYQ/Llt554Oz43crism4S277KqiDuRlcxAfApGCPO5/2iGLFGQt tEYtrDTEcVQtWqvAcA4I1y0wegxgUYkpTXa1Y54taMnQK3xfwm189XBpnQa0nBGJ +GcLIxVtcW6O28fB3Ocp5nqlptaQyEhB4frVJCPG+JQjSiRXvfyLuz7Lj3dXIS/r 5RjWBszzNIykzHvpnw2cpLughK0/yk9vnOcDpGnJOmLYdXCRPJ9hylSCXsuJPdzM t7CtI+galfI2N8fP5sNj08sazzVEqRS+l5uQyOiHVLKQY2Ez8yXnWJ9Scpzr275z SPNsN2NOtC6xrClauouRhPFFLNPsNv/WpGMZD8CyYHEjXogTrePGm8RJG50moFKQ u1HRIs/TKZ7OAYheJKXLuaUpuA3kBVXGZeARgoQpkDS/sq/V9TaB9Mq/MwXe1Bnp wa1O/87WQw9KPUFgpSPyAdk1aAzZt6cmxtwVzlnWRuFsm8bwdQw= =CSlo -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 01 01:09:03 2021 Received: (at 50873) by debbugs.gnu.org; 1 Oct 2021 05:09:03 +0000 Received: from localhost ([127.0.0.1]:54438 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mWAn9-0001D3-Dq for submit@debbugs.gnu.org; Fri, 01 Oct 2021 01:09:03 -0400 Received: from h87-96-130-155.cust.a3fiber.se ([87.96.130.155]:48588 helo=mail.yoctocell.xyz) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mWAn5-0001CX-K7 for 50873@debbugs.gnu.org; Fri, 01 Oct 2021 01:09:02 -0400 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yoctocell.xyz; s=mail; t=1633064933; bh=eH4F0jMKF9nIC8rYtjCfyO8KQvw+md2tDMd2l3v+dXg=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=pgBM0xnDu60lXdndpbe1Nck8sQqlo9pvFx5uy5scKKEwnEFTiYfedozILFqbCCjFz tJcm1HlIxg3I1K55xukmRezIBgmVwjyJCRNDRAszou1yCISFezx6xPaR++zkRmAG7J 3A36jQ3YraUoVBuRoX2vcYOIjt87s0LhL2bzedSs= To: Andrew Tropin , 50873@debbugs.gnu.org Subject: Re: [bug#50873] [PATCH 5/5] doc: Document the =?utf-8?Q?=E2=80=98?= =?utf-8?Q?guix?= home =?utf-8?Q?import=E2=80=99?= subcommand. In-Reply-To: <87h7e2o802.fsf@trop.in> References: <87h7e2o802.fsf@trop.in> Date: Fri, 01 Oct 2021 07:08:21 +0200 Message-ID: <87y27dl4ca.fsf@yoctocell.xyz> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Spam-Score: 2.9 (++) 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 Thu, Sep 30 2021, Andrew Tropin wrote: > On 2021-09-28 19:36, Xinglu Chen wrote: > >> * doc/guix.texi (Invoking guix home): Document ‘guix home import’. >> --- >> doc/guix.texi | 33 +++++++++++++++++++++++++++++++++ >> 1 file changed, [...] Content analysis details: (2.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches 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.5 FROM_SUSPICIOUS_NTLD From abused NTLD 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS 0.0 PDS_RDNS_DYNAMIC_FP RDNS_DYNAMIC with FP steps X-Debbugs-Envelope-To: 50873 Cc: Ludovic =?utf-8?Q?Court=C3=A8s?= 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: 2.9 (++) 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 Thu, Sep 30 2021, Andrew Tropin wrote: > On 2021-09-28 19:36, Xinglu Chen wrote: > >> * doc/guix.texi (Invoking guix home): Document ‘guix home import’. >> --- >> doc/guix.texi | 33 +++++++++++++++++++++++++++++++++ >> 1 file changed, [...] Content analysis details: (2.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches 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.5 FROM_SUSPICIOUS_NTLD From abused NTLD 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS 1.0 BULK_RE_SUSP_NTLD Precedence bulk and RE: from a suspicious TLD -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager 0.0 PDS_RDNS_DYNAMIC_FP RDNS_DYNAMIC with FP steps --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Thu, Sep 30 2021, Andrew Tropin wrote: > On 2021-09-28 19:36, Xinglu Chen wrote: > >> * doc/guix.texi (Invoking guix home): Document =E2=80=98guix home import= =E2=80=99. >> --- >> doc/guix.texi | 33 +++++++++++++++++++++++++++++++++ >> 1 file changed, 33 insertions(+) >> >> diff --git a/doc/guix.texi b/doc/guix.texi >> index 7956652050..2c268705d0 100644 >> --- a/doc/guix.texi >> +++ b/doc/guix.texi >> @@ -36088,6 +36088,39 @@ >> $ guix home list-generations 10d >> @end example >>=20=20 >> +@item import >> +Generate a @dfn{home environment} from the packages in the default >> +profile and configuration files found in the user's home directory. The >> +configuration files will be copied to the specified directory. Note >> +that not every home service that exists is supported (@pxref{Home >> +Services}). >> + >> +@example >> +$ guix home import ~/guix-config >> +;; This "home-environment" file can be passed to 'guix home reconfigure' >> +;; to reproduce the content of your profile. This is "symbolic": it on= ly >> +;; specifies package names. To reproduce the exact same profile, you a= lso >> +;; need to capture the channels being used, as returned by "guix descri= be". >> +;; See the "Replicating Guix" section in the manual. >> + >> +(use-modules >> + (gnu home) >> + (gnu packages) >> + (gnu home-services bash)) >> + >> +(home-environment >> + (packages >> + (map specification->package >> + (list "glibc-locales" "nss-certs" "nss"))) >> + (services >> + (list (service >> + home-bash-service-type >> + (home-bash-configuration >> + (bashrc >> + (list (slurp-file-gexp > > It still uses slurp-file-gexp, which is not upstreamed, but overall > looks ok. Oh, I thought it was already upstreamed, my bad. > I'll make a rationale behind this function and the approach I picked in > home services config serializers and will prepare some examples next > week. Maybe it will convince Ludovic or maybe I'll change my mind and > rework configuration records for home services to use file-like > objects. OK, then we should probably wait for this =E2=80=98slurp-file-gexp=E2=80=99= discussion to reach an consensus, then I can send a v2 for this series. :-) --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJJBAEBCAAzFiEEAVhh4yyK5+SEykIzrPUJmaL7XHkFAmFWl8YVHHB1YmxpY0B5 b2N0b2NlbGwueHl6AAoJEKz1CZmi+1x5TlkQAKM1l2hFEfwGDQXUHT1E7raJE0pZ lLHO/q6OcJ4JlHJL9/Bq8QN9mJwSqVTI7T4d3oyPI9v+//20/vlZi3qoFL835/iO S7BWLUE9Il5HF4IE61dsgpA/e96+xEL9Lm5UkG5kdgT2RZc4hP5ePgbZ7Yve1vYi zFXZqSsmvxyrqT+nHy1dOgitHee9l2tYTHHoShLuZQ9bT3xKHFjDEmtR298jbqts JQ52fPP/BDHekY4kcMj3Y4ynKr5pql6hPlwHkyZDZfkuLoAznt9S21zDexGkAzFu Igq+yM0pdgmfHjEkuZKgDEIBjaqgVN5rJR9V/Y0heoKXM0Au3VW9pzDNv5MkVePZ anUz3fJOuyC9sFHslJCjscFDnBR6KfG/jho7rOhPTZlu9+le6QGfR8rId4f3ha5d rA8GewJwwXw4cpTaeyJfORhCa8aujjd5YcE+XJTcpfQSCJ6UZWVi4qFD07UYzGr7 ANdj1gccYVZk33rWN3K3cW1CcTTMK0gOSXK5Asc659FGtyojxRDD4Fzp2qMXSjSh uYLzwwjmP9nLRNVt7KSxPZdT03SeHigYVQY2XvjFtP29B/sTVtVAKOE6mlo7EPCa m3Rg1jVXY+caTO81EU1dtbMHYRJET/z9l9NCNvnFiWhbZlL1Yilsl2YYd+E2QTiN r3+13qyXQ5KU4B55 =cHO7 -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 02 11:10:28 2021 Received: (at 50873) by debbugs.gnu.org; 2 Oct 2021 15:10:28 +0000 Received: from localhost ([127.0.0.1]:60265 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mWgeh-0005q8-O7 for submit@debbugs.gnu.org; Sat, 02 Oct 2021 11:10:27 -0400 Received: from eggs.gnu.org ([209.51.188.92]:48870) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mWgef-0005pn-Lq for 50873@debbugs.gnu.org; Sat, 02 Oct 2021 11:10:26 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:54876) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mWgea-00046c-4L; Sat, 02 Oct 2021 11:10:20 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=36492 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWgeT-00008u-DI; Sat, 02 Oct 2021 11:10:19 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Xinglu Chen Subject: Re: bug#50873: [PATCH 0/5] Fixes to =?utf-8?Q?=E2=80=98guix?= home =?utf-8?Q?import=E2=80=99?= References: <87h7e2o802.fsf@trop.in> <87y27dl4ca.fsf@yoctocell.xyz> Date: Sat, 02 Oct 2021 17:10:11 +0200 In-Reply-To: <87y27dl4ca.fsf@yoctocell.xyz> (Xinglu Chen's message of "Fri, 01 Oct 2021 07:08:21 +0200") Message-ID: <87k0ivwjho.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.3 (/) X-Debbugs-Envelope-To: 50873 Cc: 50873@debbugs.gnu.org, Andrew Tropin 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.3 (-) Hi, Xinglu Chen skribis: > On Thu, Sep 30 2021, Andrew Tropin wrote: [...] >> It still uses slurp-file-gexp, which is not upstreamed, but overall >> looks ok. > > Oh, I thought it was already upstreamed, my bad. > >> I'll make a rationale behind this function and the approach I picked in >> home services config serializers and will prepare some examples next >> week. Maybe it will convince Ludovic or maybe I'll change my mind and >> rework configuration records for home services to use file-like >> objects. > > OK, then we should probably wait for this =E2=80=98slurp-file-gexp=E2=80= =99 discussion > to reach an consensus, then I can send a v2 for this series. :-) Yes, but I don=E2=80=99t expect to change my mind on this one. :-) I=E2=80=99ve explained my views before, and really, it=E2=80=99s no differe= nt than the situation of Guix System services so I see no reason to do things differently. Apart from this bit, the documentation part LGTM. Thank you, Xinglu! Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 02 11:13:15 2021 Received: (at 50873) by debbugs.gnu.org; 2 Oct 2021 15:13:15 +0000 Received: from localhost ([127.0.0.1]:60270 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mWghP-0005uJ-6q for submit@debbugs.gnu.org; Sat, 02 Oct 2021 11:13:15 -0400 Received: from eggs.gnu.org ([209.51.188.92]:49148) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mWghN-0005u7-2L for 50873@debbugs.gnu.org; Sat, 02 Oct 2021 11:13:13 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:54970) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mWghH-0006TN-Be; Sat, 02 Oct 2021 11:13:07 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=36494 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWghH-0000bo-2Q; Sat, 02 Oct 2021 11:13:07 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Xinglu Chen Subject: Re: bug#50873: [PATCH 0/5] Fixes to =?utf-8?Q?=E2=80=98guix?= home =?utf-8?Q?import=E2=80=99?= References: Date: Sat, 02 Oct 2021 17:13:05 +0200 In-Reply-To: (Xinglu Chen's message of "Tue, 28 Sep 2021 19:33:09 +0200") Message-ID: <87czonwjcu.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.3 (/) X-Debbugs-Envelope-To: 50873 Cc: 50873@debbugs.gnu.org, Andrew Tropin 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.3 (-) Xinglu Chen skribis: > This series makes some fixes to the =E2=80=98guix home import=E2=80=99 su= bcommand which > brings it into a usable state. > > The last patch documents the subcommand in the manual. > > As a sidenote, the =E2=80=98manifest->code=E2=80=99 procedure in (guix sc= ripts home > import), which is based on =E2=80=98manifest->code=E2=80=99 from (guix pr= ofiles) should > probably be factorized with the original =E2=80=98manifest->code=E2=80=99= procedure. > > Xinglu Chen (5): > guix home: import: Make the user to specify a destination directory. > guix home: import: Allow multiple modules to be imported for each > service. > guix home: import: Fix module name for Bash service. > guix home: import: Delete duplicate modules when importing. > doc: Document the =E2=80=98guix home import=E2=80=99 subcommand. Could you (Xinglu, Andrew, Oleg?) add tests for this? I think Scheme-level tests like we have for the =E2=80=98guix import=E2=80=99 code = would be fine. It would also help review because it=E2=80=99d give a clearer view o= f how this is supposed to work. Thanks for following up on this! Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 02 14:46:07 2021 Received: (at 50873) by debbugs.gnu.org; 2 Oct 2021 18:46:07 +0000 Received: from localhost ([127.0.0.1]:60570 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mWk1P-0007b5-2I for submit@debbugs.gnu.org; Sat, 02 Oct 2021 14:46:07 -0400 Received: from h87-96-130-155.cust.a3fiber.se ([87.96.130.155]:41038 helo=mail.yoctocell.xyz) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mWk1N-0007aL-9t for 50873@debbugs.gnu.org; Sat, 02 Oct 2021 14:46:05 -0400 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yoctocell.xyz; s=mail; t=1633200359; bh=sncnf5Bxf7IZDpapTGpcbB9lpiwjV5Omc06BXOeXLAU=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=B4BSkfVzsE7p+U8UgdpVa8ZjQcJIXC/BAUSr75T6jDDugcL41ZDBb91pFXj509Vwa UiEYhIhWD4LFNGcARVpf2pKfK/U2UzGAhVZK2pb1Vklo88LNdKqZDNg3tTmkJD0+9g /00+fUcCp/GgFuGVhATONROCt0zJHRtk5tTuHjiQ= To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: [bug#50873] [PATCH 0/5] Fixes to =?utf-8?Q?=E2=80=98guix?= home =?utf-8?Q?import=E2=80=99?= In-Reply-To: <87czonwjcu.fsf@gnu.org> References: <87czonwjcu.fsf@gnu.org> Date: Sat, 02 Oct 2021 20:45:56 +0200 Message-ID: <877devnu3f.fsf@yoctocell.xyz> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Spam-Score: 2.9 (++) 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 Sat, Oct 02 2021, Ludovic Courtès wrote: > Xinglu Chen skribis: > >> This series makes some fixes to the ‘guix home import’ subcommand which >> brings it into a usable state. >> >> The last patch documents the subc [...] Content analysis details: (2.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches 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.5 FROM_SUSPICIOUS_NTLD From abused NTLD 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS 0.0 PDS_RDNS_DYNAMIC_FP RDNS_DYNAMIC with FP steps X-Debbugs-Envelope-To: 50873 Cc: 50873@debbugs.gnu.org, Andrew Tropin 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: 2.9 (++) 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 Sat, Oct 02 2021, Ludovic Courtès wrote: > Xinglu Chen skribis: > >> This series makes some fixes to the ‘guix home import’ subcommand which >> brings it into a usable state. >> >> The last patch documents the subc [...] Content analysis details: (2.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches 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.5 FROM_SUSPICIOUS_NTLD From abused NTLD 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS 1.0 BULK_RE_SUSP_NTLD Precedence bulk and RE: from a suspicious TLD -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager 0.0 PDS_RDNS_DYNAMIC_FP RDNS_DYNAMIC with FP steps --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Sat, Oct 02 2021, Ludovic Court=C3=A8s wrote: > Xinglu Chen skribis: > >> This series makes some fixes to the =E2=80=98guix home import=E2=80=99 s= ubcommand which >> brings it into a usable state. >> >> The last patch documents the subcommand in the manual. >> >> As a sidenote, the =E2=80=98manifest->code=E2=80=99 procedure in (guix s= cripts home >> import), which is based on =E2=80=98manifest->code=E2=80=99 from (guix p= rofiles) should >> probably be factorized with the original =E2=80=98manifest->code=E2=80= =99 procedure. >> >> Xinglu Chen (5): >> guix home: import: Make the user to specify a destination directory. >> guix home: import: Allow multiple modules to be imported for each >> service. >> guix home: import: Fix module name for Bash service. >> guix home: import: Delete duplicate modules when importing. >> doc: Document the =E2=80=98guix home import=E2=80=99 subcommand. > > Could you (Xinglu, Andrew, Oleg?) add tests for this? I think > Scheme-level tests like we have for the =E2=80=98guix import=E2=80=99 cod= e would be > fine. It would also help review because it=E2=80=99d give a clearer view= of how > this is supposed to work. Sure! > Thanks for following up on this! You are welcome! :-) --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJJBAEBCAAzFiEEAVhh4yyK5+SEykIzrPUJmaL7XHkFAmFYqOQVHHB1YmxpY0B5 b2N0b2NlbGwueHl6AAoJEKz1CZmi+1x5p78P/i/mDTCjhgXA7uK9D19DUsnro4lv aUyjeP31y40iyToxOu4zGKasxTk/Lhpj6tJwNpCtiY7pmfOU5KX8e4Q+/x8IhE8U 5WGbf7c04W6th2uPbrYh83qJNQPhBobODpqOpQVsAUDB8D4GZkPfcNZ1g9wMPxpY X8idU4+RYyNNV5dhda3Q48JaIulOo5x93eel1yNF6jeNdV1V0XiWVuwRzZTpfEf4 +gKPSuiAUu6nykFWApdmAu9Lktz5tc/o/6MqVAbbh+FjBgSI5dMO8rt4+Ra2V8Da hdzeNTNLOOzhd8qnrVNX08f+SWE5Tuc+Ey8TPoBEwqVZTEkY2hQGq3ggvHC/aumt pwFbo8P9HozjsG2eOfOQ6t+WcYBaWHjnaWWIYal0zOhXVMlorsOAa6qHKXQ5CnJn zA6+9VkoFou3T9tZXblOS/lrV+q75Mpu5tw/1V0SyTfYuesrD4/+kX46vTYJ/QZY d8j2MS97HUUno9A2PbMwPol477j3B0swEIHAjTEUBMMAatj0f+1jZFzmiRxWyjGy imulEi1xMiAVjJ0WbD1tMtchdbvqikuFlQhsOvyXxXvvcPVSSDAsQrbylRwQRLqA RWbNlgSKyivwVtlscLAedmZlH0njsnt/WaGs0uAofelwuk0O3L7wUExoJ17e8iv/ MTvF9ugAe+RGwAXK =CSLN -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 10 06:20:18 2021 Received: (at 50873) by debbugs.gnu.org; 10 Oct 2021 10:20:18 +0000 Received: from localhost ([127.0.0.1]:54488 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mZVwI-0003MA-0t for submit@debbugs.gnu.org; Sun, 10 Oct 2021 06:20:18 -0400 Received: from h87-96-130-155.cust.a3fiber.se ([87.96.130.155]:39692 helo=mail.yoctocell.xyz) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mZVwE-0003Li-0g for 50873@debbugs.gnu.org; Sun, 10 Oct 2021 06:20:16 -0400 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yoctocell.xyz; s=mail; t=1633861207; bh=w7K/Gbi1fZnKgOvf5mBaPX6IXr4E+vxggentIVr5vhY=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=ohpKWzPzlFSl81n1ogstBzp+c+98ST7Yk/PQvXLAZ6WkXhAoS2NlgJQUZjarOsYlw J9LODXZpb+Q/YjKuAXxgjU5RFqIMIQWe7JvJ/WQy/WkyZuriKJJCiQuXCo7QPtp0aD oc1L1/XfmBTboeYAJhgT9q74WgkuzkO3h2WMj4tQ= To: 50873@debbugs.gnu.org Subject: [PATCH 0/7] Fixes to =?utf-8?Q?=E2=80=98guix?= home =?utf-8?Q?imp?= =?utf-8?Q?ort=E2=80=99?= In-Reply-To: References: Message-Id: Date: Sun, 10 Oct 2021 12:19:57 +0200 MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Spam-Score: 2.9 (++) 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: Change since v1: * Remove uses of ‘slurp-file-gexp’. * Add tests for the Scheme API of (guix scripts home import). Content analysis details: (2.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches 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.5 FROM_SUSPICIOUS_NTLD From abused NTLD 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS 0.0 PDS_RDNS_DYNAMIC_FP RDNS_DYNAMIC with FP steps X-Debbugs-Envelope-To: 50873 Cc: Oleg Pykhalov , Ludovic =?utf-8?Q?Court=C3=A8s?= , Andrew Tropin 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.9 (+) 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: Change since v1: * Remove uses of ‘slurp-file-gexp’. * Add tests for the Scheme API of (guix scripts home import). Content analysis details: (1.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches 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.5 FROM_SUSPICIOUS_NTLD From abused NTLD 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager 0.0 PDS_RDNS_DYNAMIC_FP RDNS_DYNAMIC with FP steps --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Change since v1: * Remove uses of =E2=80=98slurp-file-gexp=E2=80=99. * Add tests for the Scheme API of (guix scripts home import). Xinglu Chen (7): guix home: import: Make the user to specify a destination directory. guix home: import: Allow multiple modules to be imported for each service. guix home: import: Fix module name for Bash service. guix home: import: Don=E2=80=99t use 'slurp-file-gexp'. guix home: import: Delete duplicate modules when importing. doc: Document the =E2=80=98guix home import=E2=80=99 subcommand. Add tests for =E2=80=98guix home import=E2=80=99. Makefile.am | 1 + doc/guix.texi | 32 +++++++ guix/scripts/home.scm | 25 +++-- guix/scripts/home/import.scm | 115 +++++++++++++---------- tests/home-import.scm | 174 +++++++++++++++++++++++++++++++++++ 5 files changed, 289 insertions(+), 58 deletions(-) create mode 100644 tests/home-import.scm base-commit: edbcbdabac9a64dba3850b0f7e596b396f044599 =2D-=20 2.33.0 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJJBAEBCAAzFiEEAVhh4yyK5+SEykIzrPUJmaL7XHkFAmFivk0VHHB1YmxpY0B5 b2N0b2NlbGwueHl6AAoJEKz1CZmi+1x5vSgP/2767jQ3mUl57HqAX7NFWSqSk96H vzd6BnavuQguchT5q2Fh5LJPlhTUhZlspY+qqv7fbTo7g2llpC7GfzVYVB5a2CT9 qN3XcTL+pGRH/YA0vXg6/aOnVXNADxjg9GIQvKtPBLieH6n3JWHeHYJuu+YGVghn iF1991tibtEsQnDQvgKJ158OVhpOXVQCyHy51O5qag7lgNQUrCtTcoIqbpHVc8Zr kVLliT2iblbFICUn8GjVLq8QGV4n++Y8TJAsarWhMu0PkpR2mZc9y20K4nxwBKWi ZQB81O7ULxxcrnESAM74+JgEhTcmJci4yLxzFePo9RSoeb+FLq7d4oNA002YZMC1 eHd9nwP2UvuePQtfmB7vppupinoIMP3aDw7pC9sN9JriODGv8h4fDfuBcux3qTNC jvzIwxYxOjmBaf3/7b2sI4Thmo5aNxfERqMrRupgFaRzquXr4oHbpjaeMNjHNa15 0jPJ4f+mUE9yEiwZokQFtcG6CYkQea9W1FaTgGZhtOIFvn2j13O2cLRQszr+7kix jdxjMJ61dkd1Gbc6NxrS36aVXmqf1hpihvqdqyoCKJoUNkPiHoBH9xa92zRN8+O4 kRnX00o5XKwK4cUUuPni++68Yr6NFOVdNgyr6diV3b3/iAtfjU+hzV7OutWlotYm chsUgfR65Ys38N1a =g6ar -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 10 06:20:19 2021 Received: (at 50873) by debbugs.gnu.org; 10 Oct 2021 10:20:19 +0000 Received: from localhost ([127.0.0.1]:54490 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mZVwJ-0003MJ-7R for submit@debbugs.gnu.org; Sun, 10 Oct 2021 06:20:19 -0400 Received: from h87-96-130-155.cust.a3fiber.se ([87.96.130.155]:39716 helo=mail.yoctocell.xyz) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mZVwG-0003Lt-Vo for 50873@debbugs.gnu.org; Sun, 10 Oct 2021 06:20:17 -0400 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yoctocell.xyz; s=mail; t=1633861211; bh=GjCDFBVPzoLpomEwylpSfTEdA589GFIwlMJCLptPUyo=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=VgYbwohlQkJZE7h1HrQrGwiOAsFdvYiQq/EcAV9we8BMRNHmS9o5tQVoSZ6ELA5Ds jdM9ZRHTWR7Z8+eaI1BJ2tej3iPnVgZtnKtI9RVkLCdTM7+oSKBCwwiTCdIUKMp5jU znIYvy/GFCqsHf5RJ9CedidWYw9u7sC+oT/RWkys= To: 50873@debbugs.gnu.org Subject: [PATCH 1/7] guix home: import: Make the user to specify a destination directory. In-Reply-To: References: Message-Id: <9db0424f9494d3d15e534eb75773ae9bd3f33cb3.1633861021.git.public@yoctocell.xyz> Date: Sun, 10 Oct 2021 12:20:11 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 2.9 (++) 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: Copy the appropriate the relevant configuration files to the destination directory, and call ‘local-file’ on them. Without this, ‘guix home import’ will generate a service declaration like this Content analysis details: (2.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches 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.5 FROM_SUSPICIOUS_NTLD From abused NTLD 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS 0.0 PDS_RDNS_DYNAMIC_FP RDNS_DYNAMIC with FP steps X-Debbugs-Envelope-To: 50873 Cc: Oleg Pykhalov , Ludovic =?utf-8?Q?Court=C3=A8s?= , Andrew Tropin 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.9 (+) 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: Copy the appropriate the relevant configuration files to the destination directory, and call ‘local-file’ on them. Without this, ‘guix home import’ will generate a service declaration like this Content analysis details: (1.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches 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.5 FROM_SUSPICIOUS_NTLD From abused NTLD 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager 0.0 PDS_RDNS_DYNAMIC_FP RDNS_DYNAMIC with FP steps Copy the appropriate the relevant configuration files to the destination directory, and call =E2=80=98local-file=E2=80=99 on them. Without this, =E2=80=98guix home import=E2=80=99 will generate a service de= claration like this (service home-bash-service-type (home-bash-configuration (bashrc (list (slurp-file-gexp (local-file "/home/yoctocell/.bashrc")))))) but when running =E2=80=98guix home reconfigure=E2=80=99, the ~/.bashrc fil= e would be moved, so when running =E2=80=98guix home reconfigure=E2=80=99 for the second time, i= t would read the ~/.bashrc which is itself a symlink to a file the store. * guix/scripts/home/import.scm (%destination-directory): New parameter. (generate-bash-module+configuration): Adjust accordingly. (modules+configurations): Copy the user=E2=80=99s configuration file to =E2=80=98%destination-directory=E2=80=99. * guix/scripts/home.scm (process-command): Adjust accordingly; create =E2=80=98%destination-directory=E2=80=99 if it doesn=E2=80=99t exist. --- guix/scripts/home.scm | 25 +++++++----- guix/scripts/home/import.scm | 75 +++++++++++++++++++++--------------- 2 files changed, 61 insertions(+), 39 deletions(-) diff --git a/guix/scripts/home.scm b/guix/scripts/home.scm index 55e7b436c1..520360e14a 100644 --- a/guix/scripts/home.scm +++ b/guix/scripts/home.scm @@ -40,6 +40,7 @@ (define-module (guix scripts home) #:autoload (guix scripts pull) (channel-commit-hyperlink) #:use-module (guix scripts home import) #:use-module ((guix status) #:select (with-status-verbosity)) + #:use-module ((guix build utils) #:select (mkdir-p)) #:use-module (guix gexp) #:use-module (guix monads) #:use-module (srfi srfi-1) @@ -260,15 +261,21 @@ (define-syntax-rule (with-store* store exp ...) (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)))) + (match (filter-map (match-lambda + (('profile . p) p) + (_ #f)) + opts) + (() (list %current-profile)) + (lst (reverse lst))))) + (manifest (concatenate-manifests + (map profile-manifest profiles))) + (destination (match args + ((destination) destination) + (_ (leave (G_ "wrong number of arguments~%"))))= )) + (unless (file-exists? destination) + (mkdir-p destination)) + (parameterize ((%destination-directory destination)) + (import-manifest manifest (current-output-port))))) ((describe) (match (generation-number %guix-home) (0 diff --git a/guix/scripts/home/import.scm b/guix/scripts/home/import.scm index 611f580e85..a6ab68a32c 100644 --- a/guix/scripts/home/import.scm +++ b/guix/scripts/home/import.scm @@ -27,7 +27,8 @@ (define-module (guix scripts home import) #:use-module (ice-9 pretty-print) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) - #:export (import-manifest)) + #:export (import-manifest + %destination-directory)) =20 ;;; Commentary: ;;; @@ -36,27 +37,34 @@ (define-module (guix scripts home import) ;;; ;;; Code: =20 +(define %destination-directory + (make-parameter (string-append (getenv "HOME") "/src/guix-config"))) =20 (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 (local-file ,rc)))) - '()) - ,@(if (file-exists? profile) - `((bash-profile - (list (local-file ,profile)))) - '()) - ,@(if (file-exists? logout) - `((bash-logout - (list (local-file ,logout)))) - '())))))) + (define (destination-append path) + (string-append (%destination-directory) "/" path)) =20 + (let ((rc (destination-append ".bashrc")) + (profile (destination-append ".bash_profile")) + (logout (destination-append ".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))))) + '())))))) =20 (define %files-configurations-alist `((".bashrc" . ,generate-bash-module+configuration) @@ -64,17 +72,24 @@ (define %files-configurations-alist (".bash_logout" . ,generate-bash-module+configuration))) =20 (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))) + (define configurations + (delete-duplicates + (filter-map (match-lambda + ((file . proc) + (let ((absolute-path (string-append (getenv "HOME") + "/" file))) + (if (file-exists? absolute-path) + (begin + (copy-file absolute-path + (string-append + (%destination-directory) "/" file)) + proc) + #f)))) + %files-configurations-alist) + (lambda (x y) + (equal? (procedure-name x) (procedure-name y))))) +=20=20 + (map (lambda (proc) (proc)) configurations)) =20 ;; Based on `manifest->code' from (guix profiles) ;; MAYBE: Upstream it? --=20 2.33.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 10 06:20:22 2021 Received: (at 50873) by debbugs.gnu.org; 10 Oct 2021 10:20:22 +0000 Received: from localhost ([127.0.0.1]:54493 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mZVwL-0003MY-KL for submit@debbugs.gnu.org; Sun, 10 Oct 2021 06:20:21 -0400 Received: from h87-96-130-155.cust.a3fiber.se ([87.96.130.155]:39738 helo=mail.yoctocell.xyz) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mZVwK-0003Lx-0k for 50873@debbugs.gnu.org; Sun, 10 Oct 2021 06:20:20 -0400 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yoctocell.xyz; s=mail; t=1633861214; bh=RylSVc8nuJeWHmXsVlgB+ho4C05ujXWj1OBhUFCaHpA=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=tv7o25WklXQrkSxdiI3OMYWkNnpPT7Wk7mXH0f2SlAC8lseooipjPX9+u+incRQpY HM0gd055AsJlwh/FZ8vNw2V0mXWyCxp2K2MzEVX4AebA21wqYqqLz3kUZeRQs8AH/t td9zgtiePO4xYmrpoQYSFk1HdPaWPF1Yx+o3FkeU= To: 50873@debbugs.gnu.org Subject: [PATCH 2/7] guix home: import: Allow multiple modules to be imported for each service. In-Reply-To: References: Message-Id: Date: Sun, 10 Oct 2021 12:20:14 +0200 MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 2.9 (++) 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: Previously, only one module could be imported for each service, e.g., only (gnu home-services shell) could be imported when generating the Bash service declaration. However, for some services, multipl [...] Content analysis details: (2.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches 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.5 FROM_SUSPICIOUS_NTLD From abused NTLD 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS 0.0 PDS_RDNS_DYNAMIC_FP RDNS_DYNAMIC with FP steps X-Debbugs-Envelope-To: 50873 Cc: Oleg Pykhalov , Ludovic =?utf-8?Q?Court=C3=A8s?= , Andrew Tropin 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.9 (+) 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: Previously, only one module could be imported for each service, e.g., only (gnu home-services shell) could be imported when generating the Bash service declaration. However, for some services, multipl [...] Content analysis details: (1.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches 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.5 FROM_SUSPICIOUS_NTLD From abused NTLD 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager 0.0 PDS_RDNS_DYNAMIC_FP RDNS_DYNAMIC with FP steps Previously, only one module could be imported for each service, e.g., only (gnu home-services shell) could be imported when generating the Bash service declaration. However, for some services, multiple modules might need to be imported in order for it to work. * guix/scripts/home/import.scm (generate-bash-module+configuration): Rename to ... (generate-bash-configuration+modules): ... this. (%files-configurations-alist): Rename to ... (%files+configurations-alist): ... this. (modules+configurations): Rename to ... (configurations+modules): ... this. (manifest->code): Adjust accordingly. --- guix/scripts/home/import.scm | 43 ++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/guix/scripts/home/import.scm b/guix/scripts/home/import.scm index a6ab68a32c..ad926fa202 100644 --- a/guix/scripts/home/import.scm +++ b/guix/scripts/home/import.scm @@ -40,15 +40,14 @@ (define-module (guix scripts home import) (define %destination-directory (make-parameter (string-append (getenv "HOME") "/src/guix-config"))) -(define (generate-bash-module+configuration) +(define (generate-bash-configuration+modules) (define (destination-append path) (string-append (%destination-directory) "/" path)) (let ((rc (destination-append ".bashrc")) (profile (destination-append ".bash_profile")) (logout (destination-append ".bash_logout"))) - `((gnu home-services bash) - (service home-bash-service-type + `((service home-bash-service-type (home-bash-configuration ,@(if (file-exists? rc) `((bashrc @@ -64,14 +63,16 @@ (define (destination-append path) `((bash-logout (list (slurp-file-gexp (local-file ,logout))))) - '())))))) + '()))) + (gnu home-services bash)))) -(define %files-configurations-alist - `((".bashrc" . ,generate-bash-module+configuration) - (".bash_profile" . ,generate-bash-module+configuration) - (".bash_logout" . ,generate-bash-module+configuration))) -(define (modules+configurations) +(define %files+configurations-alist + `((".bashrc" . ,generate-bash-configuration+modules) + (".bash_profile" . ,generate-bash-configuration+modules) + (".bash_logout" . ,generate-bash-configuration+modules))) + +(define (configurations+modules) (define configurations (delete-duplicates (filter-map (match-lambda @@ -85,11 +86,11 @@ (define configurations (%destination-directory) "/" file)) proc) #f)))) - %files-configurations-alist) + %files+configurations-alist) (lambda (x y) (equal? (procedure-name x) (procedure-name y))))) - (map (lambda (proc) (proc)) configurations)) + (map (lambda (proc) (proc)) configurations)) ;; Based on `manifest->code' from (guix profiles) ;; MAYBE: Upstream it? @@ -144,14 +145,14 @@ (define (qualified-name entry) ":" output)))) (manifest-entries manifest)))) (if home-environment? - (let ((modules+configurations (modules+configurations))) + (let ((configurations+modules (configurations+modules))) `(begin - (use-modules (gnu home) - (gnu packages) - ,@(map first modules+configurations)) - ,(home-environment-template - #:specs specs - #:services (map second modules+configurations)))) + (use-modules (gnu home) + (gnu packages) + ,@(concatenate (map cdr configurations+modules))) + ,(home-environment-template + #:specs specs + #:services (map first configurations+modules)))) `(begin (use-modules (gnu packages)) @@ -186,18 +187,18 @@ (define name (options->transformation ',options)))) transformation-procedures))) (if home-environment? - (let ((modules+configurations (modules+configurations))) + (let ((configurations+modules (configurations+modules))) `(begin (use-modules (guix transformations) (gnu home) (gnu packages) - ,@(map first modules+configurations)) + ,@(concatenate (map cdr configurations+modules))) ,@transformations ,(home-environment-template #:packages packages - #:services (map second modules+configurations)))) + #:services (map first configurations+modules)))) `(begin (use-modules (guix transformations) (gnu packages)) -- 2.33.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 10 06:20:31 2021 Received: (at 50873) by debbugs.gnu.org; 10 Oct 2021 10:20:31 +0000 Received: from localhost ([127.0.0.1]:54496 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mZVwU-0003Mu-W1 for submit@debbugs.gnu.org; Sun, 10 Oct 2021 06:20:31 -0400 Received: from h87-96-130-155.cust.a3fiber.se ([87.96.130.155]:39774 helo=mail.yoctocell.xyz) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mZVwT-0003Mh-F8 for 50873@debbugs.gnu.org; Sun, 10 Oct 2021 06:20:29 -0400 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yoctocell.xyz; s=mail; t=1633861224; bh=VyMj1DdARgasZZuSnNn/LrFF+TrbhGJtnS5Z4Xmjf0U=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=Z+p6DWJzzN2PpgDPVn+rErtaOEBqFj0u+cHImXgp6LPffYaA8D5noz3WhXFumWcfQ 4hOWMX6KYmi/eOiAD4uzn6oIZ639B52E5Rdw9ZknF6m6PVUMD7uDB5xSgEDPARKh+H w/7o4sKF+NzB6UqpokGwUy2WH/D0ftj/U86BnotQ= To: 50873@debbugs.gnu.org Subject: [PATCH 3/7] guix home: import: Fix module name for Bash service. In-Reply-To: References: Message-Id: <0ecf026f4196f1f3abb10f917e8a566052f70ed6.1633861021.git.public@yoctocell.xyz> Date: Sun, 10 Oct 2021 12:20:23 +0200 MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 2.9 (++) 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 (generate-bash-configuration+modules): Change (gnu home-services bash) to (gnu home-services shells). --- guix/scripts/home/import.scm | 2 +- 1 file changed, 1 insertion [...] Content analysis details: (2.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches 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.5 FROM_SUSPICIOUS_NTLD From abused NTLD 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS 0.0 PDS_RDNS_DYNAMIC_FP RDNS_DYNAMIC with FP steps X-Debbugs-Envelope-To: 50873 Cc: Oleg Pykhalov , Ludovic =?utf-8?Q?Court=C3=A8s?= , Andrew Tropin 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.9 (+) 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 (generate-bash-configuration+modules): Change (gnu home-services bash) to (gnu home-services shells). --- guix/scripts/home/import.scm | 2 +- 1 file changed, 1 insertion [...] Content analysis details: (1.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches 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.5 FROM_SUSPICIOUS_NTLD From abused NTLD 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager 0.0 PDS_RDNS_DYNAMIC_FP RDNS_DYNAMIC with FP steps * guix/scripts/home/import.scm (generate-bash-configuration+modules): Change (gnu home-services bash) to (gnu home-services shells). --- guix/scripts/home/import.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guix/scripts/home/import.scm b/guix/scripts/home/import.scm index ad926fa202..96ed710c2d 100644 --- a/guix/scripts/home/import.scm +++ b/guix/scripts/home/import.scm @@ -64,7 +64,7 @@ (define (destination-append path) (list (slurp-file-gexp (local-file ,logout))))) '()))) - (gnu home-services bash)))) + (gnu home services shells)))) (define %files+configurations-alist -- 2.33.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 10 06:20:37 2021 Received: (at 50873) by debbugs.gnu.org; 10 Oct 2021 10:20:37 +0000 Received: from localhost ([127.0.0.1]:54499 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mZVwb-0003NF-6W for submit@debbugs.gnu.org; Sun, 10 Oct 2021 06:20:37 -0400 Received: from h87-96-130-155.cust.a3fiber.se ([87.96.130.155]:39804 helo=mail.yoctocell.xyz) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mZVwa-0003Mv-91 for 50873@debbugs.gnu.org; Sun, 10 Oct 2021 06:20:36 -0400 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yoctocell.xyz; s=mail; t=1633861230; bh=aQ3MEdOEL7amLbKpRdawZXHaOI8GJ0v6NxyXPJ6ePIE=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=n+dKt0uQGXY8K5cUmN+qGUI6p3pNY4naRSKiCdaV6uEoAf6kKMI7ObIvqTg59Jsk9 fO0o2KX8B+/aaeCv5/1/H+Z56Q43yOHMIcjcaozAE3OElcLT85++95ba27tys5XAo/ LMOtbGtLtW8JVHkvGerc29LVAqbOG+ZlRaXEzjdY= To: 50873@debbugs.gnu.org Subject: [PATCH 4/7] =?UTF-8?q?guix=20home:=20import:=20Don=E2=80=99t=20us?= =?UTF-8?q?e=20'slurp-file-gexp'.?= In-Reply-To: References: Message-Id: Date: Sun, 10 Oct 2021 12:20:30 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 2.9 (++) 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: ‘slurp-file-gexp’ is not a bound procedure. * guix/scripts/home/import.scm (generate-bash-configuration+modules): Don’t use ‘slurp-file-gexp’. --- guix/scripts/home/import.scm | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(- [...] Content analysis details: (2.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches 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.5 FROM_SUSPICIOUS_NTLD From abused NTLD 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS 0.0 PDS_RDNS_DYNAMIC_FP RDNS_DYNAMIC with FP steps X-Debbugs-Envelope-To: 50873 Cc: Oleg Pykhalov , Ludovic =?utf-8?Q?Court=C3=A8s?= , Andrew Tropin 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.9 (+) 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: ‘slurp-file-gexp’ is not a bound procedure. * guix/scripts/home/import.scm (generate-bash-configuration+modules): Don’t use ‘slurp-file-gexp’. --- guix/scripts/home/import.scm | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(- [...] Content analysis details: (1.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches 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.5 FROM_SUSPICIOUS_NTLD From abused NTLD 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager 0.0 PDS_RDNS_DYNAMIC_FP RDNS_DYNAMIC with FP steps =E2=80=98slurp-file-gexp=E2=80=99 is not a bound procedure. * guix/scripts/home/import.scm (generate-bash-configuration+modules): Don= =E2=80=99t use =E2=80=98slurp-file-gexp=E2=80=99. --- guix/scripts/home/import.scm | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/guix/scripts/home/import.scm b/guix/scripts/home/import.scm index 96ed710c2d..21f762f239 100644 --- a/guix/scripts/home/import.scm +++ b/guix/scripts/home/import.scm @@ -51,22 +51,18 @@ (define (destination-append path) (home-bash-configuration ,@(if (file-exists? rc) `((bashrc - (list (slurp-file-gexp - (local-file ,rc))))) + (list (local-file ,rc)))) '()) ,@(if (file-exists? profile) `((bash-profile - (list (slurp-file-gexp - (local-file ,profile))))) + (list (local-file ,profile)))) '()) ,@(if (file-exists? logout) `((bash-logout - (list (slurp-file-gexp - (local-file ,logout))))) + (list (local-file ,logout)))) '()))) (gnu home services shells)))) =20 - (define %files+configurations-alist `((".bashrc" . ,generate-bash-configuration+modules) (".bash_profile" . ,generate-bash-configuration+modules) --=20 2.33.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 10 06:20:40 2021 Received: (at 50873) by debbugs.gnu.org; 10 Oct 2021 10:20:40 +0000 Received: from localhost ([127.0.0.1]:54502 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mZVwe-0003NV-E3 for submit@debbugs.gnu.org; Sun, 10 Oct 2021 06:20:40 -0400 Received: from h87-96-130-155.cust.a3fiber.se ([87.96.130.155]:39824 helo=mail.yoctocell.xyz) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mZVwd-0003N6-8P for 50873@debbugs.gnu.org; Sun, 10 Oct 2021 06:20:39 -0400 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yoctocell.xyz; s=mail; t=1633861233; bh=MrpFKSnBOheEUP1Gsz6KdE+W7u6iL3Oyhb8moemgALU=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=azTt7zoAjbakto9VyYwiG/eimw2nh9nKO6yFnLEL6iLbRJ3gxnbdBt6kNe4z9iiPN SMdvToN0qXCKXXWjh/JHfMSw89AfKeRhZsyYAWUhxLdCio5gc4f3GASoGo/OGAPFSd vH46nGfv/hLPaMPvn7BgFQk8BPVFSEjv2Gf6weIo= To: 50873@debbugs.gnu.org Subject: [PATCH 5/7] guix home: import: Delete duplicate modules when importing. In-Reply-To: References: Message-Id: <2814010aadd95c389a54922958d1f3ffedeec106.1633861021.git.public@yoctocell.xyz> Date: Sun, 10 Oct 2021 12:20:33 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 2.9 (++) 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: Two different services might require the same module(s), so delete duplicates when generating the ‘use-modules’ form. * import.scm (manifest->code): Delete duplicate modules. --- guix/scripts/home/import.scm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) Content analysis details: (2.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches 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.5 FROM_SUSPICIOUS_NTLD From abused NTLD 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS 0.0 PDS_RDNS_DYNAMIC_FP RDNS_DYNAMIC with FP steps X-Debbugs-Envelope-To: 50873 Cc: Oleg Pykhalov , Ludovic =?utf-8?Q?Court=C3=A8s?= , Andrew Tropin 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.9 (+) 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: Two different services might require the same module(s), so delete duplicates when generating the ‘use-modules’ form. * import.scm (manifest->code): Delete duplicate modules. --- guix/scripts/home/import.scm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) Content analysis details: (1.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches 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.5 FROM_SUSPICIOUS_NTLD From abused NTLD 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager 0.0 PDS_RDNS_DYNAMIC_FP RDNS_DYNAMIC with FP steps Two different services might require the same module(s), so delete duplicat= es when generating the =E2=80=98use-modules=E2=80=99 form. * import.scm (manifest->code): Delete duplicate modules. --- guix/scripts/home/import.scm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/guix/scripts/home/import.scm b/guix/scripts/home/import.scm index 21f762f239..b892ae3dfa 100644 --- a/guix/scripts/home/import.scm +++ b/guix/scripts/home/import.scm @@ -145,7 +145,8 @@ (define (qualified-name entry) `(begin (use-modules (gnu home) (gnu packages) - ,@(concatenate (map cdr configurations+modul= es))) + ,@((compose delete-duplicates concatenate) + (map cdr configurations+modules))) ,(home-environment-template #:specs specs #:services (map first configurations+modules)))) @@ -188,7 +189,8 @@ (define name (use-modules (guix transformations) (gnu home) (gnu packages) - ,@(concatenate (map cdr configurations+modul= es))) + ,@((compose delete-duplicates concatenate) + (map cdr configurations+modules))) =20 ,@transformations =20 --=20 2.33.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 10 06:20:46 2021 Received: (at 50873) by debbugs.gnu.org; 10 Oct 2021 10:20:46 +0000 Received: from localhost ([127.0.0.1]:54505 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mZVwk-0003Nn-La for submit@debbugs.gnu.org; Sun, 10 Oct 2021 06:20:46 -0400 Received: from h87-96-130-155.cust.a3fiber.se ([87.96.130.155]:39852 helo=mail.yoctocell.xyz) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mZVwi-0003NP-Nu for 50873@debbugs.gnu.org; Sun, 10 Oct 2021 06:20:45 -0400 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yoctocell.xyz; s=mail; t=1633861239; bh=4HZfDpDQv6G3L+iHcmw74LWqfAhU9l5R7EPesFqqw2E=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=GqUQLCzFhZIMgBLsHeCgCrNyOrSzNpaH3CaLAu8nbCTtJtYYpmNzW7PLyS83i0/ic WNuxIK44M2XIsMLTbmfN+uVOnOkuf6d51IRXiM7keVxPoxVy6fTKmoXQ8A/sjCaA59 0RbC0Xoiy6ftc3V4FUB2zZLA64CzHdAjnOY8866M= To: 50873@debbugs.gnu.org Subject: [PATCH 6/7] =?UTF-8?q?doc:=20Document=20the=20=E2=80=98guix=20hom?= =?UTF-8?q?e=20import=E2=80=99=20subcommand.?= In-Reply-To: References: Message-Id: Date: Sun, 10 Oct 2021 12:20:38 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 2.9 (++) 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: * doc/guix.texi (Invoking guix home): Document ‘guix home import’. --- doc/guix.texi | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/doc/guix.texi b/doc/guix.texi index b577684eb7..107a76a9d3 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -36089,6 +36089,38 @@ $ guix home list-generations 10d @end example Content analysis details: (2.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches 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.5 FROM_SUSPICIOUS_NTLD From abused NTLD 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS 0.0 PDS_RDNS_DYNAMIC_FP RDNS_DYNAMIC with FP steps X-Debbugs-Envelope-To: 50873 Cc: Oleg Pykhalov , Ludovic =?utf-8?Q?Court=C3=A8s?= , Andrew Tropin 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.9 (+) 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: * doc/guix.texi (Invoking guix home): Document ‘guix home import’. --- doc/guix.texi | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/doc/guix.texi b/doc/guix.texi index b577684eb7..107a76a9d3 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -36089,6 +36089,38 @@ $ guix home list-generations 10d @end example Content analysis details: (1.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches 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.5 FROM_SUSPICIOUS_NTLD From abused NTLD 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager 0.0 PDS_RDNS_DYNAMIC_FP RDNS_DYNAMIC with FP steps * doc/guix.texi (Invoking guix home): Document =E2=80=98guix home import=E2= =80=99. --- doc/guix.texi | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/doc/guix.texi b/doc/guix.texi index b577684eb7..107a76a9d3 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -36089,6 +36089,38 @@ $ guix home list-generations 10d @end example =20 +@item import +Generate a @dfn{home environment} from the packages in the default +profile and configuration files found in the user's home directory. The +configuration files will be copied to the specified directory. Note +that not every home service that exists is supported (@pxref{Home +Services}). + +@example +$ guix home import ~/guix-config +;; 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. + +(use-modules + (gnu home) + (gnu packages) + (gnu home services shells)) + +(home-environment + (packages + (map specification->package + (list "glibc-locales" "nss-certs" "nss"))) + (services + (list (service + home-bash-service-type + (home-bash-configuration + (bashrc + (list (local-file "/tmp/guix-config/.bashrc")))))))) +@end example + @end table =20 @var{options} can contain any of the common build options (@pxref{Common --=20 2.33.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 10 06:20:58 2021 Received: (at 50873) by debbugs.gnu.org; 10 Oct 2021 10:20:58 +0000 Received: from localhost ([127.0.0.1]:54508 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mZVwv-0003OB-TK for submit@debbugs.gnu.org; Sun, 10 Oct 2021 06:20:58 -0400 Received: from h87-96-130-155.cust.a3fiber.se ([87.96.130.155]:39886 helo=mail.yoctocell.xyz) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mZVwt-0003Nx-FM for 50873@debbugs.gnu.org; Sun, 10 Oct 2021 06:20:56 -0400 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yoctocell.xyz; s=mail; t=1633861249; bh=TRr6MgO4gfeLa5SQBiDASq5mQZaXwVvBljA0qIiTiec=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=uZMJiQMtR1qb4MqFprIh5MsVWnjj6nw1Y6fHkup5hcIaLJ6VM5NGDeeWFrOFQ9UP1 Mlkj4TJIwnRqNBymDYSgPBPOp1YoK6rOsHX7pxSj7Ca8hX5CAMl82lM6siBPa4lGAx G3o+tFyQIjQJkXSnrMfiF5plOVc0H4m9g4cF22X4= To: 50873@debbugs.gnu.org Subject: [PATCH 7/7] =?UTF-8?q?Add=20tests=20for=20=E2=80=98guix=20home=20?= =?UTF-8?q?import=E2=80=99.?= In-Reply-To: References: Message-Id: <197cab14424f4d28ece9e80981d2a4e142dc4791.1633861021.git.public@yoctocell.xyz> Date: Sun, 10 Oct 2021 12:20:49 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 2.9 (++) 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: * tests/home-import.scm: New file. * Makefile.am (SCM_TESTS): Add it. --- Makefile.am | 1 + guix/scripts/home/import.scm | 5 +- tests/home-import.scm | 174 +++++++++++++++++++++++++++++++++++ 3 files [...] Content analysis details: (2.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches 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.5 FROM_SUSPICIOUS_NTLD From abused NTLD 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS 0.0 PDS_RDNS_DYNAMIC_FP RDNS_DYNAMIC with FP steps X-Debbugs-Envelope-To: 50873 Cc: Oleg Pykhalov , Ludovic =?utf-8?Q?Court=C3=A8s?= , Andrew Tropin 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.9 (+) 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: * tests/home-import.scm: New file. * Makefile.am (SCM_TESTS): Add it. --- Makefile.am | 1 + guix/scripts/home/import.scm | 5 +- tests/home-import.scm | 174 +++++++++++++++++++++++++++++++++++ 3 files [...] Content analysis details: (1.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches 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.5 FROM_SUSPICIOUS_NTLD From abused NTLD 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager 0.0 PDS_RDNS_DYNAMIC_FP RDNS_DYNAMIC with FP steps * tests/home-import.scm: New file. * Makefile.am (SCM_TESTS): Add it. --- Makefile.am | 1 + guix/scripts/home/import.scm | 5 +- tests/home-import.scm | 174 +++++++++++++++++++++++++++++++++++ 3 files changed, 179 insertions(+), 1 deletion(-) create mode 100644 tests/home-import.scm diff --git a/Makefile.am b/Makefile.am index 635147efc1..f93199e561 100644 --- a/Makefile.am +++ b/Makefile.am @@ -474,6 +474,7 @@ SCM_TESTS =3D \ tests/graph.scm \ tests/gremlin.scm \ tests/hackage.scm \ + tests/home-import.scm \ tests/import-git.scm \ tests/import-utils.scm \ tests/inferior.scm \ diff --git a/guix/scripts/home/import.scm b/guix/scripts/home/import.scm index b892ae3dfa..c68cfb9e78 100644 --- a/guix/scripts/home/import.scm +++ b/guix/scripts/home/import.scm @@ -28,7 +28,10 @@ (define-module (guix scripts home import) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) #:export (import-manifest - %destination-directory)) + %destination-directory + + ;; For tests. + manifest->code)) =20 ;;; Commentary: ;;; diff --git a/tests/home-import.scm b/tests/home-import.scm new file mode 100644 index 0000000000..8d141bba0f --- /dev/null +++ b/tests/home-import.scm @@ -0,0 +1,174 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright =C2=A9 2021 Xinglu Chen . + +(define-module (test-home-import) + #:use-module (guix scripts home import) + #:use-module (guix utils) + #:use-module (guix build utils) + #:use-module (guix packages) + #:use-module (ice-9 match) + #:use-module ((guix profiles) #:hide (manifest->code)) + #:use-module (gnu packages) + #:use-module (srfi srfi-1) + #:use-module (srfi srfi-26) + #:use-module (srfi srfi-64)) + +;; Test the (guix scripts home import) tools. + +(test-begin "home-import") + +;; Example manifest entries. + +(define guile-2.0.9 + (manifest-entry + (name "guile") + (version "2.0.9") + (item "/gnu/store/..."))) + +(define glibc + (manifest-entry + (name "glibc") + (version "2.19") + (item "/gnu/store/..."))) + +(define gcc + (manifest-entry + (name "gcc") + (version "10.3.0") + (item "/gnu/store/..."))) + +;; Helpers for checking and generating home environments. + +(%destination-directory "/tmp/guix-config") +(mkdir-p (%destination-directory)) + +(define %temporary-home-directory "/tmp/guix-home-import-test") + +(define-syntax-rule (define-home-environment-matcher name pattern) + (define (name obj) + (match obj + (pattern #t) + (x (pk 'fail x #f))))) + +(define (create-temporary-home files-alist) + "Create a temporary home directory in '%temporary-home-directory'. +FILES-ALIST is an association list of files and the content of the +corresponding file." + (define (create-file file content) + (let ((absolute-path (string-append %temporary-home-directory "/" file= ))) + (unless (file-exists? absolute-path) + (mkdir-p (pk (dirname absolute-path)))) + (call-with-output-file (pk absolute-path) + (cut display content <>)))) + + (for-each (match-lambda + ((file . content) (create-file file content))) + (pk files-alist))) + +;; Copied from (guix profiles) +(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 ENTR= Y. + "") + (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 used + ;; 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))))))) + +(define (eval-test-with-home-environment files-alist manifest matcher) + (create-temporary-home files-alist) + (setenv "HOME" %temporary-home-directory) + (mkdir-p %temporary-home-directory) + (let* ((home-environment (manifest->code manifest + #:entry-package-version version= -spec + #:home-environment? #t)) + (result (matcher home-environment))) + (delete-file-recursively %temporary-home-directory) + result)) + +(define-home-environment-matcher match-home-environment-no-services + ('begin + ('use-modules + ('gnu 'home) + ('gnu 'packages)) + ('home-environment + ('packages + ('map 'specification->package + ('list "guile@2.0.9" "gcc" "glibc@2.19"))) + ('services + ('list))))) + +(define-home-environment-matcher match-home-environment-no-services-nor-pa= ckages + ('begin + ('use-modules + ('gnu 'home) + ('gnu 'packages)) + ('home-environment + ('packages + ('map 'specification->package + ('list))) + ('services + ('list))))) + +(define-home-environment-matcher match-home-environment-bash-service + ('begin + ('use-modules + ('gnu 'home) + ('gnu 'packages) + ('gnu 'home 'services 'shells)) + ('home-environment + ('packages + ('map 'specification->package + ('list))) + ('services + ('list ('service + 'home-bash-service-type + ('home-bash-configuration + ('bashrc + ('list ('local-file "/tmp/guix-config/.bashrc")))))))))) + +(test-assert "manifest->code: No services" + (eval-test-with-home-environment + '() + (make-manifest (list guile-2.0.9 gcc glibc)) + match-home-environment-no-services)) + +(test-assert "manifest->code: No packages nor services" + (eval-test-with-home-environment + '() + (make-manifest '()) + match-home-environment-no-services-nor-packages)) + +(test-assert "manifest->code: Bash service" + (eval-test-with-home-environment + '((".bashrc" . "echo 'hello guix'")) + (make-manifest '()) + match-home-environment-bash-service)) + +(test-end "home-import") --=20 2.33.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 11 09:01:00 2021 Received: (at 50873) by debbugs.gnu.org; 11 Oct 2021 13:01:00 +0000 Received: from localhost ([127.0.0.1]:57081 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mZuvM-0002Ac-04 for submit@debbugs.gnu.org; Mon, 11 Oct 2021 09:01:00 -0400 Received: from mail-lf1-f53.google.com ([209.85.167.53]:46675) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mZuvK-00023X-1N for 50873@debbugs.gnu.org; Mon, 11 Oct 2021 09:00:58 -0400 Received: by mail-lf1-f53.google.com with SMTP id i24so71769922lfj.13 for <50873@debbugs.gnu.org>; Mon, 11 Oct 2021 06:00:57 -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=N9oM6jLwn+levB3mCIr0WAoLQCtg0GErxOmIfvp2iqU=; b=lN+zq/HMjeWxWRGMH+lGkNNSdVWmdhQresWuceKbi9iWpfTYekulxiIaqRm7NbgKBE WiFna5dbhvoCDVjrpDl731ZLtpEJDAIu8K2K8oE5LMekiHs8FCxZOO4ezDpjhtYuaRrd Wt4jLEQ1FJGYl0Z5kQcVEFvdc2Spr9eLrrCroVXzBL++tCBF+Yk3m2T/sd9zrIIYbVkF m47YX9H2O83w7tU72qjVXYA/1Iy0okiNgz1TDO2/H8pHuDh1ect2E72yt+z6MHQP2Sob ZeCaWjLRfXgRqC2i4OuaxdKJ3GjlkAGaY/2gQssLGVpuNPlsKp9lLlhkx+5xbKQInV8t sBtQ== 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=N9oM6jLwn+levB3mCIr0WAoLQCtg0GErxOmIfvp2iqU=; b=v8PQz2VZDbKeFM7vCVXQiseUDj/ECGmzRLnN45SNllTaectmhs1pOf9sRF/REYMFJD KYB/Pm3NDSlkvk6jsgjpDdir8KH8Yr4rgUhdUmh61REiBubVY1ZaFdZ7O/EGthfFXHkr wvJJua5+TD9ZaxpuWefcUi+mnUc2qBf+GIv5McvIRg8D2l8NahtV/AHV8fBGedx6pxNQ bVlZMTN1JWbgftgTlv/XfcXAp3D0bWdeSGfmea8yDTlshMaIaHRw91hnOWU+seqq/dzv rqjSxUJVYW/ikv8E+ROs/z3W4k+g3+ZdAjQLZ3ygNAImELHkvaV2AQl7EGPgYj+IEZja sNXw== X-Gm-Message-State: AOAM531y04xiS5q10BpXHdQ+COWYSmsFEOS1/oncvdAsWBwtRmtVYNiU VxZweyVfkxVhBgvFGkZ3y2g= X-Google-Smtp-Source: ABdhPJyjMwAPxhiFcPuLOhmxKac9a8C1SAY6IBoBp2Uv/5w8Z+ibOtznTgBDrIyxdzdEzd8lBGXviQ== X-Received: by 2002:a2e:a415:: with SMTP id p21mr132329ljn.384.1633957245188; Mon, 11 Oct 2021 06:00:45 -0700 (PDT) Received: from guixsd ([88.201.161.72]) by smtp.gmail.com with ESMTPSA id m3sm729959lfh.2.2021.10.11.06.00.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Oct 2021 06:00:44 -0700 (PDT) From: Oleg Pykhalov To: Xinglu Chen Subject: Re: bug#50873: [PATCH 0/5] Fixes to =?utf-8?Q?=E2=80=98guix?= home =?utf-8?Q?import=E2=80=99?= References: <197cab14424f4d28ece9e80981d2a4e142dc4791.1633861021.git.public@yoctocell.xyz> Date: Mon, 11 Oct 2021 16:00:43 +0300 In-Reply-To: <197cab14424f4d28ece9e80981d2a4e142dc4791.1633861021.git.public@yoctocell.xyz> (Xinglu Chen's message of "Sun, 10 Oct 2021 12:20:49 +0200") Message-ID: <87mtnf1zt0.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: 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: Hi, Xinglu Chen writes: […] Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (go.wigust[at]gmail.com) 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.53 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.167.53 listed in list.dnswl.org] X-Debbugs-Envelope-To: 50873 Cc: Ludovic =?utf-8?Q?Court=C3=A8s?= , 50873@debbugs.gnu.org, Andrew Tropin 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, Xinglu Chen writes: [=E2=80=A6] > +;; Helpers for checking and generating home environments. > + > +(%destination-directory "/tmp/guix-config") > +(mkdir-p (%destination-directory)) > + > +(define %temporary-home-directory "/tmp/guix-home-import-test") Better use temporary directory like in tests/opam.scm. =2D-8<---------------cut here---------------start------------->8--- (define-module ... #:use-module ((guix build syscalls) #:select (mkdtemp!)) ...) (mkdtemp! "/tmp/guix-home-import-test.XXXXXX") =2D-8<---------------cut here---------------end--------------->8--- > + > +(define-syntax-rule (define-home-environment-matcher name pattern) > + (define (name obj) > + (match obj > + (pattern #t) > + (x (pk 'fail x #f))))) > + > +(define (create-temporary-home files-alist) > + "Create a temporary home directory in '%temporary-home-directory'. > +FILES-ALIST is an association list of files and the content of the > +corresponding file." > + (define (create-file file content) > + (let ((absolute-path (string-append %temporary-home-directory "/" fi= le))) > + (unless (file-exists? absolute-path) > + (mkdir-p (pk (dirname absolute-path)))) > + (call-with-output-file (pk absolute-path) > + (cut display content <>)))) Do we need those 'pk' calls? [=E2=80=A6] > +(define-home-environment-matcher match-home-environment-bash-service > + ('begin > + ('use-modules > + ('gnu 'home) > + ('gnu 'packages) > + ('gnu 'home 'services 'shells)) > + ('home-environment > + ('packages > + ('map 'specification->package > + ('list))) > + ('services > + ('list ('service > + 'home-bash-service-type > + ('home-bash-configuration > + ('bashrc > + ('list ('local-file "/tmp/guix-config/.bashrc")))))))))) We should use '%temporary-home-directory' if we use 'mkdtemp!'. > + > +(test-assert "manifest->code: No services" > + (eval-test-with-home-environment > + '() > + (make-manifest (list guile-2.0.9 gcc glibc)) > + match-home-environment-no-services)) > + > +(test-assert "manifest->code: No packages nor services" > + (eval-test-with-home-environment > + '() > + (make-manifest '()) > + match-home-environment-no-services-nor-packages)) > + > +(test-assert "manifest->code: Bash service" > + (eval-test-with-home-environment > + '((".bashrc" . "echo 'hello guix'")) > + (make-manifest '()) > + match-home-environment-bash-service)) > + > +(test-end "home-import") I tried to use 'guix home import /tmp/foo', where '/tmp/foo' is an empty directory. Then a pasted the generated code to '/tmp/foo/home.scm' file. =2D-8<---------------cut here---------------start------------->8--- oleg@guixsd ~/src/guix [env]$ ./pre-inst-env guix home build /tmp/foo/home.= scm /tmp/foo/home.scm:487:11: error: service: unbound variable hint: Did you forget `(use-modules (gnu services))'? =2D-8<---------------cut here---------------end--------------->8--- OK, added missing (use-modules (gnu services)). =2D-8<---------------cut here---------------start------------->8--- oleg@guixsd ~/src/guix [env]$ ./pre-inst-env guix home build /tmp/foo/home.= scm /tmp/foo/home.scm:491:29: error: local-file: unbound variable hint: Did you forget `(use-modules (guix gexp))'? =2D-8<---------------cut here---------------end--------------->8--- OK, added missing (use-modules (guix gexp)) =2D-8<---------------cut here---------------start------------->8--- oleg@guixsd ~/src/guix [env]$ oleg@guixsd ~/src/guix [env]$ ./pre-inst-env guix home build /tmp/foo/home.= scm guix home: error: invalid name: `.bashrc' =2D-8<---------------cut here---------------end--------------->8--- Now, I need to rename .bashrc to dot-bashrc and .bash_profile to dot-bash_profile. Maybe we should save all dot file with a 'dot-' prefix by default? Oleg. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJIBAEBCgAyFiEEcjhxI46s62NFSFhXFn+OpQAa+pwFAmFkNXsUHGdvLndpZ3Vz dEBnbWFpbC5jb20ACgkQFn+OpQAa+py98BAAw2qrJNXtEuNXJyUws9obypmDH2aB NtX29V0AjXhmVpoY60rv41I8OVeammAMLAX9974u8Lka1vNfiVKd14JkHqRutKur I6qPbgBjUCI0MSDwl2MrUbq9y/QMw9fmo/PSY+TXE6Zfzg7hN2XLMllwfKVSD5JV rSE67+OybUDPI2Nopx6TEJydwTGdBiRVQBWo4nw7fhqzWYXQtkNoe/BeoAwoybLF wW8+rL9JyISch66f2TSduyVcHXp8F07r9hzCb9S9PqpiQ6EtaVUJC37uJ/jW5b3a Q7r/EVygZMD4bHX5qz5gOe+Cu5HoXUuz/07q2S+E9spjZ+1hVGUltEm6oPU8xLjU /FN9dbMuSLZfzew3UoE6NqNa4bNDjSM5LRO2ZIi3E9N8WCj5ggJVgXziEsns94Aa D0obuR9lPATcXzK2XTqdpGK1jdvDKeaNfZQA7gnkIkV1TMbj2p2u2dFVdaM5zjcU tWOLC/6ypLZMlo+g/RygeMWWAW2mba2Yz+05kzaIxucgXxx51fYJWVX8LBuR5+XM pQwwB6W9jEicJu07RFfE357mj4LPuRhfV071ngKi4UTtoz+MxYE9TE6pu9BGPp8z qo3UU9zODk4HZD4NL2dkQEOTesoWXfIdW8MYoxhaKgxYMmEKxg8eLBPopu4EUJE2 gmEGq1y7C00Eb/k= =mkRy -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 13 05:24:13 2021 Received: (at 50873) by debbugs.gnu.org; 13 Oct 2021 09:24:13 +0000 Received: from localhost ([127.0.0.1]:58295 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1maaUf-0006vG-I1 for submit@debbugs.gnu.org; Wed, 13 Oct 2021 05:24:13 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56286) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1maaUd-0006v3-0n for 50873@debbugs.gnu.org; Wed, 13 Oct 2021 05:24:12 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:51054) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1maaUW-0003J1-WA; Wed, 13 Oct 2021 05:24:05 -0400 Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:57449 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1maaUW-00040P-3M; Wed, 13 Oct 2021 05:24:04 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Xinglu Chen Subject: Re: bug#50873: [PATCH 0/5] Fixes to =?utf-8?Q?=E2=80=98guix?= home =?utf-8?Q?import=E2=80=99?= References: <9db0424f9494d3d15e534eb75773ae9bd3f33cb3.1633861021.git.public@yoctocell.xyz> Date: Wed, 13 Oct 2021 11:24:00 +0200 In-Reply-To: <9db0424f9494d3d15e534eb75773ae9bd3f33cb3.1633861021.git.public@yoctocell.xyz> (Xinglu Chen's message of "Sun, 10 Oct 2021 12:20:11 +0200") Message-ID: <87v921qnv3.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.3 (/) X-Debbugs-Envelope-To: 50873 Cc: Oleg Pykhalov , 50873@debbugs.gnu.org, Andrew Tropin 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.3 (-) Hello, Xinglu Chen skribis: > Copy the appropriate the relevant configuration files to the destination > directory, and call =E2=80=98local-file=E2=80=99 on them. > > Without this, =E2=80=98guix home import=E2=80=99 will generate a service = declaration like this > > (service > home-bash-service-type > (home-bash-configuration > (bashrc > (list (slurp-file-gexp > (local-file "/home/yoctocell/.bashrc")))))) > > but when running =E2=80=98guix home reconfigure=E2=80=99, the ~/.bashrc f= ile would be moved, so > when running =E2=80=98guix home reconfigure=E2=80=99 for the second time,= it would read the > ~/.bashrc which is itself a symlink to a file the store. Ooh, good catch! > * guix/scripts/home/import.scm (%destination-directory): New parameter. > (generate-bash-module+configuration): Adjust accordingly. > (modules+configurations): Copy the user=E2=80=99s configuration file to > =E2=80=98%destination-directory=E2=80=99. > * guix/scripts/home.scm (process-command): Adjust accordingly; create > =E2=80=98%destination-directory=E2=80=99 if it doesn=E2=80=99t exist. [...] > +(define %destination-directory > + (make-parameter (string-append (getenv "HOME") "/src/guix-config"))) Instead of making it a parameter, with a default value that looks fishy but is never actually used :-), can we make it an explicit parameter of =E2=80=98generate-bash-module+configuration=E2=80=99? Otherwise LGTM! Thanks, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 13 05:26:10 2021 Received: (at 50873) by debbugs.gnu.org; 13 Oct 2021 09:26:10 +0000 Received: from localhost ([127.0.0.1]:58319 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1maaWY-0006z7-Cl for submit@debbugs.gnu.org; Wed, 13 Oct 2021 05:26:10 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56714) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1maaWW-0006ys-WC for 50873@debbugs.gnu.org; Wed, 13 Oct 2021 05:26:09 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:51076) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1maaWO-000834-Ik; Wed, 13 Oct 2021 05:26:02 -0400 Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:65481 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1maaWM-0004Mz-0X; Wed, 13 Oct 2021 05:26:00 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Oleg Pykhalov Subject: Re: bug#50873: [PATCH 0/5] Fixes to =?utf-8?Q?=E2=80=98guix?= home =?utf-8?Q?import=E2=80=99?= References: <197cab14424f4d28ece9e80981d2a4e142dc4791.1633861021.git.public@yoctocell.xyz> <87mtnf1zt0.fsf_-_@gmail.com> Date: Wed, 13 Oct 2021 11:25:50 +0200 In-Reply-To: <87mtnf1zt0.fsf_-_@gmail.com> (Oleg Pykhalov's message of "Mon, 11 Oct 2021 16:00:43 +0300") Message-ID: <87r1cpqns1.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50873 Cc: 50873@debbugs.gnu.org, Xinglu Chen , Andrew Tropin X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi Xinglu and all! It all LGTM, except for the issues that Oleg reports. Xinglu, could you send one last version of this patch series addressing Oleg=E2=80=99s comments? Thanks, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 29 03:36:52 2021 Received: (at 50873) by debbugs.gnu.org; 29 Oct 2021 07:36:52 +0000 Received: from localhost ([127.0.0.1]:53943 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgMRY-0003ns-1t for submit@debbugs.gnu.org; Fri, 29 Oct 2021 03:36:52 -0400 Received: from eggs.gnu.org ([209.51.188.92]:44354) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgMRU-0003nc-8n for 50873@debbugs.gnu.org; Fri, 29 Oct 2021 03:36:51 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:58062) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mgMRN-0006q8-OI; Fri, 29 Oct 2021 03:36:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=37E2/6Jp4F/d2v3AU73mFLkodoSGVQAWpQjfDPBxwxg=; b=YxwYzOiZchN2A81SdN+F /50G3LkSEO2/GvGipknxhKtcAhf3wtq6M+XjRrhpzfaGxkZLWQZcdkgPa11ZE7TjY5v3SYf9DFDSU +KZvPMD8dIG5xAUBzHu3z2sLFDwFudm4vxwzZdIUQfzkuXSFIE2fbmiuA3venuxY/+nUAAcW0WVgy uxe/2Fb1yELtTB3kIPNsBVXhgp+ia5oauTAfwNxyHZMgP+cKzJGo3Jk7hyNI3hrXHcx/DwBP7U9M+ EhE+9WOF1HMQkIpFwPiJDpK+zFyf05lW79opqlYs4iwiOamRoYpUEW9pLnqoCCxGspthzu/DxMoQa p2yrovJlv6wEGw==; Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=51476 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mgMRK-0003ul-B4; Fri, 29 Oct 2021 03:36:39 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Oleg Pykhalov Subject: Re: bug#50873: [PATCH 0/5] Fixes to =?utf-8?Q?=E2=80=98guix?= home =?utf-8?Q?import=E2=80=99?= References: <197cab14424f4d28ece9e80981d2a4e142dc4791.1633861021.git.public@yoctocell.xyz> <87mtnf1zt0.fsf_-_@gmail.com> <87r1cpqns1.fsf_-_@gnu.org> Date: Fri, 29 Oct 2021 09:36:33 +0200 In-Reply-To: <87r1cpqns1.fsf_-_@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s?= =?utf-8?Q?=22's?= message of "Wed, 13 Oct 2021 11:25:50 +0200") Message-ID: <87wnlw2sfy.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50873 Cc: Xinglu Chen , 50873@debbugs.gnu.org, Andrew Tropin 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 (---) Hello! It=E2=80=99s been a month already. Oleg, perhaps you could make those final modifications on behalf on Xinglu so we can move forward? We=E2=80=99re al= most there! Thanks, Ludo=E2=80=99. Ludovic Court=C3=A8s skribis: > Hi Xinglu and all! > > It all LGTM, except for the issues that Oleg reports. > > Xinglu, could you send one last version of this patch series addressing > Oleg=E2=80=99s comments? > > Thanks, > Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 29 09:37:48 2021 Received: (at 50873) by debbugs.gnu.org; 29 Oct 2021 13:37:48 +0000 Received: from localhost ([127.0.0.1]:54250 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgS4p-0001Mm-W4 for submit@debbugs.gnu.org; Fri, 29 Oct 2021 09:37:48 -0400 Received: from h87-96-130-155.cust.a3fiber.se ([87.96.130.155]:53320 helo=mail.yoctocell.xyz) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgS4k-0001MS-TK for 50873@debbugs.gnu.org; Fri, 29 Oct 2021 09:37:47 -0400 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yoctocell.xyz; s=mail; t=1635514656; bh=WzqxqUEAa/ppcXLrhxYM7ZS9G4BNnYpsCyVhdJr4/pE=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=CkE0wBVQeyKpK9K8sCSsIOhpekfR9TCRNHupe4y5xbNZMahzcnVrdeJFrIRPWZYaD EuTql7hT9ZUPyVdMD1vcMx2lbHmmRTCCCJvg/DeysmRBmmlTU8zKVaGgOv/vMhLvEe A5a5SL8HcD4+TvU90Sg4WvUqUnsRRRTT5MnIwEyo= To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: bug#50873: [PATCH 0/5] Fixes to =?utf-8?Q?=E2=80=98guix?= home =?utf-8?Q?import=E2=80=99?= In-Reply-To: <87v921qnv3.fsf_-_@gnu.org> References: <9db0424f9494d3d15e534eb75773ae9bd3f33cb3.1633861021.git.public@yoctocell.xyz> <87v921qnv3.fsf_-_@gnu.org> Date: Fri, 29 Oct 2021 15:37:03 +0200 Message-ID: <87v91g7y0w.fsf@disroot.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Spam-Score: 2.9 (++) 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: Hi, (sorry for taking so long to get to this!) On Wed, Oct 13 2021, Ludovic Courtès wrote: > Hello, > > Xinglu Chen skribis: > >> Copy the appropriate the relevant configuration files to the destination >> directory, and call ‘local-file’ on them. >> >> Without th [...] Content analysis details: (2.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches 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.5 FROM_SUSPICIOUS_NTLD From abused NTLD 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS 0.0 PDS_RDNS_DYNAMIC_FP RDNS_DYNAMIC with FP steps X-Debbugs-Envelope-To: 50873 Cc: Oleg Pykhalov , 50873@debbugs.gnu.org, Andrew Tropin 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: 2.9 (++) 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: Hi, (sorry for taking so long to get to this!) On Wed, Oct 13 2021, Ludovic Courtès wrote: > Hello, > > Xinglu Chen skribis: > >> Copy the appropriate the relevant configuration files to the destination >> directory, and call ‘local-file’ on them. >> >> Without th [...] Content analysis details: (2.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches 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.5 FROM_SUSPICIOUS_NTLD From abused NTLD 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS 1.0 BULK_RE_SUSP_NTLD Precedence bulk and RE: from a suspicious TLD -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager 0.0 PDS_RDNS_DYNAMIC_FP RDNS_DYNAMIC with FP steps --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi, (sorry for taking so long to get to this!) On Wed, Oct 13 2021, Ludovic Court=C3=A8s wrote: > Hello, > > Xinglu Chen skribis: > >> Copy the appropriate the relevant configuration files to the destination >> directory, and call =E2=80=98local-file=E2=80=99 on them. >> >> Without this, =E2=80=98guix home import=E2=80=99 will generate a service= declaration like this >> >> (service >> home-bash-service-type >> (home-bash-configuration >> (bashrc >> (list (slurp-file-gexp >> (local-file "/home/yoctocell/.bashrc")))))) >> >> but when running =E2=80=98guix home reconfigure=E2=80=99, the ~/.bashrc = file would be moved, so >> when running =E2=80=98guix home reconfigure=E2=80=99 for the second time= , it would read the >> ~/.bashrc which is itself a symlink to a file the store. > > Ooh, good catch! > >> * guix/scripts/home/import.scm (%destination-directory): New parameter. >> (generate-bash-module+configuration): Adjust accordingly. >> (modules+configurations): Copy the user=E2=80=99s configuration file to >> =E2=80=98%destination-directory=E2=80=99. >> * guix/scripts/home.scm (process-command): Adjust accordingly; create >> =E2=80=98%destination-directory=E2=80=99 if it doesn=E2=80=99t exist. > > [...] > >> +(define %destination-directory >> + (make-parameter (string-append (getenv "HOME") "/src/guix-config"))) > > Instead of making it a parameter, with a default value that looks fishy > but is never actually used :-), can we make it an explicit parameter of > =E2=80=98generate-bash-module+configuration=E2=80=99? Ah, that would be a good idea. :-) =20=20 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJJBAEBCAAzFiEEAVhh4yyK5+SEykIzrPUJmaL7XHkFAmF7+P8VHHB1YmxpY0B5 b2N0b2NlbGwueHl6AAoJEKz1CZmi+1x5bxUP/273Md93z9+YNm4vRYPjbaC/EBQB 0IdCRVkmcUrqOkmv25RDOVSoHDMMFfYS2wf0lAIh23rCOdXUIH+QJV/vtYgv0tNH ljVUySJxZ/74M0YB+FCikJA+/BVG79eNoLma47aYoK0ZBLKXuUnIladGFpC6SUQr GqmJ4EteGWBdpSrimATvwY2YiCQjSbsCG+moMhV2V6H8u/pXxZtPIQcDEoGN75tJ fMBsYDDvCvZCZFY3xw75JZ61K807RwGn7t696LBIstfLHdlkP+28ILDyQyz5t9+B yKQv9bi8KcN2C8NXW5ProdwWs2Kxk/M6aXCj2XFLVXbftaP8ZUTD3JzOnGBJvNn7 ZQ+CNqjE78dwcgUwXHVHLXlluZ6FAwiZrqjYeLfUG+kSuUNXXQG00MFNiL5qSGQP JoHX1hwgYsueosgAYn0nXAynf2FbNqoOyHSv9xzlYZU+bN1t8hPQ8a9hikwE4Z6D WZpD0lyGlU6xGYpGtckPNhhWCIjljGxw6DV7Gm7hw9A8/ft4oJrsIwztZA+1pskP QiatFUlpljZuuMHDlWkV8URxmNE8yY19fOe5dPN2t5/AiNxz+lKUAgxaUyQPxLVr Q0eOVNd3d+47mHggkKh9v9Grs0L2/h+y+bgPlSojb85dztzQL03r/rYSRwWkrJEh puUtbXZFHPMqQP66 =TzQO -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 29 09:48:02 2021 Received: (at 50873) by debbugs.gnu.org; 29 Oct 2021 13:48:02 +0000 Received: from localhost ([127.0.0.1]:54258 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgSEj-0003qb-Vo for submit@debbugs.gnu.org; Fri, 29 Oct 2021 09:48:02 -0400 Received: from h87-96-130-155.cust.a3fiber.se ([87.96.130.155]:54992 helo=mail.yoctocell.xyz) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgSEg-0003pv-Lu for 50873@debbugs.gnu.org; Fri, 29 Oct 2021 09:48:01 -0400 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yoctocell.xyz; s=mail; t=1635515272; bh=OhNHTQrxRtaxlw4L7rjscm9HlM6DIJq2vWce7TGMzPI=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=WvMWgoEWTDuGN2Zhf7D6aVMQAIC+kGadyIdSJ4nJYQ3fmT+zafqtsw9mUO0pBuo28 5SL4pzSNwVJxJX8+ZOfI9pGG8mAAXvqMv7IU3itKsGjnRp2OWnT5LsyWUoHw9x87rK lz+MVSHiwjiNzRLkRrPd3Bm/MLAq48tkOCF53/oA= To: Oleg Pykhalov Subject: Re: bug#50873: [PATCH 0/5] Fixes to =?utf-8?Q?=E2=80=98guix?= home =?utf-8?Q?import=E2=80=99?= In-Reply-To: <87mtnf1zt0.fsf_-_@gmail.com> References: <197cab14424f4d28ece9e80981d2a4e142dc4791.1633861021.git.public@yoctocell.xyz> <87mtnf1zt0.fsf_-_@gmail.com> Date: Fri, 29 Oct 2021 15:47:51 +0200 Message-ID: <87sfwk7xiw.fsf@disroot.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Spam-Score: 2.9 (++) 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 Mon, Oct 11 2021, Oleg Pykhalov wrote: > Hi, > > Xinglu Chen writes: > > […] > >> +;; Helpers for checking and generating home environments. >> + >> +(%destination-directory "/tmp/guix-config") >> +(mkdir-p (%desti [...] Content analysis details: (2.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches 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.5 FROM_SUSPICIOUS_NTLD From abused NTLD 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS 0.0 PDS_RDNS_DYNAMIC_FP RDNS_DYNAMIC with FP steps X-Debbugs-Envelope-To: 50873 Cc: Ludovic =?utf-8?Q?Court=C3=A8s?= , 50873@debbugs.gnu.org, Andrew Tropin 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: 2.9 (++) 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 Mon, Oct 11 2021, Oleg Pykhalov wrote: > Hi, > > Xinglu Chen writes: > > […] > >> +;; Helpers for checking and generating home environments. >> + >> +(%destination-directory "/tmp/guix-config") >> +(mkdir-p (%desti [...] Content analysis details: (2.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches 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.5 FROM_SUSPICIOUS_NTLD From abused NTLD 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS 1.0 BULK_RE_SUSP_NTLD Precedence bulk and RE: from a suspicious TLD -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager 0.0 PDS_RDNS_DYNAMIC_FP RDNS_DYNAMIC with FP steps --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Mon, Oct 11 2021, Oleg Pykhalov wrote: > Hi, > > Xinglu Chen writes: > > [=E2=80=A6] > >> +;; Helpers for checking and generating home environments. >> + >> +(%destination-directory "/tmp/guix-config") >> +(mkdir-p (%destination-directory)) >> + >> +(define %temporary-home-directory "/tmp/guix-home-import-test") > > Better use temporary directory like in tests/opam.scm. > > --8<---------------cut here---------------start------------->8--- > (define-module ... > #:use-module ((guix build syscalls) #:select (mkdtemp!)) > ...) > > (mkdtemp! "/tmp/guix-home-import-test.XXXXXX") > --8<---------------cut here---------------end--------------->8--- Good idea. Out of curiosity: is there any difference between =E2=80=98mkdt= emp!=E2=80=99 and =E2=80=98mkdtemp=E2=80=99 that=E2=80=99s part of Guile? >> + >> +(define-syntax-rule (define-home-environment-matcher name pattern) >> + (define (name obj) >> + (match obj >> + (pattern #t) >> + (x (pk 'fail x #f))))) >> + >> +(define (create-temporary-home files-alist) >> + "Create a temporary home directory in '%temporary-home-directory'. >> +FILES-ALIST is an association list of files and the content of the >> +corresponding file." >> + (define (create-file file content) >> + (let ((absolute-path (string-append %temporary-home-directory "/" f= ile))) >> + (unless (file-exists? absolute-path) >> + (mkdir-p (pk (dirname absolute-path)))) >> + (call-with-output-file (pk absolute-path) >> + (cut display content <>)))) > > Do we need those 'pk' calls? Nope, just some leftover stuff that I forgot to remove=E2=80=A6 >> +(define-home-environment-matcher match-home-environment-bash-service >> + ('begin >> + ('use-modules >> + ('gnu 'home) >> + ('gnu 'packages) >> + ('gnu 'home 'services 'shells)) >> + ('home-environment >> + ('packages >> + ('map 'specification->package >> + ('list))) >> + ('services >> + ('list ('service >> + 'home-bash-service-type >> + ('home-bash-configuration >> + ('bashrc >> + ('list ('local-file "/tmp/guix-config/.bashrc")))))))))) > > We should use '%temporary-home-directory' if we use 'mkdtemp!'. I don=E2=80=99t think so, the =E2=80=98bashrc=E2=80=99 file will be copied = _from_ =E2=80=98%temporary-home-directory=E2=80=99 to =E2=80=98%destination-direct= ory=E2=80=99, so this should be =E2=80=98%destination-directory=E2=80=99. >> + >> +(test-assert "manifest->code: No services" >> + (eval-test-with-home-environment >> + '() >> + (make-manifest (list guile-2.0.9 gcc glibc)) >> + match-home-environment-no-services)) >> + >> +(test-assert "manifest->code: No packages nor services" >> + (eval-test-with-home-environment >> + '() >> + (make-manifest '()) >> + match-home-environment-no-services-nor-packages)) >> + >> +(test-assert "manifest->code: Bash service" >> + (eval-test-with-home-environment >> + '((".bashrc" . "echo 'hello guix'")) >> + (make-manifest '()) >> + match-home-environment-bash-service)) >> + >> +(test-end "home-import") > > I tried to use 'guix home import /tmp/foo', where '/tmp/foo' is an empty > directory. Then a pasted the generated code to '/tmp/foo/home.scm' > file. > > --8<---------------cut here---------------start------------->8--- > oleg@guixsd ~/src/guix [env]$ ./pre-inst-env guix home build /tmp/foo/hom= e.scm > /tmp/foo/home.scm:487:11: error: service: unbound variable > hint: Did you forget `(use-modules (gnu services))'? > --8<---------------cut here---------------end--------------->8--- > > OK, added missing (use-modules (gnu services)). > > --8<---------------cut here---------------start------------->8--- > oleg@guixsd ~/src/guix [env]$ ./pre-inst-env guix home build /tmp/foo/hom= e.scm > /tmp/foo/home.scm:491:29: error: local-file: unbound variable > hint: Did you forget `(use-modules (guix gexp))'? > --8<---------------cut here---------------end--------------->8--- > > OK, added missing (use-modules (guix gexp)) > > --8<---------------cut here---------------start------------->8--- > oleg@guixsd ~/src/guix [env]$ > oleg@guixsd ~/src/guix [env]$ ./pre-inst-env guix home build /tmp/foo/hom= e.scm > guix home: error: invalid name: `.bashrc' > --8<---------------cut here---------------end--------------->8--- > > Now, I need to rename .bashrc to dot-bashrc and .bash_profile to > dot-bash_profile. Maybe we should save all dot file with a 'dot-' > prefix by default? Ah, thanks for catching this! I think it would be better to call =E2=80=98local-file=E2=80=99 with the optional =E2=80=98name=E2=80=99 argum= ent like this: (local-file "/some/path/.bashrc" "bashrc") That also means that the =E2=80=9C/some/path/=E2=80=9D part won=E2=80=99t e= nd up as part of the /gnu/store/=E2=80=A6 file name. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJJBAEBCAAzFiEEAVhh4yyK5+SEykIzrPUJmaL7XHkFAmF7+4cVHHB1YmxpY0B5 b2N0b2NlbGwueHl6AAoJEKz1CZmi+1x5+dAP/R50fg8PIkhxvJUUXNPNtbg7HuM4 89wVBoz3nfrysKu9VWfhtxXnzmdIE3ckm45DYUKGhADOO4XWVOhBJhdeec76OpNR 3c8sgC60u8ViCO1QGFWc8zxFRN801kmxLTCohNdZVPTwysw3aeCb4rfPexG2VUIe siekV4okGGjPEruU2bkAY60O+xvjpCx3PfEvSyY4bv0xobQ5KBeX+wxm/338BINd GmmRZ1m7AI2yrMwxhtO76HDwqW+IRY5NmMiBp+OhkaixL9fOWM/9n7Xwt3qFdAWa Z0WK38o28RtTUSxg92gXYDs1dajhSwRTm6Wj9jc4FrzY8RBiuh2NDnWYvnvQRdrC YlRLRue2fHpO5nPIAmUPASKruzUZG5otzPZ/EborxTKOyyLNpWoLkhY4kce9bjsq iOOT8jGJEuCA3ZC/3OqfnwNiLQCdNnyOWgNnE6qYEgql2Couq2JgpQNgiAlMLWDU Y0d+8ZLsU7hpqgoTyk7XVGjl/IzEcA2IMDSR/mrFPr2bV446GObePykTryj2a0lC tEqUsQrfyDyL/37ET4Y9HNarZqqoJE6THLEUC38+PLbpy7uNVdFsq/j7HYL+1PH5 REJHsZJ9Dnyz4KBX8n1qMysmlgqHoTr4+5QcjGKekcuqyBoqnT3POjPXUKNdzW2y +gEF50l7Fmi3ScuZ =to73 -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 30 06:42:34 2021 Received: (at 50873) by debbugs.gnu.org; 30 Oct 2021 10:42:34 +0000 Received: from localhost ([127.0.0.1]:56707 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mglon-0002Yn-SI for submit@debbugs.gnu.org; Sat, 30 Oct 2021 06:42:34 -0400 Received: from h87-96-130-155.cust.a3fiber.se ([87.96.130.155]:59242 helo=mail.yoctocell.xyz) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mglol-0002YU-Bm for 50873@debbugs.gnu.org; Sat, 30 Oct 2021 06:42:32 -0400 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yoctocell.xyz; s=mail; t=1635590544; bh=xvskgzMZ/isGEDfyTcQlecHmJJUdMKXW3v3mPn2IbdY=; h=From:To:Subject:In-Reply-To:References:Date; b=RLnFvs1afTAjSXX7fB+qLsFUTAVjYWixpv7kwD6kNtyHBAGVc0bvX957bHRc56hdM pxS8WQ5CApD8gqZM0J+1kGcMM8B6VXuZBRgwgeM9e6zvuHXz+NEct4mdWyj7zzCGGt c40bSSnfAiPOetqJD3aJMSL7jccf3WCqO/A6H5Bk= To: 50873@debbugs.gnu.org, Oleg Pykhalov , Andrew Tropin , Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: [PATCH v3 0/8] Fixes to =?utf-8?Q?=E2=80=98guix?= home =?utf-8?Q?import=E2=80=99?= In-Reply-To: References: Message-Id: Date: Sat, 30 Oct 2021 12:42:21 +0200 MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Spam-Score: 2.9 (++) 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: Changes since v2: * Call ‘local-file’ with a ‘name’ argument to make the /gnu/store/… file name more readable. * Import some missing modules. Content analysis details: (2.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches 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.5 FROM_SUSPICIOUS_NTLD From abused NTLD 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS 0.0 PDS_RDNS_DYNAMIC_FP RDNS_DYNAMIC with FP steps X-Debbugs-Envelope-To: 50873 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.9 (+) 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: Changes since v2: * Call ‘local-file’ with a ‘name’ argument to make the /gnu/store/… file name more readable. * Import some missing modules. Content analysis details: (1.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches 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.5 FROM_SUSPICIOUS_NTLD From abused NTLD 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager 0.0 PDS_RDNS_DYNAMIC_FP RDNS_DYNAMIC with FP steps --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Changes since v2: * Call =E2=80=98local-file=E2=80=99 with a =E2=80=98name=E2=80=99 argument = to make the /gnu/store/=E2=80=A6 file name more readable. * Import some missing modules. * Remove the =E2=80=98%destination-directory=E2=80=99 parameter, and instea= d pass the directory to =E2=80=98generate-bash-configuration+modules=E2=80=99. * Other minor cleanups. Xinglu Chen (8): guix home: import: Make the user to specify a destination directory. guix home: import: Allow multiple modules to be imported for each service. guix home: import: Fix module name for Bash service. guix home: import: Don=E2=80=99t use 'slurp-file-gexp'. guix home: import: Delete duplicate modules when importing. doc: Document the =E2=80=98guix home import=E2=80=99 subcommand. Add tests for =E2=80=98guix home import=E2=80=99. guix home: import: Call =E2=80=98local-file=E2=80=99 with =E2=80=98name= =E2=80=99 argument. Makefile.am | 1 + doc/guix.texi | 32 +++++++ guix/scripts/home.scm | 24 +++-- guix/scripts/home/import.scm | 137 ++++++++++++++++---------- tests/home-import.scm | 180 +++++++++++++++++++++++++++++++++++ 5 files changed, 313 insertions(+), 61 deletions(-) create mode 100644 tests/home-import.scm base-commit: c6adc0947396daa6d85ab08837f9cbc86f4d8722 =2D-=20 2.33.0 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJJBAEBCAAzFiEEAVhh4yyK5+SEykIzrPUJmaL7XHkFAmF9IY0VHHB1YmxpY0B5 b2N0b2NlbGwueHl6AAoJEKz1CZmi+1x5l/UP/0xijD8WP/DC7nHUsmBymKTK0Isi u3nNopzGQ+bqRPZuB6qO76MG0H3Nor0zxk95Wpmju2PdehRJcq8oK+Vus+APjGcB UagG+jawaHZn+1wreqxb4JQpeF01lAYlmArtAlc8CM8rONd2g5Y2oLd07ajwgCi8 11X9lycAIvyetar7QLUAyNwv4gyZ2URcBx4enfwgd6OPs2j7Ggmxuz75ESHj7WfN lV4Z/zvSpCMqJAK03I9H6TFUhuVvRS9iEgzWMiXzJwJQfrar8aRtS/uYbmUlBQJo 6qg9OKeksc98WaaNlclv0PQbOHXe1hdrD1v8uJ7H4TlqKSTyLKyPC5FABzEP08uf xhR9ZLLzuCAgs7SmetgvTtg92omCEQQpN3kbCeLBitwtrd/wZsOkOkSnRSasx85I mZgOUjr2tBxoCzzcSdnLOXThyUocrggqjrDhNMN69u9WjV6QYDYPANqykFRh2atk hwDzLecVV9mG+3/frq3CReDJlXCISs32gWMJS/vfhiFTgX/kNLUMsLDN1XZ9ivcI wCqDCsLHo0H96xSi8g/cfDds2LSsJtLaueyG2Du91oIanvVqBoQrq2SFdiowSZHR KfbRFezuYZJysmHx1WQw7jM830ut1JwiQvVfaVcB07HKDS22ZUe1NhKgEMXvMxvK L67IpszGLwF0FL5H =LMbt -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 30 06:42:44 2021 Received: (at 50873) by debbugs.gnu.org; 30 Oct 2021 10:42:44 +0000 Received: from localhost ([127.0.0.1]:56716 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mglox-0002Zg-JY for submit@debbugs.gnu.org; Sat, 30 Oct 2021 06:42:44 -0400 Received: from h87-96-130-155.cust.a3fiber.se ([87.96.130.155]:59260 helo=mail.yoctocell.xyz) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mglon-0002YY-Qh for 50873@debbugs.gnu.org; Sat, 30 Oct 2021 06:42:34 -0400 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yoctocell.xyz; s=mail; t=1635590548; bh=DbXLvNf2Gp330sdB/TY7J5Tet0J5OWXLZky0C2PXlt4=; h=From:To:Subject:In-Reply-To:References:Date; b=MHeTSnstulwiep8iR6oNwalnmuX6GB3hO25hA1allKP4+ckH8yMTIJ1jTFvDB1elC CSTGtbFh0tfSBPm4V7Zz37pgxaF4nz739Nedp/6hS7bxz6+3Lh6wtEy9WjPBHhm39E Hn5twp5DmgqrWttoDNVJh7pKeXhoLkYI++AUYlxs= To: 50873@debbugs.gnu.org, Oleg Pykhalov , Andrew Tropin , Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: [PATCH v3 1/8] guix home: import: Make the user to specify a destination directory. In-Reply-To: References: Message-Id: <4b3eb05f3fb1bfbd3e7f16c3ba5862a603372df0.1635590221.git.public@yoctocell.xyz> Date: Sat, 30 Oct 2021 12:42:27 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 2.9 (++) 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: Copy the appropriate the relevant configuration files to the destination directory, and call ‘local-file’ on them. Without this, ‘guix home import’ will generate a service declaration like this Content analysis details: (2.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches 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.5 FROM_SUSPICIOUS_NTLD From abused NTLD 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS 0.0 PDS_RDNS_DYNAMIC_FP RDNS_DYNAMIC with FP steps X-Debbugs-Envelope-To: 50873 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.9 (+) 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: Copy the appropriate the relevant configuration files to the destination directory, and call ‘local-file’ on them. Without this, ‘guix home import’ will generate a service declaration like this Content analysis details: (1.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches 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.5 FROM_SUSPICIOUS_NTLD From abused NTLD 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager 0.0 PDS_RDNS_DYNAMIC_FP RDNS_DYNAMIC with FP steps Copy the appropriate the relevant configuration files to the destination directory, and call =E2=80=98local-file=E2=80=99 on them. Without this, =E2=80=98guix home import=E2=80=99 will generate a service de= claration like this (service home-bash-service-type (home-bash-configuration (bashrc (list (slurp-file-gexp (local-file "/home/yoctocell/.bashrc")))))) but when running =E2=80=98guix home reconfigure=E2=80=99, the ~/.bashrc fil= e would be moved, so when running =E2=80=98guix home reconfigure=E2=80=99 for the second time, i= t would read the ~/.bashrc which is itself a symlink to a file the store. * guix/scripts/home/import.scm (generate-bash-module+configuration): Take =E2=80=98destination-directory=E2=80=99 parameter (modules+configurations): Copy the user=E2=80=99s configuration file to =E2=80=98%destination-directory=E2=80=99. * guix/scripts/home.scm (process-command): Adjust accordingly; create =E2=80=98destination=E2=80=99 if it doesn=E2=80=99t exist. --- guix/scripts/home.scm | 24 ++++++---- guix/scripts/home/import.scm | 86 +++++++++++++++++++++--------------- 2 files changed, 65 insertions(+), 45 deletions(-) diff --git a/guix/scripts/home.scm b/guix/scripts/home.scm index 55e7b436c1..3f48b98ed4 100644 --- a/guix/scripts/home.scm +++ b/guix/scripts/home.scm @@ -40,6 +40,7 @@ (define-module (guix scripts home) #:autoload (guix scripts pull) (channel-commit-hyperlink) #:use-module (guix scripts home import) #:use-module ((guix status) #:select (with-status-verbosity)) + #:use-module ((guix build utils) #:select (mkdir-p)) #:use-module (guix gexp) #:use-module (guix monads) #:use-module (srfi srfi-1) @@ -260,15 +261,20 @@ (define-syntax-rule (with-store* store exp ...) (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)))) + (match (filter-map (match-lambda + (('profile . p) p) + (_ #f)) + opts) + (() (list %current-profile)) + (lst (reverse lst))))) + (manifest (concatenate-manifests + (map profile-manifest profiles))) + (destination (match args + ((destination) destination) + (_ (leave (G_ "wrong number of arguments~%"))))= )) + (unless (file-exists? destination) + (mkdir-p destination)) + (import-manifest manifest destination (current-output-port)))) ((describe) (match (generation-number %guix-home) (0 diff --git a/guix/scripts/home/import.scm b/guix/scripts/home/import.scm index 611f580e85..c7c60e95e8 100644 --- a/guix/scripts/home/import.scm +++ b/guix/scripts/home/import.scm @@ -36,49 +36,61 @@ (define-module (guix scripts home import) ;;; ;;; Code: =20 +(define (generate-bash-configuration+modules destination-directory) + (define (destination-append path) + (string-append destination-directory "/" path)) =20 -(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) + (let ((rc (destination-append ".bashrc")) + (profile (destination-append ".bash_profile")) + (logout (destination-append ".bash_logout"))) + `((gnu home-services bash) (service home-bash-service-type - (home-bash-configuration - ,@(if (file-exists? rc) - `((bashrc - (list (local-file ,rc)))) - '()) - ,@(if (file-exists? profile) - `((bash-profile - (list (local-file ,profile)))) - '()) - ,@(if (file-exists? logout) - `((bash-logout - (list (local-file ,logout)))) - '())))))) - + (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))))) + '())))))) =20 (define %files-configurations-alist `((".bashrc" . ,generate-bash-module+configuration) (".bash_profile" . ,generate-bash-module+configuration) (".bash_logout" . ,generate-bash-module+configuration))) =20 -(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))) +(define (configurations+modules destination-directory) + "Return a list of procedures which when called, generate code for a home +service declaration." + (define configurations + (delete-duplicates + (filter-map (match-lambda + ((file . proc) + (let ((absolute-path (string-append (getenv "HOME") + "/" file))) + (and (file-exists? absolute-path) + (begin + (copy-file absolute-path + (string-append + destination-directory "/" file)) + proc))))) + %files+configurations-alist) + (lambda (x y) + (equal? (procedure-name x) (procedure-name y))))) +=20=20 + (map (lambda (proc) (proc destination-directory)) configurations)) =20 ;; Based on `manifest->code' from (guix profiles) ;; MAYBE: Upstream it? -(define* (manifest->code manifest +(define* (manifest->code manifest destination-directory #:key (entry-package-version (const "")) (home-environment? #f)) @@ -129,7 +141,8 @@ (define (qualified-name entry) ":" output)))) (manifest-entries manifest)))) (if home-environment? - (let ((modules+configurations (modules+configurations))) + (let ((configurations+modules + (configurations+modules destination-directory))) `(begin (use-modules (gnu home) (gnu packages) @@ -171,7 +184,8 @@ (define name (options->transformation ',options)))) transformation-procedures))) (if home-environment? - (let ((modules+configurations (modules+configurations))) + (let ((configurations+modules + (configurations+modules destination-directory))) `(begin (use-modules (guix transformations) (gnu home) @@ -204,7 +218,7 @@ (define* (home-environment-template #:key (packages #f)= (specs #f) services) (services (list ,@services)))) =20 (define* (import-manifest - manifest + manifest destination-directory #:optional (port (current-output-port))) "Write to PORT a corresponding to MANIFEST." (define (version-spec entry) @@ -227,7 +241,7 @@ (define (version-spec entry) (version-unique-prefix (manifest-entry-version entry) versions))))))) =20 - (match (manifest->code manifest + (match (manifest->code manifest destination-directory #:entry-package-version version-spec #:home-environment? #t) (('begin exp ...) --=20 2.33.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 30 06:42:44 2021 Received: (at 50873) by debbugs.gnu.org; 30 Oct 2021 10:42:44 +0000 Received: from localhost ([127.0.0.1]:56718 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgloy-0002Zi-1X for submit@debbugs.gnu.org; Sat, 30 Oct 2021 06:42:44 -0400 Received: from h87-96-130-155.cust.a3fiber.se ([87.96.130.155]:59288 helo=mail.yoctocell.xyz) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mglos-0002Ym-Ib for 50873@debbugs.gnu.org; Sat, 30 Oct 2021 06:42:39 -0400 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yoctocell.xyz; s=mail; t=1635590553; bh=bAoSPT5UtBV5uzz4Gu8EWor07tyBeFgdVq/fKmyuhq0=; h=From:To:Subject:In-Reply-To:References:Date; b=pSKso8JClsqDDd5bJeiRBQ01rfwwvmMSwHTsSlzH3xPl/JcXDuWAzSu0c6geWEWFG YaVS+VUwAt8hYfRV8BG2Eo5XROe+x7WFTz0tbu8EjxKZofUgNVn7mrTW6ZnQwmkQ1D vCyYPMXnhVoiw7elf/NlKfiZ01BbzaFoHdS83vl8= To: 50873@debbugs.gnu.org, Oleg Pykhalov , Andrew Tropin , Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: [PATCH v3 2/8] guix home: import: Allow multiple modules to be imported for each service. In-Reply-To: References: Message-Id: <1002d5577006cc804193f34237415c9707942e27.1635590221.git.public@yoctocell.xyz> Date: Sat, 30 Oct 2021 12:42:32 +0200 MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 2.9 (++) 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: Previously, only one module could be imported for each service, e.g., only (gnu home-services shell) could be imported when generating the Bash service declaration. However, for some services, multipl [...] Content analysis details: (2.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches 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.5 FROM_SUSPICIOUS_NTLD From abused NTLD 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS 0.0 PDS_RDNS_DYNAMIC_FP RDNS_DYNAMIC with FP steps X-Debbugs-Envelope-To: 50873 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.9 (+) 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: Previously, only one module could be imported for each service, e.g., only (gnu home-services shell) could be imported when generating the Bash service declaration. However, for some services, multipl [...] Content analysis details: (1.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches 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.5 FROM_SUSPICIOUS_NTLD From abused NTLD 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager 0.0 PDS_RDNS_DYNAMIC_FP RDNS_DYNAMIC with FP steps Previously, only one module could be imported for each service, e.g., only (gnu home-services shell) could be imported when generating the Bash service declaration. However, for some services, multiple modules might need to be imported in order for it to work. * guix/scripts/home/import.scm (generate-bash-module+configuration): Rename to ... (generate-bash-configuration+modules): ... this. (%files-configurations-alist): Rename to ... (%files+configurations-alist): ... this. (modules+configurations): Rename to ... (configurations+modules): ... this. (manifest->code): Adjust accordingly. --- guix/scripts/home/import.scm | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/guix/scripts/home/import.scm b/guix/scripts/home/import.scm index c7c60e95e8..533abdbb8d 100644 --- a/guix/scripts/home/import.scm +++ b/guix/scripts/home/import.scm @@ -43,8 +43,7 @@ (define (destination-append path) (let ((rc (destination-append ".bashrc")) (profile (destination-append ".bash_profile")) (logout (destination-append ".bash_logout"))) - `((gnu home-services bash) - (service home-bash-service-type + `((service home-bash-service-type (home-bash-configuration ,@(if (file-exists? rc) `((bashrc @@ -60,12 +59,15 @@ (define (destination-append path) `((bash-logout (list (slurp-file-gexp (local-file ,logout))))) - '())))))) + '()))) + (gnu home-services bash)))) -(define %files-configurations-alist - `((".bashrc" . ,generate-bash-module+configuration) - (".bash_profile" . ,generate-bash-module+configuration) - (".bash_logout" . ,generate-bash-module+configuration))) + + +(define %files+configurations-alist + `((".bashrc" . ,generate-bash-configuration+modules) + (".bash_profile" . ,generate-bash-configuration+modules) + (".bash_logout" . ,generate-bash-configuration+modules))) (define (configurations+modules destination-directory) "Return a list of procedures which when called, generate code for a home @@ -144,12 +146,13 @@ (define (qualified-name entry) (let ((configurations+modules (configurations+modules destination-directory))) `(begin - (use-modules (gnu home) - (gnu packages) - ,@(map first modules+configurations)) - ,(home-environment-template - #:specs specs - #:services (map second modules+configurations)))) + (use-modules (gnu home) + (gnu packages) + (gnu services) + ,@(concatenate (map cdr configurations+modules))) + ,(home-environment-template + #:specs specs + #:services (map first configurations+modules)))) `(begin (use-modules (gnu packages)) @@ -190,13 +193,14 @@ (define name (use-modules (guix transformations) (gnu home) (gnu packages) - ,@(map first modules+configurations)) + (gnu services) + ,@(concatenate (map cdr configurations+modules))) ,@transformations ,(home-environment-template #:packages packages - #:services (map second modules+configurations)))) + #:services (map first configurations+modules)))) `(begin (use-modules (guix transformations) (gnu packages)) -- 2.33.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 30 06:42:44 2021 Received: (at 50873) by debbugs.gnu.org; 30 Oct 2021 10:42:44 +0000 Received: from localhost ([127.0.0.1]:56720 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgloy-0002Zq-Cp for submit@debbugs.gnu.org; Sat, 30 Oct 2021 06:42:44 -0400 Received: from h87-96-130-155.cust.a3fiber.se ([87.96.130.155]:59288 helo=mail.yoctocell.xyz) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mglot-0002Ym-To for 50873@debbugs.gnu.org; Sat, 30 Oct 2021 06:42:40 -0400 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yoctocell.xyz; s=mail; t=1635590559; bh=b2I1puvfEgZK0r8OCRM0fx0ZujqguLZnSkyEHQd8OLY=; h=From:To:Subject:In-Reply-To:References:Date; b=K/LJIPvs3KtwMnODfjucPhc4qOSfyTmQp2Ii4y2ySIRRSWR725q3/xNNnJwR5FnZF d/1IdWwwGxMa+XTCW/1+49ZtzFeE8qHGfY/vUN5dsFxDeFavXcwQZU5ni1tZnai69u A0lMVzciu0q5HxaqQuo0scwLKVzqpxav+/+C2wbs= To: 50873@debbugs.gnu.org, Oleg Pykhalov , Andrew Tropin , Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: [PATCH v3 6/8] =?UTF-8?q?doc:=20Document=20the=20=E2=80=98guix=20?= =?UTF-8?q?home=20import=E2=80=99=20subcommand.?= In-Reply-To: References: Message-Id: Date: Sat, 30 Oct 2021 12:42:39 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 2.9 (++) 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: * doc/guix.texi (Invoking guix home): Document ‘guix home import’. --- doc/guix.texi | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/doc/guix.texi b/doc/guix.texi index 22215214e0..3c069912cb 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -36509,6 +36509,38 @@ $ guix home list-generations 10d @end example Content analysis details: (2.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches 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.5 FROM_SUSPICIOUS_NTLD From abused NTLD 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS 0.0 PDS_RDNS_DYNAMIC_FP RDNS_DYNAMIC with FP steps X-Debbugs-Envelope-To: 50873 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.9 (+) 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: * doc/guix.texi (Invoking guix home): Document ‘guix home import’. --- doc/guix.texi | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/doc/guix.texi b/doc/guix.texi index 22215214e0..3c069912cb 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -36509,6 +36509,38 @@ $ guix home list-generations 10d @end example Content analysis details: (1.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches 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.5 FROM_SUSPICIOUS_NTLD From abused NTLD 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager 0.0 PDS_RDNS_DYNAMIC_FP RDNS_DYNAMIC with FP steps * doc/guix.texi (Invoking guix home): Document =E2=80=98guix home import=E2= =80=99. --- doc/guix.texi | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/doc/guix.texi b/doc/guix.texi index 22215214e0..3c069912cb 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -36509,6 +36509,38 @@ $ guix home list-generations 10d @end example =20 +@item import +Generate a @dfn{home environment} from the packages in the default +profile and configuration files found in the user's home directory. The +configuration files will be copied to the specified directory. Note +that not every home service that exists is supported (@pxref{Home +Services}). + +@example +$ guix home import ~/guix-config +;; 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. + +(use-modules + (gnu home) + (gnu packages) + (gnu home services shells)) + +(home-environment + (packages + (map specification->package + (list "glibc-locales" "nss-certs" "nss"))) + (services + (list (service + home-bash-service-type + (home-bash-configuration + (bashrc + (list (local-file "/tmp/guix-config/.bashrc")))))))) +@end example + @end table =20 @var{options} can contain any of the common build options (@pxref{Common --=20 2.33.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 30 06:42:45 2021 Received: (at 50873) by debbugs.gnu.org; 30 Oct 2021 10:42:45 +0000 Received: from localhost ([127.0.0.1]:56722 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgloy-0002Zx-MR for submit@debbugs.gnu.org; Sat, 30 Oct 2021 06:42:44 -0400 Received: from h87-96-130-155.cust.a3fiber.se ([87.96.130.155]:59298 helo=mail.yoctocell.xyz) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mglou-0002Z0-91 for 50873@debbugs.gnu.org; Sat, 30 Oct 2021 06:42:40 -0400 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yoctocell.xyz; s=mail; t=1635590554; bh=adDv+Gm68BKmwCHYqORofe/Nt4AMSQofFsDh/mG139c=; h=From:To:Subject:In-Reply-To:References:Date; b=Dx72gKukqOTjgLo6xdSDLLlrTE1pC0Z3Y33pFqkCX2oXHsanxXLW2rEm+SdK07n1s mdHDK7kEZfozKnit+pv0hzi0WjyeyrTrFLc+MmDiRsWfJvXAhCr210VpZwJg71YV3U axULBiOBQyjz5wJXN9vWXiO6pgyNxh6ZGtdp6Gpg= To: 50873@debbugs.gnu.org, Oleg Pykhalov , Andrew Tropin , Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: [PATCH v3 3/8] guix home: import: Fix module name for Bash service. In-Reply-To: References: Message-Id: Date: Sat, 30 Oct 2021 12:42:34 +0200 MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 2.9 (++) 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 (generate-bash-configuration+modules): Change (gnu home-services bash) to (gnu home-services shells); add (guix gexp). --- guix/scripts/home/import.scm | 3 ++- 1 file ch [...] Content analysis details: (2.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches 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.5 FROM_SUSPICIOUS_NTLD From abused NTLD 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS 0.0 PDS_RDNS_DYNAMIC_FP RDNS_DYNAMIC with FP steps X-Debbugs-Envelope-To: 50873 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.9 (+) 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 (generate-bash-configuration+modules): Change (gnu home-services bash) to (gnu home-services shells); add (guix gexp). --- guix/scripts/home/import.scm | 3 ++- 1 file ch [...] Content analysis details: (1.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches 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.5 FROM_SUSPICIOUS_NTLD From abused NTLD 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager 0.0 PDS_RDNS_DYNAMIC_FP RDNS_DYNAMIC with FP steps * guix/scripts/home/import.scm (generate-bash-configuration+modules): Change (gnu home-services bash) to (gnu home-services shells); add (guix gexp). --- guix/scripts/home/import.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/guix/scripts/home/import.scm b/guix/scripts/home/import.scm index 533abdbb8d..f20088aa88 100644 --- a/guix/scripts/home/import.scm +++ b/guix/scripts/home/import.scm @@ -60,7 +60,8 @@ (define (destination-append path) (list (slurp-file-gexp (local-file ,logout))))) '()))) - (gnu home-services bash)))) + (guix gexp) + (gnu home services shells)))) -- 2.33.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 30 06:42:45 2021 Received: (at 50873) by debbugs.gnu.org; 30 Oct 2021 10:42:45 +0000 Received: from localhost ([127.0.0.1]:56724 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgloy-0002a5-V5 for submit@debbugs.gnu.org; Sat, 30 Oct 2021 06:42:45 -0400 Received: from h87-96-130-155.cust.a3fiber.se ([87.96.130.155]:59316 helo=mail.yoctocell.xyz) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mglov-0002Z4-Li for 50873@debbugs.gnu.org; Sat, 30 Oct 2021 06:42:41 -0400 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yoctocell.xyz; s=mail; t=1635590556; bh=tuaDtfAB9naSyhgcuSqdF0v9pM8cfJbY+1323HVgeoc=; h=From:To:Subject:In-Reply-To:References:Date; b=fHR4m6ZKCgaRmqwag5kt1PWc7IcDeyG06BFtmMAWLRjHMLqkevupbGd8QT4CzGUEN lpq1JXvC9+VJr5/TZNxrGRHy2XFA2nGpBR3uyRAaobBm19gAm3bWQXc6yWFX3vseJs RO3q9qwUOT/bG7YCq5ISxH/7V3qlGXtqoN4HOS94= To: 50873@debbugs.gnu.org, Oleg Pykhalov , Andrew Tropin , Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: [PATCH v3 4/8] =?UTF-8?q?guix=20home:=20import:=20Don=E2=80=99t?= =?UTF-8?q?=20use=20'slurp-file-gexp'.?= In-Reply-To: References: Message-Id: Date: Sat, 30 Oct 2021 12:42:35 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 2.9 (++) 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: ‘slurp-file-gexp’ is not a bound procedure. * guix/scripts/home/import.scm (generate-bash-configuration+modules): Don’t use ‘slurp-file-gexp’. --- guix/scripts/home/import.scm | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions( [...] Content analysis details: (2.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches 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.5 FROM_SUSPICIOUS_NTLD From abused NTLD 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS 0.0 PDS_RDNS_DYNAMIC_FP RDNS_DYNAMIC with FP steps X-Debbugs-Envelope-To: 50873 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.9 (+) 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: ‘slurp-file-gexp’ is not a bound procedure. * guix/scripts/home/import.scm (generate-bash-configuration+modules): Don’t use ‘slurp-file-gexp’. --- guix/scripts/home/import.scm | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions( [...] Content analysis details: (1.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches 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.5 FROM_SUSPICIOUS_NTLD From abused NTLD 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager 0.0 PDS_RDNS_DYNAMIC_FP RDNS_DYNAMIC with FP steps =E2=80=98slurp-file-gexp=E2=80=99 is not a bound procedure. * guix/scripts/home/import.scm (generate-bash-configuration+modules): Don= =E2=80=99t use =E2=80=98slurp-file-gexp=E2=80=99. --- guix/scripts/home/import.scm | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/guix/scripts/home/import.scm b/guix/scripts/home/import.scm index f20088aa88..0e7c454f45 100644 --- a/guix/scripts/home/import.scm +++ b/guix/scripts/home/import.scm @@ -47,24 +47,19 @@ (define (destination-append path) (home-bash-configuration ,@(if (file-exists? rc) `((bashrc - (list (slurp-file-gexp - (local-file ,rc))))) + (list (local-file ,rc)))) '()) ,@(if (file-exists? profile) `((bash-profile - (list (slurp-file-gexp - (local-file ,profile))))) + (list (local-file ,profile)))) '()) ,@(if (file-exists? logout) `((bash-logout - (list (slurp-file-gexp - (local-file ,logout))))) + (list (local-file ,logout)))) '()))) (guix gexp) (gnu home services shells)))) =20 - - (define %files+configurations-alist `((".bashrc" . ,generate-bash-configuration+modules) (".bash_profile" . ,generate-bash-configuration+modules) --=20 2.33.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 30 06:42:45 2021 Received: (at 50873) by debbugs.gnu.org; 30 Oct 2021 10:42:45 +0000 Received: from localhost ([127.0.0.1]:56726 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgloz-0002aC-7t for submit@debbugs.gnu.org; Sat, 30 Oct 2021 06:42:45 -0400 Received: from h87-96-130-155.cust.a3fiber.se ([87.96.130.155]:59288 helo=mail.yoctocell.xyz) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mglow-0002Ym-2u for 50873@debbugs.gnu.org; Sat, 30 Oct 2021 06:42:43 -0400 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yoctocell.xyz; s=mail; t=1635590561; bh=znJE00iO9gzUCIF4qyxUh7oFJv91ZF0FUK+bRp9Ha+g=; h=From:To:Subject:In-Reply-To:References:Date; b=Mm3OkShhUNuj1POfqFUIJQ6TTyMk3xyjg4YdIRv/8qNChI1QtRKzzhXD566DCQaCP TB7TrwuOwfoei01FBs8YKFzJakkm6dQVPsu2xzjKlb67g1t0Ag9bMhAjDrMtGavivW LXxyvFBJsZG85RwZ8Ad45OiJ/uaEEi4kI3i/hOxE= To: 50873@debbugs.gnu.org, Oleg Pykhalov , Andrew Tropin , Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: [PATCH v3 7/8] =?UTF-8?q?Add=20tests=20for=20=E2=80=98guix=20home?= =?UTF-8?q?=20import=E2=80=99.?= In-Reply-To: References: Message-Id: <92b43fa1b99c1f3c65d3985fa99579fb82b43ca8.1635590221.git.public@yoctocell.xyz> Date: Sat, 30 Oct 2021 12:42:41 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 2.9 (++) 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: * tests/home-import.scm: New file. * Makefile.am (SCM_TESTS): Add it. --- Makefile.am | 1 + guix/scripts/home/import.scm | 7 +- tests/home-import.scm | 179 +++++++++++++++++++++++++++++++++++ 3 files [...] Content analysis details: (2.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches 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.5 FROM_SUSPICIOUS_NTLD From abused NTLD 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS 0.0 PDS_RDNS_DYNAMIC_FP RDNS_DYNAMIC with FP steps X-Debbugs-Envelope-To: 50873 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.9 (+) 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: * tests/home-import.scm: New file. * Makefile.am (SCM_TESTS): Add it. --- Makefile.am | 1 + guix/scripts/home/import.scm | 7 +- tests/home-import.scm | 179 +++++++++++++++++++++++++++++++++++ 3 files [...] Content analysis details: (1.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches 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.5 FROM_SUSPICIOUS_NTLD From abused NTLD 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager 0.0 PDS_RDNS_DYNAMIC_FP RDNS_DYNAMIC with FP steps * tests/home-import.scm: New file. * Makefile.am (SCM_TESTS): Add it. --- Makefile.am | 1 + guix/scripts/home/import.scm | 7 +- tests/home-import.scm | 179 +++++++++++++++++++++++++++++++++++ 3 files changed, 186 insertions(+), 1 deletion(-) create mode 100644 tests/home-import.scm diff --git a/Makefile.am b/Makefile.am index 239387c2f4..d608b08899 100644 --- a/Makefile.am +++ b/Makefile.am @@ -475,6 +475,7 @@ SCM_TESTS =3D \ tests/graph.scm \ tests/gremlin.scm \ tests/hackage.scm \ + tests/home-import.scm \ tests/import-git.scm \ tests/import-utils.scm \ tests/inferior.scm \ diff --git a/guix/scripts/home/import.scm b/guix/scripts/home/import.scm index f0ae233b75..6e3ed065d5 100644 --- a/guix/scripts/home/import.scm +++ b/guix/scripts/home/import.scm @@ -27,7 +27,10 @@ (define-module (guix scripts home import) #:use-module (ice-9 pretty-print) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) - #:export (import-manifest)) + #:export (import-manifest + + ;; For tests. + manifest->code)) =20 ;;; Commentary: ;;; @@ -36,6 +39,8 @@ (define-module (guix scripts home import) ;;; ;;; Code: =20 + + (define (generate-bash-configuration+modules destination-directory) (define (destination-append path) (string-append destination-directory "/" path)) diff --git a/tests/home-import.scm b/tests/home-import.scm new file mode 100644 index 0000000000..a4e71fa698 --- /dev/null +++ b/tests/home-import.scm @@ -0,0 +1,179 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright =C2=A9 2021 Xinglu Chen . + +(define-module (test-home-import) + #:use-module (guix scripts home import) + #:use-module (guix utils) + #:use-module (guix build utils) + #:use-module (guix packages) + #:use-module (ice-9 match) + #:use-module ((guix profiles) #:hide (manifest->code)) + #:use-module ((guix build syscalls) #:select (mkdtemp!)) + #:use-module (gnu packages) + #:use-module (srfi srfi-1) + #:use-module (srfi srfi-26) + #:use-module (srfi srfi-64)) + +;; Test the (guix scripts home import) tools. + +(test-begin "home-import") + +;; Example manifest entries. + +(define guile-2.0.9 + (manifest-entry + (name "guile") + (version "2.0.9") + (item "/gnu/store/..."))) + +(define glibc + (manifest-entry + (name "glibc") + (version "2.19") + (item "/gnu/store/..."))) + +(define gcc + (manifest-entry + (name "gcc") + (version "10.3.0") + (item "/gnu/store/..."))) + +;; Helpers for checking and generating home environments. + +(define %destination-directory "/tmp/guix-config") +(mkdir-p %destination-directory) + +(define %temporary-home-directory (mkdtemp! "/tmp/guix-home-import.XXXXXX"= )) + +(define-syntax-rule (define-home-environment-matcher name pattern) + (define (name obj) + (match obj + (pattern #t) + (x (pk 'fail x #f))))) + +(define (create-temporary-home files-alist) + "Create a temporary home directory in '%temporary-home-directory'. +FILES-ALIST is an association list of files and the content of the +corresponding file." + (define (create-file file content) + (let ((absolute-path (string-append %temporary-home-directory "/" file= ))) + (unless (file-exists? absolute-path) + (mkdir-p (dirname absolute-path))) + (call-with-output-file absolute-path + (cut display content <>)))) + + (for-each (match-lambda + ((file . content) (create-file file content))) + files-alist)) + +;; Copied from (guix profiles) +(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 ENTR= Y. + "") + (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 used + ;; 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))))))) + +(define (eval-test-with-home-environment files-alist manifest matcher) + (create-temporary-home files-alist) + (setenv "HOME" %temporary-home-directory) + (mkdir-p %temporary-home-directory) + (let* ((home-environment (manifest->code manifest %destination-directory + #:entry-package-version version= -spec + #:home-environment? #t)) + (result (matcher home-environment))) + (delete-file-recursively %temporary-home-directory) + result)) + +(define-home-environment-matcher match-home-environment-no-services + ('begin + ('use-modules + ('gnu 'home) + ('gnu 'packages) + ('gnu 'services)) + ('home-environment + ('packages + ('map 'specification->package + ('list "guile@2.0.9" "gcc" "glibc@2.19"))) + ('services + ('list))))) + +(define-home-environment-matcher match-home-environment-no-services-nor-pa= ckages + ('begin + ('use-modules + ('gnu 'home) + ('gnu 'packages) + ('gnu 'services)) + ('home-environment + ('packages + ('map 'specification->package + ('list))) + ('services + ('list))))) + +(define-home-environment-matcher match-home-environment-bash-service + ('begin + ('use-modules + ('gnu 'home) + ('gnu 'packages) + ('gnu 'services) + ('guix 'gexp) + ('gnu 'home 'services 'shells)) + ('home-environment + ('packages + ('map 'specification->package + ('list))) + ('services + ('list ('service + 'home-bash-service-type + ('home-bash-configuration + ('bashrc + ('list ('local-file "/tmp/guix-config/.bashrc")))))))))) + +(test-assert "manifest->code: No services" + (eval-test-with-home-environment + '() + (make-manifest (list guile-2.0.9 gcc glibc)) + match-home-environment-no-services)) + +(test-assert "manifest->code: No packages nor services" + (eval-test-with-home-environment + '() + (make-manifest '()) + match-home-environment-no-services-nor-packages)) + +(test-assert "manifest->code: Bash service" + (eval-test-with-home-environment + '((".bashrc" . "echo 'hello guix'")) + (make-manifest '()) + match-home-environment-bash-service)) + +(test-end "home-import") --=20 2.33.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 30 06:42:46 2021 Received: (at 50873) by debbugs.gnu.org; 30 Oct 2021 10:42:46 +0000 Received: from localhost ([127.0.0.1]:56728 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgloz-0002aL-Pa for submit@debbugs.gnu.org; Sat, 30 Oct 2021 06:42:46 -0400 Received: from h87-96-130-155.cust.a3fiber.se ([87.96.130.155]:59332 helo=mail.yoctocell.xyz) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mglow-0002Z6-SY for 50873@debbugs.gnu.org; Sat, 30 Oct 2021 06:42:43 -0400 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yoctocell.xyz; s=mail; t=1635590557; bh=Hd1VakLjtxnp6jV7Q0I9BKs8lo/pxC+h662NKXyuRvs=; h=From:To:Subject:In-Reply-To:References:Date; b=lB4qnlY62dSgSMO87xm7ZwTFDkyuiCZZBFoLQA8UV0Kqs41WmGt9dQfVXGPv+AqCb 5OB0pODejG0IK6RYpDcfGSlGJ6aOPESfR/Gpa0LPjdSpZVfgyUtRAttn+5V66bM3Z6 OzlCpTp2y3j3xNoUKePM83Ax9Tklz15aD5QCFA24= To: 50873@debbugs.gnu.org, Oleg Pykhalov , Andrew Tropin , Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: [PATCH v3 5/8] guix home: import: Delete duplicate modules when importing. In-Reply-To: References: Message-Id: <40ca56d2d949f7a56bce56d1221396fb85e57a4d.1635590221.git.public@yoctocell.xyz> Date: Sat, 30 Oct 2021 12:42:37 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 2.9 (++) 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: Two different services might require the same module(s), so delete duplicates when generating the ‘use-modules’ form. * import.scm (manifest->code): Delete duplicate modules. --- guix/scripts/home/import.scm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) Content analysis details: (2.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches 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.5 FROM_SUSPICIOUS_NTLD From abused NTLD 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS 0.0 PDS_RDNS_DYNAMIC_FP RDNS_DYNAMIC with FP steps X-Debbugs-Envelope-To: 50873 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.9 (+) 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: Two different services might require the same module(s), so delete duplicates when generating the ‘use-modules’ form. * import.scm (manifest->code): Delete duplicate modules. --- guix/scripts/home/import.scm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) Content analysis details: (1.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches 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.5 FROM_SUSPICIOUS_NTLD From abused NTLD 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager 0.0 PDS_RDNS_DYNAMIC_FP RDNS_DYNAMIC with FP steps Two different services might require the same module(s), so delete duplicat= es when generating the =E2=80=98use-modules=E2=80=99 form. * import.scm (manifest->code): Delete duplicate modules. --- guix/scripts/home/import.scm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/guix/scripts/home/import.scm b/guix/scripts/home/import.scm index 0e7c454f45..f0ae233b75 100644 --- a/guix/scripts/home/import.scm +++ b/guix/scripts/home/import.scm @@ -145,7 +145,8 @@ (define (qualified-name entry) (use-modules (gnu home) (gnu packages) (gnu services) - ,@(concatenate (map cdr configurations+modul= es))) + ,@((compose delete-duplicates concatenate) + (map cdr configurations+modules))) ,(home-environment-template #:specs specs #:services (map first configurations+modules)))) @@ -190,7 +191,8 @@ (define name (gnu home) (gnu packages) (gnu services) - ,@(concatenate (map cdr configurations+modul= es))) + ,@((compose delete-duplicates concatenate) + (map cdr configurations+modules))) =20 ,@transformations =20 --=20 2.33.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 30 06:43:32 2021 Received: (at 50873) by debbugs.gnu.org; 30 Oct 2021 10:43:32 +0000 Received: from localhost ([127.0.0.1]:56739 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mglpk-0002ce-4d for submit@debbugs.gnu.org; Sat, 30 Oct 2021 06:43:32 -0400 Received: from h87-96-130-155.cust.a3fiber.se ([87.96.130.155]:59378 helo=mail.yoctocell.xyz) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mglp4-0002a4-4g for 50873@debbugs.gnu.org; Sat, 30 Oct 2021 06:42:50 -0400 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yoctocell.xyz; s=mail; t=1635590564; bh=UfY9+sc2B8doB9Z7PPiKrSE05DUz+hLQryKoFe2kmWc=; h=From:To:Subject:In-Reply-To:References:Date; b=lipI8QytGuzGQ5MvkifBXAi9tSO6TbR2UQETHykOfPV9AZoKCxBCgfdfoRgA42r7Y 6Pado9K6ZvIrc8fCf16na9btlmm/7KX5ABXviJpcbPf+t+rpqCOl3vXkrUluQh6pr/ RV09E/LYxN1qxGswFvvja0hv3ulR5naVVVxrWj60= To: 50873@debbugs.gnu.org, Oleg Pykhalov , Andrew Tropin , Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: [PATCH v3 8/8] =?UTF-8?q?guix=20home:=20import:=20Call=20?= =?UTF-8?q?=E2=80=98local-file=E2=80=99=20with=20=E2=80=98name=E2=80=99=20?= In-Reply-To: References: Message-Id: <19dd061d4f7a3aab24ecb660df01e3c6613d4ae7.1635590221.git.public@yoctocell.xyz> Date: Sat, 30 Oct 2021 12:42:44 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 2.9 (++) 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: Set the name of the file to just the basename of the file passed to ‘local-file’. * guix/scripts/home/import.scm (basename+remove-dots): New procedure. (generate-bash-configuration+modules): Use it. * tests/home-import.scm (match-home-environment-bash-service): Adjust accordingly. [...] Content analysis details: (2.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches 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.5 FROM_SUSPICIOUS_NTLD From abused NTLD 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS 0.0 PDS_RDNS_DYNAMIC_FP RDNS_DYNAMIC with FP steps X-Debbugs-Envelope-To: 50873 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.9 (+) 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: Set the name of the file to just the basename of the file passed to ‘local-file’. * guix/scripts/home/import.scm (basename+remove-dots): New procedure. (generate-bash-configuration+modules): Use it. * tests/home-import.scm (match-home-environment-bash-service): Adjust accordingly. [...] Content analysis details: (1.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches 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.5 FROM_SUSPICIOUS_NTLD From abused NTLD 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager 0.0 PDS_RDNS_DYNAMIC_FP RDNS_DYNAMIC with FP steps Set the name of the file to just the basename of the file passed to =E2=80=98local-file=E2=80=99. * guix/scripts/home/import.scm (basename+remove-dots): New procedure. (generate-bash-configuration+modules): Use it. * tests/home-import.scm (match-home-environment-bash-service): Adjust accordingly. --- guix/scripts/home/import.scm | 20 ++++++++++++++++---- tests/home-import.scm | 3 ++- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/guix/scripts/home/import.scm b/guix/scripts/home/import.scm index 6e3ed065d5..a0022458f6 100644 --- a/guix/scripts/home/import.scm +++ b/guix/scripts/home/import.scm @@ -39,7 +39,16 @@ (define-module (guix scripts home import) ;;; ;;; Code: =20 - +(define (basename+remove-dots file-name) + "Remove the dot from the dotfile FILE-NAME; replace the other dots in +FILE-NAME with \"-\", and return the basename of it." + (string-map (match-lambda + (#\. #\-) + (c c)) + (let ((base (basename file-name))) + (if (string-prefix? "." base) + (string-drop base 1) + base)))) =20 (define (generate-bash-configuration+modules destination-directory) (define (destination-append path) @@ -52,15 +61,18 @@ (define (destination-append path) (home-bash-configuration ,@(if (file-exists? rc) `((bashrc - (list (local-file ,rc)))) + (list (local-file ,rc + ,(basename+remove-dots rc))))) '()) ,@(if (file-exists? profile) `((bash-profile - (list (local-file ,profile)))) + (list (local-file ,profile + ,(basename+remove-dots profile)= )))) '()) ,@(if (file-exists? logout) `((bash-logout - (list (local-file ,logout)))) + (list (local-file ,logout + ,(basename+remove-dots logout))= ))) '()))) (guix gexp) (gnu home services shells)))) diff --git a/tests/home-import.scm b/tests/home-import.scm index a4e71fa698..d2f5728e3c 100644 --- a/tests/home-import.scm +++ b/tests/home-import.scm @@ -156,7 +156,8 @@ (define-home-environment-matcher match-home-environment= -bash-service 'home-bash-service-type ('home-bash-configuration ('bashrc - ('list ('local-file "/tmp/guix-config/.bashrc")))))))))) + ('list ('local-file "/tmp/guix-config/.bashrc" + "bashrc")))))))))) =20 (test-assert "manifest->code: No services" (eval-test-with-home-environment --=20 2.33.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 30 07:50:49 2021 Received: (at 50873) by debbugs.gnu.org; 30 Oct 2021 11:50:49 +0000 Received: from localhost ([127.0.0.1]:56802 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgmsr-0000No-HQ for submit@debbugs.gnu.org; Sat, 30 Oct 2021 07:50:49 -0400 Received: from lepiller.eu ([89.234.186.109]:37218) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgmsp-0000NY-A8 for 50873@debbugs.gnu.org; Sat, 30 Oct 2021 07:50:48 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id 8e0863da; Sat, 30 Oct 2021 11:50:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=date:from :to:cc:subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=dkim; bh=YPvb7CMLDeIm iYElxJJrzRowfNCf4ZcNa8ofM+9z2V4=; b=anRzZF+O5Z7ik6qlR8+umRuphQ78 ADDZw3MlNQGqy3/vDsputgJb3enjIddQz3ovl23hPNz2ZsZM3NEbQ+m6tjXNcrno So0V23G4GZWPxlGFGVn8YZESrIDqEFGlSWq+zeILyb+2awHmxRJTXGD25ZjJNO/U nuENZ4Pl/MZC6irNJ6gTVDSYHLW4C5on7c+cT54O6/FaHKFKN8Sz/9/o0NFNs5Gf 7igjtpXvThNHYUnMXIIN1eIvT3NAnmSw+7v0k6/HkhQm3dMQEAeduNfD6k5H6Mcw 1nWQpMBAuq9r5/YbLLGVgAJQFaFHyzt9cBZAEQPEJw8xzMAh5bbJDJURoQ== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 22b4dc70 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Sat, 30 Oct 2021 11:50:36 +0000 (UTC) Date: Sat, 30 Oct 2021 13:50:29 +0200 From: Julien Lepiller To: Xinglu Chen Subject: Re: [bug#50873] [PATCH v3 3/8] guix home: import: Fix module name for Bash service. Message-ID: <20211030135029.674986c9@tachikoma.lepiller.eu> In-Reply-To: References: X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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: Le Sat, 30 Oct 2021 12:42:34 +0200, Xinglu Chen a écrit : > * guix/scripts/home/import.scm (generate-bash-configuration+modules): > Change (gnu home-services bash) to (gnu home-services shells); add > (guix gexp). --- > guix/scripts/home/import.scm | 3 ++- > [...] Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: yoctocell.xyz (xyz)] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record X-Debbugs-Envelope-To: 50873 Cc: Oleg Pykhalov , Ludovic =?UTF-8?B?Q291cnTDqHM=?= , 50873@debbugs.gnu.org, Andrew Tropin 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 (+) Le Sat, 30 Oct 2021 12:42:34 +0200, Xinglu Chen a =C3=A9crit : > * guix/scripts/home/import.scm (generate-bash-configuration+modules): > Change (gnu home-services bash) to (gnu home-services shells); add > (guix gexp). --- > guix/scripts/home/import.scm | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) >=20 > diff --git a/guix/scripts/home/import.scm > b/guix/scripts/home/import.scm index 533abdbb8d..f20088aa88 100644 > --- a/guix/scripts/home/import.scm > +++ b/guix/scripts/home/import.scm > @@ -60,7 +60,8 @@ (define (destination-append path) > (list (slurp-file-gexp > (local-file ,logout))))) > '()))) > - (gnu home-services bash)))) > + (guix gexp) > + (gnu home services shells)))) > =20 > =20 > =20 I got bit by this one yesterday, it's great you could fix it! :) From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 30 10:17:18 2021 Received: (at 50873) by debbugs.gnu.org; 30 Oct 2021 14:17:18 +0000 Received: from localhost ([127.0.0.1]:58091 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgpAb-0002xH-PY for submit@debbugs.gnu.org; Sat, 30 Oct 2021 10:17:18 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33338) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgpAZ-0002wy-4b for 50873@debbugs.gnu.org; Sat, 30 Oct 2021 10:17:15 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:54264) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mgpAP-0004sW-MC; Sat, 30 Oct 2021 10:17:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=ckgQ7GghcZaGGzfG90B7exttexv3NxyL8N5k5aDIB3I=; b=nWiaHTBbYd8Q6DRcl2lB 4HKMKTzUes974kKHxG255s12NIsfzOctK86ZGsTOekVmDpRBOO1FZshTJRvUCVbgEmRveVO1E+5hv rLoNdkPE8g/KNM5hE0xqYyy3qtA/KTMlRMvyIF7LmELMQPyi2znEGZrC9zD4IAOzU/wxC6+CEJUWK d7OOvgiiCy0OflqZTFEdWrYhpj07kZgjImxXFx1sv246G7Vp8oeXUkKJJxMBSmnzoH7OTGHMms5Zd DGi/SwuRn2LRgAz5JvgRVoXMDs+8eol9ZleBim8yT4C1+qvWmULNYKNzF00jSgHJ8B6vbraY8/8g3 G9rjOh32HeHoiw==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:55482 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mgpAP-00089R-A2; Sat, 30 Oct 2021 10:17:05 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Xinglu Chen Subject: Re: bug#50873: [PATCH 0/5] Fixes to =?utf-8?Q?=E2=80=98guix?= home =?utf-8?Q?import=E2=80=99?= References: <197cab14424f4d28ece9e80981d2a4e142dc4791.1633861021.git.public@yoctocell.xyz> <87mtnf1zt0.fsf_-_@gmail.com> <87sfwk7xiw.fsf@disroot.org> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 9 Brumaire an 230 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Sat, 30 Oct 2021 16:17:02 +0200 In-Reply-To: <87sfwk7xiw.fsf@disroot.org> (Xinglu Chen's message of "Fri, 29 Oct 2021 15:47:51 +0200") Message-ID: <87sfwitx5t.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.3 (/) X-Debbugs-Envelope-To: 50873 Cc: Oleg Pykhalov , 50873@debbugs.gnu.org, Andrew Tropin 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.3 (-) Hi, Xinglu Chen skribis: > On Mon, Oct 11 2021, Oleg Pykhalov wrote: > >> Hi, >> >> Xinglu Chen writes: >> >> [=E2=80=A6] >> >>> +;; Helpers for checking and generating home environments. >>> + >>> +(%destination-directory "/tmp/guix-config") >>> +(mkdir-p (%destination-directory)) >>> + >>> +(define %temporary-home-directory "/tmp/guix-home-import-test") >> >> Better use temporary directory like in tests/opam.scm. >> >> --8<---------------cut here---------------start------------->8--- >> (define-module ... >> #:use-module ((guix build syscalls) #:select (mkdtemp!)) >> ...) >> >> (mkdtemp! "/tmp/guix-home-import-test.XXXXXX") >> --8<---------------cut here---------------end--------------->8--- > > Good idea. Out of curiosity: is there any difference between =E2=80=98mk= dtemp!=E2=80=99 > and =E2=80=98mkdtemp=E2=80=99 that=E2=80=99s part of Guile? =E2=80=98mkdtemp=E2=80=99 is new in Guile 3.0.6 but Guix can be built with = an older version. Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 30 10:22:24 2021 Received: (at 50873) by debbugs.gnu.org; 30 Oct 2021 14:22:24 +0000 Received: from localhost ([127.0.0.1]:58105 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgpFY-000372-9R for submit@debbugs.gnu.org; Sat, 30 Oct 2021 10:22:24 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:55024) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgpFW-00036m-Gg for 50873@debbugs.gnu.org; Sat, 30 Oct 2021 10:22:22 -0400 Received: by mail-wm1-f66.google.com with SMTP id 71so7949101wma.4 for <50873@debbugs.gnu.org>; Sat, 30 Oct 2021 07:22:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=iMNYWMswAm6t3M4YEihHEond+pGWiXFCdW+DKnjP0ss=; b=lFPd0AuPHEb0iDVAXAH1sc22tak8dThWBjYxAGtGmD91eJlakqX7y6DjDaqVkQ8K27 ztbVg3itiR03t/3MxQBHLlvMGaYAzdWSc11sL0NJpfw37EK5jJ+A+IDP9q5+Glgbg1OI ZxuDsXRJXbZa6wUNk756VEZzb36uNaVwj+AuDTrANq+VHPkA5ExyAwtFNBZTfTyq9ihM LjxsVvsojpviP/AxghtqMFFHouz3ivThlN+sDKDIU/6z1jlcdT75rIUzcZ5nDwpXiCn6 bSORqoEqiK0TFFfUPvLTkuYACo4IEXnnjmcS4jDSCsSLJdldgZarN5CcbKvzzBwvXpsg esJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=iMNYWMswAm6t3M4YEihHEond+pGWiXFCdW+DKnjP0ss=; b=S978JmpyrhN/AZX6w0aKxbvkc3bZdUea3gt1IZwI99O6C20nTY9R5ChtLZRxN94vI4 vZiqsYZoP004otAkrhCNkFGVvXvyQxBlsFHQdVNpLE8vZa4nEU87pu8/W8cxkCXX1etf uq38/1Bha0tOw5B9EIeyA6MM4z32lYCXm0Ww46rncBwbMcqp2AHHjSrnk6jDLqQEhQI4 rlKimyiGrrA8ejFWs7JBZ7XjvSt+auN7nFazHUVgVkPEb15ANy/qxg8D1P6ppZ4gZ5v6 8A0NLuClpZuRe7SjBtcbJc40uCXINoN64vMKr9QBnUpzeotMMwtEw0NhyOt98PXskho+ karA== X-Gm-Message-State: AOAM533GogsJ5FAX1Q/12WqEm3NoIBrVtv7q15gCS95YuBU0QA4Pw8uG jK6Va6UEPI1zSfTpKCF/XCc= X-Google-Smtp-Source: ABdhPJx46UsqlWddgkyxQxgla4TDlteiiaae/elFrNamSXD6XXkPy/cscuNKvitPgdNeA+COj0D1qA== X-Received: by 2002:a1c:2507:: with SMTP id l7mr26163824wml.186.1635603736736; Sat, 30 Oct 2021 07:22:16 -0700 (PDT) Received: from nijino.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id u10sm10847657wrs.5.2021.10.30.07.22.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Oct 2021 07:22:16 -0700 (PDT) Message-ID: <56a9f6fba40556abd5eae450b565b9b32129861c.camel@gmail.com> Subject: Re: [PATCH v3 1/8] guix home: import: Make the user to specify a destination directory. From: Liliana Marie Prikler To: Xinglu Chen , 50873@debbugs.gnu.org, Oleg Pykhalov , Andrew Tropin , Ludovic =?ISO-8859-1?Q?Court=E8s?= Date: Sat, 30 Oct 2021 16:22:14 +0200 In-Reply-To: <4b3eb05f3fb1bfbd3e7f16c3ba5862a603372df0.1635590221.git.public@yoctocell.xyz> References: <4b3eb05f3fb1bfbd3e7f16c3ba5862a603372df0.1635590221.git.public@yoctocell.xyz> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 50873 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, Am Samstag, den 30.10.2021, 12:42 +0200 schrieb Xinglu Chen: > Copy the appropriate the relevant configuration files to the > destination directory, and call ‘local-file’ on them. The name "destination directory" (especially in the form destination- directory) is both overly verbose and not really explanatory at all. Perhaps you might want to instead use "prefix" and have some reasonable default like ~/.config/guix/home – alternatively, since all these files are used in the same sense as /etc/skel, you could name it "skeleton" with an explanation along the lines of Existing configuration will be copied to SKELETON (default $HOME/.config/guix-home/skel). The name of this folder can be specified via --skeleton=DIRECTORY. If --no-create-skeleton is passed, /etc/skel will be used instead to at least initialize a bare- bones bash-service. WDYT? From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 30 19:01:41 2021 Received: (at 50873) by debbugs.gnu.org; 30 Oct 2021 23:01:42 +0000 Received: from localhost ([127.0.0.1]:58587 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgxM5-0005Bf-JO for submit@debbugs.gnu.org; Sat, 30 Oct 2021 19:01:41 -0400 Received: from eggs.gnu.org ([209.51.188.92]:58438) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgxM4-0005BS-3K for 50873@debbugs.gnu.org; Sat, 30 Oct 2021 19:01:40 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:35580) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mgxLx-0000z1-Ti; Sat, 30 Oct 2021 19:01:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=YlmlfY5zMivbgjEQoQlvmIM+4725nWKDZ/uuYPWLR8c=; b=AO8bLYvOzeHJZSr33rN6 J7h8cVUK0OjcSofyei6Kva+yS3WBitaxy1pPlBLOjcjkPYRTiv8u9Cqa0GSkyLQqK+3nC4rzAdgMm 6j24kdgP8qSwVz6WzxtXJ7IndnmFhVZPokNzhgz74lZqXMHVGvTGAu+/W/ms1RCnyCcJyvx2TAUcf v1KtUShz3Z1F8C9pFvAYpmDvNvQM3pQ+RIW2lY1YkYo4MUsIzzDmoSG1TLLnEs7ZuurXaRf9SXxdC zlAW2mQYlOvsUk5FhagpVkk9z8Tb3DDOG2RpHgXMDhMWtWgjD9vr6o6Vdd7xYriLxwYALuLTp7hlM ULUjP5RD1Y8WZw==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:55500 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mgxLx-0001qN-Hj; Sat, 30 Oct 2021 19:01:33 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Xinglu Chen Subject: Re: bug#50873: [PATCH 0/5] Fixes to =?utf-8?Q?=E2=80=98guix?= home =?utf-8?Q?import=E2=80=99?= References: Date: Sun, 31 Oct 2021 01:01:30 +0200 In-Reply-To: (Xinglu Chen's message of "Sat, 30 Oct 2021 12:42:21 +0200") Message-ID: <8735oirub9.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.3 (/) X-Debbugs-Envelope-To: 50873 Cc: Oleg Pykhalov , 50873@debbugs.gnu.org, Andrew Tropin 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.3 (-) Hi! Xinglu Chen skribis: > guix home: import: Make the user to specify a destination directory. > guix home: import: Allow multiple modules to be imported for each > service. > guix home: import: Fix module name for Bash service. > guix home: import: Don=E2=80=99t use 'slurp-file-gexp'. > guix home: import: Delete duplicate modules when importing. > doc: Document the =E2=80=98guix home import=E2=80=99 subcommand. > Add tests for =E2=80=98guix home import=E2=80=99. > guix home: import: Call =E2=80=98local-file=E2=80=99 with =E2=80=98name= =E2=80=99 argument. That=E2=80=99s a nice improvement. In the interest of moving forward, I ap= plied the whole series and followed up with a few changes: c4ac8cf4f6 doc: Mention 'guix home reconfigure' upfront. 971a69d8e3 doc: Avoid misuse of @ref. 7711a6c3f4 doc: Mention "guix home import" upfront. 6f4ca78761 home: import: Avoid duplication of 'manifest->code'. 96728c54df home: import: Factorize triplicated 'version-spec' procedure. f3933ae40d home: import: Clarify "destination directory". 341fba217f home: import: Compare procedures with 'eq?'. Part of it is about removing duplicated code, in particular =E2=80=98manifest->code=E2=80=99. It=E2=80=99s important to factorize non-= trivial code like this. The last commits improve documentation so users learn about =E2=80=98guix h= ome import=E2=80=99 when they get started. It=E2=80=99s really nice to have this tool! I find it perhaps a bit confus= ing to have to specify a target directory to =E2=80=98guix home import=E2=80=99= ; simply trying to document it shows that it=E2=80=99s non-obvious. I wonder if the argument should be optional (in which case the files wouldn=E2=80=99t be copied). But then people are likely to run into the problems this addresses. Or perhaps it would be more consistent to have: guix home import ~/foo create ~/foo/config.scm, instead of printing it to stdout? The documentation would be clearer: =E2=80=9Cpopulate ~/foo with all the configuration files of your home environment.=E2=80=9D Thoughts? Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 30 19:01:53 2021 Received: (at control) by debbugs.gnu.org; 30 Oct 2021 23:01:53 +0000 Received: from localhost ([127.0.0.1]:58591 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgxMG-0005C7-T0 for submit@debbugs.gnu.org; Sat, 30 Oct 2021 19:01:53 -0400 Received: from eggs.gnu.org ([209.51.188.92]:58476) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgxMF-0005Bu-10 for control@debbugs.gnu.org; Sat, 30 Oct 2021 19:01:51 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:35588) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mgxM9-00014K-Og for control@debbugs.gnu.org; Sat, 30 Oct 2021 19:01:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:Subject:From:To:Date:in-reply-to: references; bh=d5wm+uZMwR3Gu/cePWwjnXmhrjB9wP33ijwydWe9YVA=; b=BIObnzn5SKDw30 G9umpb7VjBJKYlg+BcO99Q2j/F/IAeiX8+L34HJh6C47WZwV+vYzrlsfUohsI7n4v3ZrAFjB6thgJ 0bWFYwLf4ia5/yQSWbUoERNQAMN1oUxz4GD2PRWjrkLRtwKyHJGV2fnoL8e0rh6wqtNniu1xjeozD GCYEO4a6T9//2Qnj3PdQU25BOCZGlaSjC600Wd3lbayuOzaXCDp3YXRHTVTRreoLZzpm0dKx05/ys YFFymj9vzZlhopTm22luoWErm9PjDxahMi0YhtUVFiKlmfIPp3E151+G+OJabnoBclw1fRVfOkoSY uw4b+ASzOaEHcY//LAIg==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:55502 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mgxM8-0002YK-Ju for control@debbugs.gnu.org; Sat, 30 Oct 2021 19:01:45 -0400 Date: Sun, 31 Oct 2021 01:01:43 +0200 Message-Id: <871r42ruaw.fsf@gnu.org> To: control@debbugs.gnu.org From: =?utf-8?Q?Ludovic_Court=C3=A8s?= Subject: control message for bug #50873 MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) close 50873 quit From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 31 13:38:58 2021 Received: (at 50873) by debbugs.gnu.org; 31 Oct 2021 17:38:58 +0000 Received: from localhost ([127.0.0.1]:33053 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mhEnK-0007IL-4r for submit@debbugs.gnu.org; Sun, 31 Oct 2021 13:38:58 -0400 Received: from h87-96-130-155.cust.a3fiber.se ([87.96.130.155]:43594 helo=mail.yoctocell.xyz) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mhEnH-0007I8-OR for 50873@debbugs.gnu.org; Sun, 31 Oct 2021 13:38:56 -0400 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yoctocell.xyz; s=mail; t=1635701929; bh=uQb72NpYKp5/ke1xhJpYhktatfNrfRAjbWsnyK9p5AA=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=F2i3dKuFdqonWZSorOn7aKR/Ls82nylA5skGDYDPJhHCYwNDktZXzo4tgQUPgGHco x4Z3cOV0NHV5vPAVSgm4X2mrksX6o5/liSF0BzYVHZWTABSRIyIOaBlTyjII7P0NxX VIlON2FgpWQnA09Alsz6W5ZSWzmvdRqxF0TR25rA= To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: [bug#50873] [PATCH 0/5] Fixes to =?utf-8?Q?=E2=80=98guix?= home =?utf-8?Q?import=E2=80=99?= In-Reply-To: <8735oirub9.fsf_-_@gnu.org> References: <8735oirub9.fsf_-_@gnu.org> Date: Sun, 31 Oct 2021 18:38:37 +0100 Message-ID: <878ry96qn6.fsf@disroot.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Spam-Score: 2.9 (++) 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: Hi, On Sun, Oct 31 2021, Ludovic Courtès wrote: > Hi! > > Xinglu Chen skribis: > >> guix home: import: Make the user to specify a destination directory. >> guix home: import: Allow multiple modules to be imported for each >> [...] Content analysis details: (2.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches 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.5 FROM_SUSPICIOUS_NTLD From abused NTLD 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS 0.0 PDS_RDNS_DYNAMIC_FP RDNS_DYNAMIC with FP steps X-Debbugs-Envelope-To: 50873 Cc: Oleg Pykhalov , 50873@debbugs.gnu.org, Andrew Tropin 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: 2.9 (++) 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: Hi, On Sun, Oct 31 2021, Ludovic Courtès wrote: > Hi! > > Xinglu Chen skribis: > >> guix home: import: Make the user to specify a destination directory. >> guix home: import: Allow multiple modules to be imported for each >> [...] Content analysis details: (2.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches 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.5 FROM_SUSPICIOUS_NTLD From abused NTLD 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS 1.0 BULK_RE_SUSP_NTLD Precedence bulk and RE: from a suspicious TLD -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager 0.0 PDS_RDNS_DYNAMIC_FP RDNS_DYNAMIC with FP steps --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi, On Sun, Oct 31 2021, Ludovic Court=C3=A8s wrote: > Hi! > > Xinglu Chen skribis: > >> guix home: import: Make the user to specify a destination directory. >> guix home: import: Allow multiple modules to be imported for each >> service. >> guix home: import: Fix module name for Bash service. >> guix home: import: Don=E2=80=99t use 'slurp-file-gexp'. >> guix home: import: Delete duplicate modules when importing. >> doc: Document the =E2=80=98guix home import=E2=80=99 subcommand. >> Add tests for =E2=80=98guix home import=E2=80=99. >> guix home: import: Call =E2=80=98local-file=E2=80=99 with =E2=80=98nam= e=E2=80=99 argument. > > That=E2=80=99s a nice improvement. In the interest of moving forward, I = applied > the whole series and followed up with a few changes: > > c4ac8cf4f6 doc: Mention 'guix home reconfigure' upfront. > 971a69d8e3 doc: Avoid misuse of @ref. > 7711a6c3f4 doc: Mention "guix home import" upfront. > 6f4ca78761 home: import: Avoid duplication of 'manifest->code'. > 96728c54df home: import: Factorize triplicated 'version-spec' procedure. > f3933ae40d home: import: Clarify "destination directory". > 341fba217f home: import: Compare procedures with 'eq?'. > > Part of it is about removing duplicated code, in particular > =E2=80=98manifest->code=E2=80=99. It=E2=80=99s important to factorize no= n-trivial code like > this. > > The last commits improve documentation so users learn about =E2=80=98guix= home > import=E2=80=99 when they get started. Thanks for taking care of this! > It=E2=80=99s really nice to have this tool! I find it perhaps a bit conf= using > to have to specify a target directory to =E2=80=98guix home import=E2=80= =99; simply > trying to document it shows that it=E2=80=99s non-obvious. > > I wonder if the argument should be optional (in which case the files > wouldn=E2=80=99t be copied). But then people are likely to run into the > problems this addresses. Yeah, that could be a bit confusing for people. > Or perhaps it would be more consistent to have: > > guix home import ~/foo > > create ~/foo/config.scm, instead of printing it to stdout? > > The documentation would be clearer: =E2=80=9Cpopulate ~/foo with all the > configuration files of your home environment.=E2=80=9D Thoughts? I originally made it to print to stdout because that=E2=80=99s what the =E2= =80=98guix import=E2=80=99 commands do, but it could make sense to just populate a file directly. I don=E2=80=99t really have a strong opinion on this, so if nobo= dy has any objections, I could send a patch for this. :-) --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJJBAEBCAAzFiEEAVhh4yyK5+SEykIzrPUJmaL7XHkFAmF+1J0VHHB1YmxpY0B5 b2N0b2NlbGwueHl6AAoJEKz1CZmi+1x53s8P/087exvVYy0pcgXX0bbUOMHfsEV5 TIzKlQ+qraX1HFwvXHImEH1hcxTUlgDE/xPXTQ31yDdxR4HJMOIOzY0Jep57YNwv 5Pv9vJn+qOQL6regmlqzyKZNmYTFbQZtS2M7p6RTApKLZZl2HkpZbwV6Lt0oGyVA dnRhBfxPjm1m7rBMEInaReCNefLTrKM+Np4XiZodXZwdydmdKNEnz5rdX+eysKtc CEDm3NVH3GlOqlybpnaWDbPIBUagqSNRTRMf9i1VGsAsGcOSiqFidh+5OtpNdUb3 +eIr+CqJp0DbzsrvxOOR27+zCmBrh/fjbsktDd7E3OC4yEZSuM0TPy9u+BxkFZG3 kdBEQIwdlPOnKPnTvIzAr7FdggR/oyH1ESEtEMKRi66rgnVGnw/MqCygo9tb2iMA 5s4mRQZJF2yuc6cyPbnke05oySk1fb3IWYPivjkqwmBVKFRPXGcLdYXeFVyKgXi3 +SeYSC12ZCvoQI8V2lAdXOcm8IM8HguvNft3UCtiNLfj7SAmjkc38r6bvQSaIAXD wKMKmovlDHkscTptQAkEwHGESL1w05s1KAeUzcNWZuu4wwPm/TkPoENuAocSBqlm jq8FvaJ0A8/ly8CCRaZe0OoNxT7u+v0NAU1/FDnwngKv7hUP4ab3HKAGRaNu9I4o CVtX0fXFlw8sxoO1 =IqCp -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 01 02:31:50 2021 Received: (at 50873) by debbugs.gnu.org; 1 Nov 2021 06:31:50 +0000 Received: from localhost ([127.0.0.1]:33595 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mhQrG-0003mD-85 for submit@debbugs.gnu.org; Mon, 01 Nov 2021 02:31:50 -0400 Received: from mail-lf1-f50.google.com ([209.85.167.50]:44655) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mhQrD-0003lz-UN for 50873@debbugs.gnu.org; Mon, 01 Nov 2021 02:31:48 -0400 Received: by mail-lf1-f50.google.com with SMTP id y26so34319759lfa.11 for <50873@debbugs.gnu.org>; Sun, 31 Oct 2021 23:31:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop-in.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=1+qWmbcqvm/pUF5hdULnOHMj6MS70LNMfAF/nEWF0NI=; b=dFQwFAlu4cj8qOjKPJHNlbr4OupqPpCTOPwGSYFYb56NUNOn3S/bh8zctbtTf6SRO2 QsNIjFRCfTfo78Rr/FKd9zHkf3C1h9g+GE8zJv/ku4Dn5y6Au+RcnrDZ+CIqdXCsusPn M8HFw22I+r4ChOV6+N3sVJ14XkCobXtZ76p+E3paA9Gu049PNDEKtzHiM8qrF9WX+WIn XAJ/jbzAiLYMKU8UTTrof8+LosUiTGRuKK8ZMDUYmxHfEAb4od6wCpicdzceHzCtt6iM L0hUx+A67EHC/Vj7HobZFqryastYqR1lhWuM790QmD0IKrwthUP6GVYwPU6aqfEZ99eX Zw2g== 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=1+qWmbcqvm/pUF5hdULnOHMj6MS70LNMfAF/nEWF0NI=; b=bad5LF75+1VpYCS7LX+PvTG4EKo11oYno+g4KE2DACPHBl0nSAM//EM9TGhtZ1O79X 2f4SFMVpU4D5kS9y3VMas6U0zaosnY/aXm6w2AJ7lfUHAK7pZkGINIYtSZkSllTWTSDC VZzkLid+GydCi7fPJWM7bTfzWKtq7slJkPcatniSTqz5hG3uckohyIPhoxbNGNPpwTzW RGW8ESh92E1TpcJLVsundksqYxTRfC6DK2UM+W7MCerbjftd6UHjDtPzsIfJrXsipbpl qiernjTAJOQ/joVHGoq+Sq07X/3YZnoegi5w103BPjmV7dRcxdgLU/azFWLNxxw9GJUC bE7w== X-Gm-Message-State: AOAM533qCgIzEznHcPQAT5uqG56EEaDiMqCAv9mMitecueIyntvTZhIt h1/oZ8hEruWzCvkl+lAZRfIV+g== X-Google-Smtp-Source: ABdhPJwIKaYx547U2haZluMMzNu6lIGDdMwAAY1qjmj1Z0DMbNC7U6Gf0axRj1Mbjkuu6ttda49bhQ== X-Received: by 2002:a05:6512:20d:: with SMTP id a13mr6975513lfo.76.1635748301848; Sun, 31 Oct 2021 23:31:41 -0700 (PDT) Received: from localhost (109-252-140-132.dynamic.spd-mgts.ru. [109.252.140.132]) by smtp.gmail.com with ESMTPSA id b13sm1319009lfb.145.2021.10.31.23.31.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 31 Oct 2021 23:31:41 -0700 (PDT) From: Andrew Tropin To: Xinglu Chen , Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: [bug#50873] [PATCH 0/5] Fixes to =?utf-8?Q?=E2=80=98guix?= home =?utf-8?Q?import=E2=80=99?= In-Reply-To: <878ry96qn6.fsf@disroot.org> References: <8735oirub9.fsf_-_@gnu.org> <878ry96qn6.fsf@disroot.org> Date: Mon, 01 Nov 2021 09:31:37 +0300 Message-ID: <878ry8tmie.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-10-31 18:38, Xinglu Chen wrote: > Hi, > > On Sun, Oct 31 2021, Ludovic Courtès wrote: > >> Hi! >> >> Xinglu Chen skribis: >> >>> guix home: import: Make the user to specify a destination directory. >>> guix h [...] 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.50 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.167.50 listed in wl.mailspike.net] X-Debbugs-Envelope-To: 50873 Cc: Oleg Pykhalov , 50873@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-10-31 18:38, Xinglu Chen wrote: > Hi, > > On Sun, Oct 31 2021, Ludovic Court=C3=A8s wrote: > >> Hi! >> >> Xinglu Chen skribis: >> >>> guix home: import: Make the user to specify a destination directory. >>> guix home: import: Allow multiple modules to be imported for each >>> service. >>> guix home: import: Fix module name for Bash service. >>> guix home: import: Don=E2=80=99t use 'slurp-file-gexp'. >>> guix home: import: Delete duplicate modules when importing. >>> doc: Document the =E2=80=98guix home import=E2=80=99 subcommand. >>> Add tests for =E2=80=98guix home import=E2=80=99. >>> guix home: import: Call =E2=80=98local-file=E2=80=99 with =E2=80=98na= me=E2=80=99 argument. >> >> That=E2=80=99s a nice improvement. In the interest of moving forward, I= applied >> the whole series and followed up with a few changes: >> >> c4ac8cf4f6 doc: Mention 'guix home reconfigure' upfront. >> 971a69d8e3 doc: Avoid misuse of @ref. >> 7711a6c3f4 doc: Mention "guix home import" upfront. >> 6f4ca78761 home: import: Avoid duplication of 'manifest->code'. >> 96728c54df home: import: Factorize triplicated 'version-spec' procedur= e. >> f3933ae40d home: import: Clarify "destination directory". >> 341fba217f home: import: Compare procedures with 'eq?'. >> >> Part of it is about removing duplicated code, in particular >> =E2=80=98manifest->code=E2=80=99. It=E2=80=99s important to factorize n= on-trivial code like >> this. >> >> The last commits improve documentation so users learn about =E2=80=98gui= x home >> import=E2=80=99 when they get started. > > Thanks for taking care of this! > >> It=E2=80=99s really nice to have this tool! I find it perhaps a bit con= fusing >> to have to specify a target directory to =E2=80=98guix home import=E2=80= =99; simply >> trying to document it shows that it=E2=80=99s non-obvious. >> >> I wonder if the argument should be optional (in which case the files >> wouldn=E2=80=99t be copied). But then people are likely to run into the >> problems this addresses. > > Yeah, that could be a bit confusing for people. > >> Or perhaps it would be more consistent to have: >> >> guix home import ~/foo >> >> create ~/foo/config.scm, instead of printing it to stdout? It's a good idea. home.scm or home-config.scm can be another option to make it clearer that it's not a system config.=20 >> >> The documentation would be clearer: =E2=80=9Cpopulate ~/foo with all the >> configuration files of your home environment.=E2=80=9D Thoughts? > > I originally made it to print to stdout because that=E2=80=99s what the = =E2=80=98guix > import=E2=80=99 commands do, but it could make sense to just populate a f= ile > directly. I don=E2=80=99t really have a strong opinion on this, so if no= body > has any objections, I could send a patch for this. :-) =2D-=20 Best regards, Andrew Tropin --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmF/ickACgkQIgjSCVjB 3rDgGg/+JyO6FTPyW8Jsc58J+8062CqNNnua/JzuAWHdC2aAsyicWAVSi6Xg4kH9 263KtqG8dehXLMPu7ebo4kc9CEa/CUB+uuGnl6qyMguefYjyBBKIM7aKb4wVe2LN aJgOJuHfEf/CMiSszDUF1r/EIAIZZqmT8OfmsP86VC/YCzu8fnYe1Uox8qBqs1LL LMbsfBGRQqUaPShOvGFOYBHud1rKngVXgtJamIVpXCfFlfOMH4D4qbDvxaBNLUJd qA4Uj/C+yCFOXX6uqnI45rs5Fk7LwQC9im0N9v13cDqvR6ccSxZluN+MOu5QZ6Md 9HOysQJakVzE7s3dK2JwcPBOMqfIKe/4GWWwBGGb5w/X1+zbN531FtiYZDiuGg+G K9h+bLRVpUCYkAxCYY+cHVCQarFia3FiDnn0X+GaYHe1YPbBY/lg1rWF+fxv1rjh Q516a8RC99JcmB5LWoXbNlPk45y1BqP2H4i85SxOnwwjsYLHpDum1Ubs7S5qmPbH k9yiFweC6Pq9P3nQkn/vpd9kYbSXa3mYKbqfFpd51uq2c0rXlWV4ANXplrqkBBht njTmn4MIBZ7TuALcjv+K7poaq6KdXDyxt3QBtds79aj2MbkAr4Z8Ohi8Roq8SczK fjpSV7meD0HqUr7uUZH9B3LWvbaXk0F2yCh8Ifr/UDaHWHymZUM= =4nQ9 -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 06 13:00:27 2021 Received: (at 50873) by debbugs.gnu.org; 6 Nov 2021 17:00:27 +0000 Received: from localhost ([127.0.0.1]:50337 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mjP3K-0001qB-Sh for submit@debbugs.gnu.org; Sat, 06 Nov 2021 13:00:27 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60924) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mjP3J-0001py-Ep for 50873@debbugs.gnu.org; Sat, 06 Nov 2021 13:00:26 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:48338) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mjP3D-0005gN-CD; Sat, 06 Nov 2021 13:00:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=S03bMBAgT02P3wAJ92DAZ6TW4kCFB7h9LniLeQYYoDQ=; b=Kr3Sg9EWGcyOab9vT/Sj l5LE8KZAmvQNqX8m/tH4YB/qVuzE0ig3OkXU1l0IxAC+edYYdqNijqIDYpTHBcB9+IbvfcKvAyqxU 0O97fG6jyic5Ntz4HhT2aGbh3hyJDj8rn08BpknQgMdk3y9aUMXuvWht7mr1T1n5dxKeDE+N3zQ0i V/jL+C9HMycuQ21wyIrFUruVmVoYpnC/mdD8EltnkZNtBOSoI1Vjehj958M5qN14LL3WBgKDkPwCX Mb/zNZRZrIU4Lb/A6MbQ6DdxRH6CkEZu+s253xUgXKBAxwUIoT47VYsMAuomvo0s8Mfyc271VC9Ss A6yPhu21K/T0AQ==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:55520 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mjP3D-0004ja-1S; Sat, 06 Nov 2021 13:00:19 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Andrew Tropin Subject: Re: [bug#50873] [PATCH 0/5] Fixes to =?utf-8?Q?=E2=80=98guix?= home =?utf-8?Q?import=E2=80=99?= References: <8735oirub9.fsf_-_@gnu.org> <878ry96qn6.fsf@disroot.org> <878ry8tmie.fsf@trop.in> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 16 Brumaire an 230 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Sat, 06 Nov 2021 18:00:17 +0100 In-Reply-To: <878ry8tmie.fsf@trop.in> (Andrew Tropin's message of "Mon, 01 Nov 2021 09:31:37 +0300") Message-ID: <87a6ihmd7i.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50873 Cc: Oleg Pykhalov , 50873@debbugs.gnu.org, Xinglu Chen X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Andrew Tropin skribis: >>> Or perhaps it would be more consistent to have: >>> >>> guix home import ~/foo >>> >>> create ~/foo/config.scm, instead of printing it to stdout? > > It's a good idea. home.scm or home-config.scm can be another option to > make it clearer that it's not a system config.=20 Yes, or even =E2=80=98home-configuration.scm=E2=80=99, in keeping with the no-abbreviation policy. :-) If Xinglu or someone else wants to make this change, I=E2=80=99ll happily review/apply! Thanks, Ludo=E2=80=99. From unknown Sun Jun 15 08:13:37 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 05 Dec 2021 12:24:14 +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