diff mbox series

[bug#50873,5/5] doc: Document the ‘guix home import’ subcommand.

Message ID e2be996cf4e3b3140a4c928c53dc37721c783bdc.1632849969.git.public@yoctocell.xyz
State Accepted
Headers show
Series Fixes to ‘guix home import’ | expand

Checks

Context Check Description
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue

Commit Message

Xinglu Chen Sept. 28, 2021, 5:36 p.m. UTC
* doc/guix.texi (Invoking guix home): Document ‘guix home import’.
---
 doc/guix.texi | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

Comments

Andrew Tropin Sept. 30, 2021, 7:08 a.m. UTC | #1
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, 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
>  
> +@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

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
>  
>  @node Documentation
Xinglu Chen Oct. 1, 2021, 5:08 a.m. UTC | #2
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, 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
>>  
>> +@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
>
> 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 ‘slurp-file-gexp’ discussion
to reach an consensus, then I can send a v2 for this series.  :-)
Ludovic Courtès Oct. 2, 2021, 3:10 p.m. UTC | #3
Hi,

Xinglu Chen <public@yoctocell.xyz> 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 ‘slurp-file-gexp’ discussion
> to reach an consensus, then I can send a v2 for this series.  :-)

Yes, but I don’t expect to change my mind on this one.  :-)

I’ve explained my views before, and really, it’s no different 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’.
diff mbox series

Patch

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
 
+@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
 
 @node Documentation