From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 07 06:13:41 2021 Received: (at submit) by debbugs.gnu.org; 7 Nov 2021 11:13:42 +0000 Received: from localhost ([127.0.0.1]:51906 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mjg7J-0003lu-IZ for submit@debbugs.gnu.org; Sun, 07 Nov 2021 06:13:41 -0500 Received: from lists.gnu.org ([209.51.188.17]:47692) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mjg7H-0003ll-Gc for submit@debbugs.gnu.org; Sun, 07 Nov 2021 06:13:40 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:53684) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mjg7H-0006Mt-C8 for guix-patches@gnu.org; Sun, 07 Nov 2021 06:13:39 -0500 Received: from h87-96-130-155.cust.a3fiber.se ([87.96.130.155]:37864 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 1mjg7F-0004Zl-Ct for guix-patches@gnu.org; Sun, 07 Nov 2021 06:13:39 -0500 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yoctocell.xyz; s=mail; t=1636283612; bh=uEhMG8LOG1/dcrFEQfZ76DoD0b5jsxGOevAwRSQQH7c=; h=From:To:Subject:Date; b=jikrP/7vzGhgeZHNOF38tG+qtJuFerf9t6BqwsarVLSL7cASghH18+sMNxA1YnqTK JnaCdlKc5qWZL/I2KRCvIaMlTo/w4dy41Uz2dsKG4upXGhDYygxBOPjJ+k9A0bWu3P ggWZ8X7t4b7FDZ6Q13chAlq25OgwheHHhikuQsiQ= To: guix-patches@gnu.org Subject: [PATCH] =?UTF-8?q?scripts:=20home:=20Make=20=E2=80=98guix=20home?= =?UTF-8?q?=20import=E2=80=99=20populate=20=E2=80=98home-configuration.scm?= X-Debbugs-CC: Ludovic =?utf-8?Q?Court=C3=A8s?= , Andrew Tropin Message-Id: <14ec6984221fa50f5720db519cb0f06db4dd478b.1636283518.git.public@yoctocell.xyz> Date: Sun, 07 Nov 2021 12:13:32 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=87.96.130.155; envelope-from=public@yoctocell.xyz; helo=mail.yoctocell.xyz X-Spam_score_int: 11 X-Spam_score: 1.1 X-Spam_bar: + X-Spam_report: (1.1 / 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.001, FROM_SUSPICIOUS_NTLD_FP=1.997, PDS_OTHER_BAD_TLD=0.001, PDS_RDNS_DYNAMIC_FP=0.001, RDNS_DYNAMIC=0.982, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, TO_NO_BRKTS_DYNIP=0.252 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: * guix/scripts/home.scm (process-command): Populate ‘home-configuration.scm’ in the destination directory instead of printing to stdout. * doc/guix.texi (Declaring the Home Environment): Adjust ac [...] Content analysis details: (1.7 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -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] 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] 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 (/) * guix/scripts/home.scm (process-command): Populate =E2=80=98home-configura= tion.scm=E2=80=99 in the destination directory instead of printing to stdout. * doc/guix.texi (Declaring the Home Environment): Adjust accordingly. (Invoking guix home): Likewise. Suggested-by: Ludovic Court=C3=A8s --- doc/guix.texi | 34 +++++++--------------------------- guix/scripts/home.scm | 7 ++++++- 2 files changed, 13 insertions(+), 28 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index ea1973f02c..ebcc725184 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -35865,9 +35865,8 @@ such as @file{~/.bashrc} found in your home directory and copies them to the given directory, @file{~/src/guix-config} in this case; it also reads the contents of your profile, @file{~/.guix-profile}, and, based -on that, it outputs a Home configuration that resembles your current -configuration. You can dump that configuration to a file and you're -ready to go! +on that, it populates @file{~/src/guix-config/home-configuration.scm} +with a Home configuration that resembles your current configuration. =20 A simple setup can include Bash and a custom text configuration, like in the example below. Don't be afraid to declare home environment parts, @@ -36537,33 +36536,14 @@ @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}). +configuration files will be copied to the specified directory, and a +@file{home-configuration.scm} will be populated with the home +environment. Note that not every home service that exists is supported +(@pxref{Home Services}). =20 @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 "/home/charlie/guix-config/.bashrc")))))= ))) +/home/alice/guix-config has been populated with all the configuration file= s of your home environment. Run 'guix home reconfigure /home/alice/guix-co= nfig/home-configuration.scm' to make it take effect. @end example =20 @end table diff --git a/guix/scripts/home.scm b/guix/scripts/home.scm index 3f48b98ed4..118e66895e 100644 --- a/guix/scripts/home.scm +++ b/guix/scripts/home.scm @@ -274,7 +274,12 @@ (define-syntax-rule (with-store* store exp ...) (_ (leave (G_ "wrong number of arguments~%"))))= )) (unless (file-exists? destination) (mkdir-p destination)) - (import-manifest manifest destination (current-output-port)))) + (call-with-output-file + (string-append destination "/home-configuration.scm") + (cut import-manifest manifest destination <>)) + (format #t (G_ "~a/ has been populated with all the configuration f= iles \ +of your home environment. Run 'guix home reconfigure ~a/home-configuratio= n.scm' \ +to make it take effect.") destination destination))) ((describe) (match (generation-number %guix-home) (0 base-commit: 1ffc0a6be3c1613b2d99ceea098174d1f11f6f3f --=20 2.33.0 From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 17 10:44:53 2021 Received: (at 51657-done) by debbugs.gnu.org; 17 Nov 2021 15:44:53 +0000 Received: from localhost ([127.0.0.1]:33529 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mnN7F-0001hF-7h for submit@debbugs.gnu.org; Wed, 17 Nov 2021 10:44:53 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44204) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mnN7D-0001gy-Fj for 51657-done@debbugs.gnu.org; Wed, 17 Nov 2021 10:44:52 -0500 Received: from [2001:470:142:3::e] (port=36288 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mnN77-00004r-Lj; Wed, 17 Nov 2021 10:44:45 -0500 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=vG789ClibdToA8RDi9ibSo41vlgSh9RttZCr5hSVkG0=; b=PZkJX9Gx5AC/B6fo/qUW CEZppmAVBGvAjAlEyDeikYOmukCc9nRKt07HmqMTuyvRqaGZGYHmqChPGm8B8zlXmDa95pEe8YXji epBjkYy8B1pCjU93KPli+mNv1SskrUQqduvbHzHiUnmeBvKIRgb+4Ea44y8C4Zf1FQugDRPxAEz9g xgPnNXXcbi4po3tKrU7HBcoG2/1Cf+8baR+spvhlhEidGA9CH9+SGwzGniApzyqF9iu2Mo3xpO7rn qlfl4hOsWyq1IDRt9qaPENuAT97Frrdde4MjnPHHPinWGMg4CuScWUWJYDegKGxs5SmV2fnHLiziI nhyi9T4AQLAF+g==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:64903 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mnN77-00027n-EY; Wed, 17 Nov 2021 10:44:45 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Xinglu Chen Subject: Re: bug#51657: [PATCH] scripts: home: Make =?utf-8?Q?=E2=80=98gui?= =?utf-8?Q?x?= home =?utf-8?Q?import=E2=80=99?= populate =?utf-8?Q?=E2=80=98home-configuration=2Escm?= References: <14ec6984221fa50f5720db519cb0f06db4dd478b.1636283518.git.public@yoctocell.xyz> Date: Wed, 17 Nov 2021 16:44:42 +0100 In-Reply-To: <14ec6984221fa50f5720db519cb0f06db4dd478b.1636283518.git.public@yoctocell.xyz> (Xinglu Chen's message of "Sun, 07 Nov 2021 12:13:32 +0100") Message-ID: <87bl2ivlat.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.3 (/) X-Debbugs-Envelope-To: 51657-done Cc: 51657-done@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 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello, Xinglu Chen skribis: > * guix/scripts/home.scm (process-command): Populate =E2=80=98home-configu= ration.scm=E2=80=99 > in the destination directory instead of printing to stdout. > * doc/guix.texi (Declaring the Home Environment): Adjust accordingly. > (Invoking guix home): Likewise. Applied with the changes below. This is looking nice now! Thanks! Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/doc/guix.texi b/doc/guix.texi index 5ce18fdf8a..59ceb4477a 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -36673,7 +36673,7 @@ environment. Note that not every home service that exists is supported @example $ guix home import ~/guix-config -/home/alice/guix-config has been populated with all the configuration files of your home environment. Run 'guix home reconfigure /home/alice/guix-config/home-configuration.scm' to make it take effect. +guix home: '/home/alice/guix-config' populated with all the Home configuration files @end example @end table diff --git a/guix/scripts/home.scm b/guix/scripts/home.scm index 118e66895e..afc7d8b39c 100644 --- a/guix/scripts/home.scm +++ b/guix/scripts/home.scm @@ -277,9 +277,12 @@ (define-syntax-rule (with-store* store exp ...) (call-with-output-file (string-append destination "/home-configuration.scm") (cut import-manifest manifest destination <>)) - (format #t (G_ "~a/ has been populated with all the configuration files \ -of your home environment. Run 'guix home reconfigure ~a/home-configuration.scm' \ -to make it take effect.") destination destination))) + (info (G_ "'~a' populated with all the Home configuration files~%") + destination) + (display-hint (format #f (G_ "\ +Run @command{guix home reconfigure ~a/home-configuration.scm} to effectively +deploy the home environment described by these files.\n") + destination)))) ((describe) (match (generation-number %guix-home) (0 --=-=-=-- From unknown Thu Jun 19 16:23:09 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 16 Dec 2021 12:24:10 +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