Re: Merging wip-guix-home to master

2021-09-30 Thread Andrew Tropin
On 2021-09-29 13:39, Xinglu Chen wrote:

> On Tue, Sep 28 2021, Andrew Tropin wrote:
>
>> On 2021-09-24 15:38, Xinglu Chen wrote:
>>
>>> On Thu, Sep 23 2021, Andrew Tropin wrote:
>>>
 The core part of Guix Home project has been moved from rde
 repository[fn:1] to wip-guix-home branch of guix repository.

 I'm about a week on wip-guix-home branch completely and Guix Home works
 fine.  There are no any major issues on rde-devel and guix-devel mailing
 lists and it seems that branch is ready to be merged.

 My guix describe looks like:
 --8<---cut here---start->8---
 Generation 114 Sep 17 2021 13:33:55(current)
   rde 31f8003
 repository URL: https://git.sr.ht/~abcdw/rde
 branch: without-guix-home
 commit: 31f800353a781cef25fc80c05ad824a068a049c8
   guix a2324d8
 repository URL: https://git.savannah.gnu.org/git/guix.git
 branch: wip-guix-home
 commit: a2324d8b56eabf8117bca220a507cc791edffd2e
 --8<---cut here---end--->8---


 There is a discussion[fn:2] on moving home services to (gnu services
 ...)  modules, which is likely to happen, but it's possible to do the
 migration relatively painless by re-exporting necessary symbols in
 (gnu home-services ...) at first and removing them completely later.

 Another important part of the work related to Guix Home project is
 covering related modules and cli with tests, but it can be done in
 parallel and is not a blocker for merging.
>>>
>>> I noticed that the ‘guix home import’ subcommand is included, but I
>>> think it needs more thought and feedback from people before it makes its
>>> way into ‘master’; it also seems to lack documentation.
>>>
>>> I just realized that it generates the following service declaration
>>>
>>> --8<---cut here---start->8---
>>> (service
>>>  home-bash-service-type
>>>  (home-bash-configuration
>>>   (bashrc
>>>(list (slurp-file-gexp
>>>   (local-file "/home/yoctocell/.bashrc"))
>>> --8<---cut here---end--->8---
>>>
>>> but when running ‘guix home reconfigure’, the ~/.bashrc file will be
>>> moved, so when running ‘guix home reconfigure’ for the second time, it
>>> would read the ~/.bashrc which is itself a symlink to a file the store.
>>> ‘guix home import’ clearly isn’t in a usable state as of right now…
>>
>> Yep, I remember that it is not documented.  I think it's ok for
>> generating a simple sample configuration,

It was two independent sentences.

>
> I disagree, I think it’s OK for things like (guix git), which are mainly
> used by developers, to not be documented in the manual.  Ideally, the
> all the modules would be documented.  :-)
>
> However, ‘guix home import’ will be used by developers and regular
> users, and documenting the command should be a requirement.
>
>> but I agree that it's not yet complete, if you wish I'll disable it in
>> cli.
>
> I have sent a few patches to fix it and document it[1], so it should
> probably left as-is for now.
>
>> Just an idea for the future: it's probably better to copy .bashrc to the
>> current directory and do (local-file "./bashrc").
>
> This wouldn’t work if the user doesn’t have write-access to the current
> directory, nor if the current directory is $HOME.  I think it’s better
> for the user to specify the directory themselves.
>
> [1]: 


signature.asc
Description: PGP signature


Re: Merging wip-guix-home to master

2021-09-29 Thread Xinglu Chen
On Wed, Sep 29 2021, Katherine Cox-Buday wrote:

> Xinglu Chen  writes:
>
>> I disagree, I think it’s OK for things like (guix git), which are mainly
>> used by developers, to not be documented in the manual.
>
> I strongly disagree with this. As a long-time developer, I have used
> documentation both as a user and as a developer many times.
>
> Documentation is for everyone.

I said “to not be documented in the manual” (the majority of (guix …)
modules aren’t documented in the manual); that doesn’t mean that there
aren’t any docstrings.  The manual says that all top-level procedures
should have docstrings (see “16.5.4 Formatting Code”)

We require all top-level procedures to carry a docstring.  This
  requirement can be relaxed for simple private procedures in the ‘(guix
  build ...)’ name space, though.



signature.asc
Description: PGP signature


Re: Merging wip-guix-home to master

2021-09-29 Thread Katherine Cox-Buday
Xinglu Chen  writes:

> I disagree, I think it’s OK for things like (guix git), which are mainly
> used by developers, to not be documented in the manual.

I strongly disagree with this. As a long-time developer, I have used 
documentation both as a user and as a developer many times.

Documentation is for everyone.

-- 
Katherine



Re: Merging wip-guix-home to master

2021-09-29 Thread Xinglu Chen
On Tue, Sep 28 2021, Andrew Tropin wrote:

> On 2021-09-24 15:38, Xinglu Chen wrote:
>
>> On Thu, Sep 23 2021, Andrew Tropin wrote:
>>
>>> The core part of Guix Home project has been moved from rde
>>> repository[fn:1] to wip-guix-home branch of guix repository.
>>>
>>> I'm about a week on wip-guix-home branch completely and Guix Home works
>>> fine.  There are no any major issues on rde-devel and guix-devel mailing
>>> lists and it seems that branch is ready to be merged.
>>>
>>> My guix describe looks like:
>>> --8<---cut here---start->8---
>>> Generation 114  Sep 17 2021 13:33:55(current)
>>>   rde 31f8003
>>> repository URL: https://git.sr.ht/~abcdw/rde
>>> branch: without-guix-home
>>> commit: 31f800353a781cef25fc80c05ad824a068a049c8
>>>   guix a2324d8
>>> repository URL: https://git.savannah.gnu.org/git/guix.git
>>> branch: wip-guix-home
>>> commit: a2324d8b56eabf8117bca220a507cc791edffd2e
>>> --8<---cut here---end--->8---
>>>
>>>
>>> There is a discussion[fn:2] on moving home services to (gnu services
>>> ...)  modules, which is likely to happen, but it's possible to do the
>>> migration relatively painless by re-exporting necessary symbols in
>>> (gnu home-services ...) at first and removing them completely later.
>>>
>>> Another important part of the work related to Guix Home project is
>>> covering related modules and cli with tests, but it can be done in
>>> parallel and is not a blocker for merging.
>>
>> I noticed that the ‘guix home import’ subcommand is included, but I
>> think it needs more thought and feedback from people before it makes its
>> way into ‘master’; it also seems to lack documentation.
>>
>> I just realized that it generates the following service declaration
>>
>> --8<---cut here---start->8---
>> (service
>>  home-bash-service-type
>>  (home-bash-configuration
>>   (bashrc
>>(list (slurp-file-gexp
>>   (local-file "/home/yoctocell/.bashrc"))
>> --8<---cut here---end--->8---
>>
>> but when running ‘guix home reconfigure’, the ~/.bashrc file will be
>> moved, so when running ‘guix home reconfigure’ for the second time, it
>> would read the ~/.bashrc which is itself a symlink to a file the store.
>> ‘guix home import’ clearly isn’t in a usable state as of right now…
>
> Yep, I remember that it is not documented.  I think it's ok for
> generating a simple sample configuration,

I disagree, I think it’s OK for things like (guix git), which are mainly
used by developers, to not be documented in the manual.  Ideally, the
all the modules would be documented.  :-)

However, ‘guix home import’ will be used by developers and regular
users, and documenting the command should be a requirement.

> but I agree that it's not yet complete, if you wish I'll disable it in
> cli.

I have sent a few patches to fix it and document it[1], so it should
probably left as-is for now.

> Just an idea for the future: it's probably better to copy .bashrc to the
> current directory and do (local-file "./bashrc").

This wouldn’t work if the user doesn’t have write-access to the current
directory, nor if the current directory is $HOME.  I think it’s better
for the user to specify the directory themselves.

[1]: 


signature.asc
Description: PGP signature


Re: Merging wip-guix-home to master

2021-09-28 Thread Xinglu Chen
On Tue, Sep 28 2021, Ludovic Courtès wrote:

> Xinglu Chen  skribis:
>
>> I noticed that the ‘guix home import’ subcommand is included, but I
>> think it needs more thought and feedback from people before it makes its
>> way into ‘master’; it also seems to lack documentation.
>
> Agreed.  There are a few (very few) exceptions, but in general each
> command needs (1) a section in the manual and (2) unit tests and/or
> integration tests in a shell script.
>
> Could you submit patches for that?

Sure!  :-)

> IWBN if others could do an after-the-fact review of the code, too.

Agreed.  I quickly skimmed through (gnu home-services xdg), and I can
already see some things that can be improved.  :-)

>> I just realized that it generates the following service declaration
>>
>> (service
>>  home-bash-service-type
>>  (home-bash-configuration
>>   (bashrc
>>(list (slurp-file-gexp
>>   (local-file "/home/yoctocell/.bashrc"))
>>
>> but when running ‘guix home reconfigure’, the ~/.bashrc file will be
>> moved, so when running ‘guix home reconfigure’ for the second time, it
>> would read the ~/.bashrc which is itself a symlink to a file the store.
>> ‘guix home import’ clearly isn’t in a usable state as of right now…
>
> Also, I argued earlier against ‘slurp-file-gexp’:
>
>   https://lists.gnu.org/archive/html/guix-devel/2021-06/msg00192.html
>
> I haven’t checked the different service configuration APIs, but I think
> we should avoid uses of ‘slurp-file-gexp’ entirely and instead do the
> same as in the majority of Guix System services, which is to accept
> file-like objects.
>
> Thoughts?  Could you take a look?

Yeah, I never really liked ‘slurp-file-gexp’; using ‘local-file’ &
co. would be better and more consistent.


signature.asc
Description: PGP signature


Re: Merging wip-guix-home to master

2021-09-28 Thread Ludovic Courtès
Xinglu Chen  skribis:

> I noticed that the ‘guix home import’ subcommand is included, but I
> think it needs more thought and feedback from people before it makes its
> way into ‘master’; it also seems to lack documentation.

Agreed.  There are a few (very few) exceptions, but in general each
command needs (1) a section in the manual and (2) unit tests and/or
integration tests in a shell script.

Could you submit patches for that?

IWBN if others could do an after-the-fact review of the code, too.

> I just realized that it generates the following service declaration
>
> (service
>  home-bash-service-type
>  (home-bash-configuration
>   (bashrc
>(list (slurp-file-gexp
>   (local-file "/home/yoctocell/.bashrc"))
>
> but when running ‘guix home reconfigure’, the ~/.bashrc file will be
> moved, so when running ‘guix home reconfigure’ for the second time, it
> would read the ~/.bashrc which is itself a symlink to a file the store.
> ‘guix home import’ clearly isn’t in a usable state as of right now…

Also, I argued earlier against ‘slurp-file-gexp’:

  https://lists.gnu.org/archive/html/guix-devel/2021-06/msg00192.html

I haven’t checked the different service configuration APIs, but I think
we should avoid uses of ‘slurp-file-gexp’ entirely and instead do the
same as in the majority of Guix System services, which is to accept
file-like objects.

Thoughts?  Could you take a look?

Thanks,
Ludo’.



Re: Merging wip-guix-home to master

2021-09-28 Thread Andrew Tropin
On 2021-09-24 15:38, Xinglu Chen wrote:

> On Thu, Sep 23 2021, Andrew Tropin wrote:
>
>> The core part of Guix Home project has been moved from rde
>> repository[fn:1] to wip-guix-home branch of guix repository.
>>
>> I'm about a week on wip-guix-home branch completely and Guix Home works
>> fine.  There are no any major issues on rde-devel and guix-devel mailing
>> lists and it seems that branch is ready to be merged.
>>
>> My guix describe looks like:
>> --8<---cut here---start->8---
>> Generation 114   Sep 17 2021 13:33:55(current)
>>   rde 31f8003
>> repository URL: https://git.sr.ht/~abcdw/rde
>> branch: without-guix-home
>> commit: 31f800353a781cef25fc80c05ad824a068a049c8
>>   guix a2324d8
>> repository URL: https://git.savannah.gnu.org/git/guix.git
>> branch: wip-guix-home
>> commit: a2324d8b56eabf8117bca220a507cc791edffd2e
>> --8<---cut here---end--->8---
>>
>>
>> There is a discussion[fn:2] on moving home services to (gnu services
>> ...)  modules, which is likely to happen, but it's possible to do the
>> migration relatively painless by re-exporting necessary symbols in
>> (gnu home-services ...) at first and removing them completely later.
>>
>> Another important part of the work related to Guix Home project is
>> covering related modules and cli with tests, but it can be done in
>> parallel and is not a blocker for merging.
>
> I noticed that the ‘guix home import’ subcommand is included, but I
> think it needs more thought and feedback from people before it makes its
> way into ‘master’; it also seems to lack documentation.
>
> I just realized that it generates the following service declaration
>
> --8<---cut here---start->8---
> (service
>  home-bash-service-type
>  (home-bash-configuration
>   (bashrc
>(list (slurp-file-gexp
>   (local-file "/home/yoctocell/.bashrc"))
> --8<---cut here---end--->8---
>
> but when running ‘guix home reconfigure’, the ~/.bashrc file will be
> moved, so when running ‘guix home reconfigure’ for the second time, it
> would read the ~/.bashrc which is itself a symlink to a file the store.
> ‘guix home import’ clearly isn’t in a usable state as of right now…

Yep, I remember that it is not documented.  I think it's ok for
generating a simple sample configuration, but I agree that it's not yet
complete, if you wish I'll disable it in cli.

Just an idea for the future: it's probably better to copy .bashrc to the
current directory and do (local-file "./bashrc").


signature.asc
Description: PGP signature


Re: Merging wip-guix-home to master

2021-09-24 Thread Xinglu Chen
On Thu, Sep 23 2021, Andrew Tropin wrote:

> The core part of Guix Home project has been moved from rde
> repository[fn:1] to wip-guix-home branch of guix repository.
>
> I'm about a week on wip-guix-home branch completely and Guix Home works
> fine.  There are no any major issues on rde-devel and guix-devel mailing
> lists and it seems that branch is ready to be merged.
>
> My guix describe looks like:
> --8<---cut here---start->8---
> Generation 114Sep 17 2021 13:33:55(current)
>   rde 31f8003
> repository URL: https://git.sr.ht/~abcdw/rde
> branch: without-guix-home
> commit: 31f800353a781cef25fc80c05ad824a068a049c8
>   guix a2324d8
> repository URL: https://git.savannah.gnu.org/git/guix.git
> branch: wip-guix-home
> commit: a2324d8b56eabf8117bca220a507cc791edffd2e
> --8<---cut here---end--->8---
>
>
> There is a discussion[fn:2] on moving home services to (gnu services
> ...)  modules, which is likely to happen, but it's possible to do the
> migration relatively painless by re-exporting necessary symbols in
> (gnu home-services ...) at first and removing them completely later.
>
> Another important part of the work related to Guix Home project is
> covering related modules and cli with tests, but it can be done in
> parallel and is not a blocker for merging.

I noticed that the ‘guix home import’ subcommand is included, but I
think it needs more thought and feedback from people before it makes its
way into ‘master’; it also seems to lack documentation.

I just realized that it generates the following service declaration

--8<---cut here---start->8---
(service
 home-bash-service-type
 (home-bash-configuration
  (bashrc
   (list (slurp-file-gexp
  (local-file "/home/yoctocell/.bashrc"))
--8<---cut here---end--->8---

but when running ‘guix home reconfigure’, the ~/.bashrc file will be
moved, so when running ‘guix home reconfigure’ for the second time, it
would read the ~/.bashrc which is itself a symlink to a file the store.
‘guix home import’ clearly isn’t in a usable state as of right now…



signature.asc
Description: PGP signature


Re: Merging wip-guix-home to master

2021-09-24 Thread Andrew Tropin
On 2021-09-23 22:45, Ludovic Courtès wrote:

> Hi,
>
> Andrew Tropin  skribis:
>
>> I'm about a week on wip-guix-home branch completely and Guix Home works
>> fine.  There are no any major issues on rde-devel and guix-devel mailing
>> lists and it seems that branch is ready to be merged.
>
> Yay!  I’d like to take another look (I know I’ve been terribly MIA,
> apologies!), and I hope other folks familiar with Guix System can
> comment as well.

Sure, let's wait for reviews/comments until next Thursday.

>
>> There is a discussion[fn:2] on moving home services to (gnu services
>> ...)  modules, which is likely to happen, but it's possible to do the
>> migration relatively painless by re-exporting necessary symbols in
>> (gnu home-services ...) at first and removing them completely later.
>
> I know it can be annoying to existing Guix Home users, but I’d prefer
> not to carry pre-merge baggage; that is, we’d just rename and not
> provide those modules under their former names at all.
>

Yep, it is very likely that it will be annoying, but I think it's
doable.  It should be a relatively simple migration for users.

>> Another important part of the work related to Guix Home project is
>> covering related modules and cli with tests, but it can be done in
>> parallel and is not a blocker for merging.
>
> Do you have ideas of a possible testing strategy?

Yep, I think we can do the same thing to tests/guix-system.sh, check
that `guix home build` provides desired results on simple configurations
and `guix home search` shows correct results on different input strings.

>
> We should be able to test at least the CLI, either arranging to avoid
> large builds (as in tests/guix-build.sh) or talking to the “real”
> guix-daemon (as in tests/guix-pack-relocatable.sh) if we’re going to
> need packages.
>
> It’d be great to have this part ready soonish.

I hope to work on it next week.

>
> The way I see it, in 1.4 (2.0?), we’d mark Guix Home as a “technology
> preview” in the manual with a prominent note.  That will allow us to get
> feedback from new users and to fine-tune code correspondingly, and
> that’ll make it clear to users that things are still subject to change.

Marked it as a subject to change in Home Configuration section of the
manual, patch in the reply to Oleg.

>
> Thoughts?
>
> Thanks,
> Ludo’.


signature.asc
Description: PGP signature


Re: Merging wip-guix-home to master

2021-09-24 Thread Andrew Tropin
On 2021-09-23 10:27, Katherine Cox-Buday wrote:

> Andrew Tropin  writes:
>
>> The core part of Guix Home project has been moved from rde
>> repository[fn:1] to wip-guix-home branch of guix repository.
>>
>> I'm about a week on wip-guix-home branch completely and Guix Home works
>> fine.  There are no any major issues on rde-devel and guix-devel mailing
>> lists and it seems that branch is ready to be merged.
>
> I just want to thank you for the work. I don't think I'll use this 
> everywhere, but it is definitely going to be helpful in some environments. 
> Thank you!

My pleasure)


signature.asc
Description: PGP signature


Re: Merging wip-guix-home to master

2021-09-23 Thread Ludovic Courtès
Hi,

Andrew Tropin  skribis:

> I'm about a week on wip-guix-home branch completely and Guix Home works
> fine.  There are no any major issues on rde-devel and guix-devel mailing
> lists and it seems that branch is ready to be merged.

Yay!  I’d like to take another look (I know I’ve been terribly MIA,
apologies!), and I hope other folks familiar with Guix System can
comment as well.

> There is a discussion[fn:2] on moving home services to (gnu services
> ...)  modules, which is likely to happen, but it's possible to do the
> migration relatively painless by re-exporting necessary symbols in
> (gnu home-services ...) at first and removing them completely later.

I know it can be annoying to existing Guix Home users, but I’d prefer
not to carry pre-merge baggage; that is, we’d just rename and not
provide those modules under their former names at all.

> Another important part of the work related to Guix Home project is
> covering related modules and cli with tests, but it can be done in
> parallel and is not a blocker for merging.

Do you have ideas of a possible testing strategy?

We should be able to test at least the CLI, either arranging to avoid
large builds (as in tests/guix-build.sh) or talking to the “real”
guix-daemon (as in tests/guix-pack-relocatable.sh) if we’re going to
need packages.

It’d be great to have this part ready soonish.

The way I see it, in 1.4 (2.0?), we’d mark Guix Home as a “technology
preview” in the manual with a prominent note.  That will allow us to get
feedback from new users and to fine-tune code correspondingly, and
that’ll make it clear to users that things are still subject to change.

Thoughts?

Thanks,
Ludo’.



Re: Merging wip-guix-home to master

2021-09-23 Thread Katherine Cox-Buday
Andrew Tropin  writes:

> The core part of Guix Home project has been moved from rde
> repository[fn:1] to wip-guix-home branch of guix repository.
>
> I'm about a week on wip-guix-home branch completely and Guix Home works
> fine.  There are no any major issues on rde-devel and guix-devel mailing
> lists and it seems that branch is ready to be merged.

I just want to thank you for the work. I don't think I'll use this everywhere, 
but it is definitely going to be helpful in some environments. Thank you!

-- 
Katherine