GNU bug report logs - #52808
Guix home should not assume that all targets are dot files

Previous Next

Package: guix;

Reported by: "Nick Zalutskiy" <nick <at> const.fun>

Date: Sun, 26 Dec 2021 17:37:02 UTC

Severity: normal

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 52808 in the body.
You can then email your comments to 52808 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#52808; Package guix. (Sun, 26 Dec 2021 17:37:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Nick Zalutskiy" <nick <at> const.fun>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Sun, 26 Dec 2021 17:37:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Nick Zalutskiy" <nick <at> const.fun>
To: bug-guix <at> gnu.org
Subject: Guix home should not assume that all targets are dot files
Date: Sun, 26 Dec 2021 12:17:27 -0500
[Message part 1 (text/plain, inline)]
The following configuration results in a `~/.run` symlink being created. My expectation is that a `~/run` symlink is created instead. (ie. not a dotfile)

> (home-environment
>   (services
>     (list (service
>             home-bash-service-type
>             (home-bash-configuration
>           (guix-defaults? #t)))
>       (simple-service 'my-files
>               home-files-service-type
>               `(("run" ,(local-file "run")))))))

This applies to all other targets. My expectation is that the configuration should expect the exact target and not make an assumption that all targets are hidden files, since that allows for more utility: 

> (home-environment
>   (services
>     (list (service
>             home-bash-service-type
>             (home-bash-configuration
>               (guix-defaults? #t)))
>           (simple-service 'config-files
>               home-files-service-type
>               `(("run" ,(local-file "run"))
>                 ("README.txt" ,(local-file "README.txt"))
>                 (".config/guix/channels.scm" ,(local-file "config/guix
>                 (".emacs.d/init.el" ,(local-file "emacs.d/init.el"))
>                 (".vimrc" ,(local-file "vimrc"))
>                 (".gitconfig" ,(local-file "gitconfig")))))))

Thank you,

-Nick
[Message part 2 (text/html, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#52808; Package guix. (Fri, 28 Jan 2022 10:53:01 GMT) Full text and rfc822 format available.

Message #8 received at 52808 <at> debbugs.gnu.org (full text, mbox):

From: Andrew Tropin <andrew <at> trop.in>
To: Nick Zalutskiy <nick <at> const.fun>, 52808 <at> debbugs.gnu.org
Subject: Re: bug#52808: Guix home should not assume that all targets are dot
 files
Date: Fri, 28 Jan 2022 13:51:57 +0300
[Message part 1 (text/plain, inline)]
On 2021-12-26 12:17, Nick Zalutskiy wrote:

> The following configuration results in a `~/.run` symlink being
> created. My expectation is that a `~/run` symlink is created
> instead. (ie. not a dotfile)

Some how I missed it and not documented home-files-service-type in the
manual, I'll add it soon.  Thank you for mentioning it.  It should break
this expectation :)

>> (home-environment
>>   (services
>>     (list (service
>>             home-bash-service-type
>>             (home-bash-configuration
>>           (guix-defaults? #t)))
>>       (simple-service 'my-files
>>               home-files-service-type
>>               `(("run" ,(local-file "run")))))))
>
> This applies to all other targets. My expectation is that the
> configuration should expect the exact target and not make an
> assumption that all targets are hidden files, since that allows for
> more utility:
>
>> (home-environment
>>   (services
>>     (list (service
>>             home-bash-service-type
>>             (home-bash-configuration
>>               (guix-defaults? #t)))
>>           (simple-service 'config-files
>>               home-files-service-type
>>               `(("run" ,(local-file "run"))
>>                 ("README.txt" ,(local-file "README.txt"))
>>                 (".config/guix/channels.scm" ,(local-file "config/guix
>>                 (".emacs.d/init.el" ,(local-file "emacs.d/init.el"))
>>                 (".vimrc" ,(local-file "vimrc"))
>>                 (".gitconfig" ,(local-file "gitconfig")))))))
>
> Thank you,
>
> -Nick

It's intentional and is a part of a design decision:

For example for ("config/guix/channels.scm" ,(local-file "./chans.scm"))
chans.scm goes not to ~/.config/guix/channels.scm, but to
$XDG_CONFIG_DIR/guix/channels.scm, which can be a different location
from ~/.config, absent dot should partially break this expectation.

It's a bad practice to use something without "config/..."  prefix and
generally it should be avoided, it still possible to use something
different in rare use-cases, for example for zsh: ("zshenv"
,zshenv-file-like-here), because it's hard to implement the lookup for
initial configuration file other way for shells.

You can elaborate more on what you try to achieve and I can try to give
you a recommendation how to implement it.

-- 
Best regards,
Andrew Tropin
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#52808; Package guix. (Fri, 28 Jan 2022 13:34:02 GMT) Full text and rfc822 format available.

Message #11 received at 52808 <at> debbugs.gnu.org (full text, mbox):

From: "Nick Zalutskiy" <nick <at> const.fun>
To: "Andrew Tropin" <andrew <at> trop.in>, 52808 <at> debbugs.gnu.org
Subject: Re: bug#52808: Guix home should not assume that all targets are dot
 files
Date: Fri, 28 Jan 2022 08:33:10 -0500
Hi Andrew,

I have files that I consider my "home configuration" that do not go into .config or any other dot dir. For example, I place an executable shell script to automate some tasks in the home dir of every machine. The script is called `run` all I want to do is place it as ~/run Placing this file in PATH is not appropriate in my case.

The current design makes this impossible to achieve it seems. I just live with `~/.run` now, but it is ergonomically cumbersome for reasons that are too obscure to go into.

Why not, just as an example: 

`("$XDG_CONFIG_DIR/guix/channels.scm" ,(local-file "./chans.scm"))`

Which is explicit and sets the right expectation without any other context. The implicit heuristics around how the input is interpreted are an unfortunate design decision in my opinion, they make a simple tool more difficult to use.

Having said all that, the documentation helps a lot. Thank you for the patch!

Best,

-Nick

On Fri, Jan 28, 2022, at 5:51 AM, Andrew Tropin wrote:
> On 2021-12-26 12:17, Nick Zalutskiy wrote:
>
>> The following configuration results in a `~/.run` symlink being
>> created. My expectation is that a `~/run` symlink is created
>> instead. (ie. not a dotfile)
>
> Some how I missed it and not documented home-files-service-type in the
> manual, I'll add it soon.  Thank you for mentioning it.  It should break
> this expectation :)
>
>>> (home-environment
>>>   (services
>>>     (list (service
>>>             home-bash-service-type
>>>             (home-bash-configuration
>>>           (guix-defaults? #t)))
>>>       (simple-service 'my-files
>>>               home-files-service-type
>>>               `(("run" ,(local-file "run")))))))
>>
>> This applies to all other targets. My expectation is that the
>> configuration should expect the exact target and not make an
>> assumption that all targets are hidden files, since that allows for
>> more utility:
>>
>>> (home-environment
>>>   (services
>>>     (list (service
>>>             home-bash-service-type
>>>             (home-bash-configuration
>>>               (guix-defaults? #t)))
>>>           (simple-service 'config-files
>>>               home-files-service-type
>>>               `(("run" ,(local-file "run"))
>>>                 ("README.txt" ,(local-file "README.txt"))
>>>                 (".config/guix/channels.scm" ,(local-file "config/guix
>>>                 (".emacs.d/init.el" ,(local-file "emacs.d/init.el"))
>>>                 (".vimrc" ,(local-file "vimrc"))
>>>                 (".gitconfig" ,(local-file "gitconfig")))))))
>>
>> Thank you,
>>
>> -Nick
>
> It's intentional and is a part of a design decision:
>
> For example for ("config/guix/channels.scm" ,(local-file "./chans.scm"))
> chans.scm goes not to ~/.config/guix/channels.scm, but to
> $XDG_CONFIG_DIR/guix/channels.scm, which can be a different location
> from ~/.config, absent dot should partially break this expectation.
>
> It's a bad practice to use something without "config/..."  prefix and
> generally it should be avoided, it still possible to use something
> different in rare use-cases, for example for zsh: ("zshenv"
> ,zshenv-file-like-here), because it's hard to implement the lookup for
> initial configuration file other way for shells.
>
> You can elaborate more on what you try to achieve and I can try to give
> you a recommendation how to implement it.
>
> -- 
> Best regards,
> Andrew Tropin
>
> Attachments:
> * signature.asc




Information forwarded to bug-guix <at> gnu.org:
bug#52808; Package guix. (Fri, 28 Jan 2022 15:23:02 GMT) Full text and rfc822 format available.

Message #14 received at 52808 <at> debbugs.gnu.org (full text, mbox):

From: Andrew Tropin <andrew <at> trop.in>
To: Nick Zalutskiy <nick <at> const.fun>, 52808 <at> debbugs.gnu.org
Subject: Re: bug#52808: Guix home should not assume that all targets are dot
 files
Date: Fri, 28 Jan 2022 18:22:03 +0300
[Message part 1 (text/plain, inline)]
On 2022-01-28 08:33, Nick Zalutskiy wrote:

> Hi Andrew,
>
> I have files that I consider my "home configuration" that do not go
> into .config or any other dot dir. For example, I place an executable
> shell script to automate some tasks in the home dir of every
> machine. The script is called `run` all I want to do is place it as
> ~/run Placing this file in PATH is not appropriate in my case.
>
> The current design makes this impossible to achieve it seems. I just
> live with `~/.run` now, but it is ergonomically cumbersome for reasons
> that are too obscure to go into.

You can extend activation home service with a script, which will symlink
a necessary executable to ~/run.

>
> Why not, just as an example:
>
> `("$XDG_CONFIG_DIR/guix/channels.scm" ,(local-file "./chans.scm"))`

The $XDG_CONFIG_DIR is not know at build-time, so it won't work.
Creating a literal files/$XDG_CONFIG_DIR directory is possible, but also
not ideal.  However the idea sounds not that bad.

>
> Which is explicit and sets the right expectation without any other
> context. The implicit heuristics around how the input is interpreted
> are an unfortunate design decision in my opinion, they make a simple
> tool more difficult to use.

It's partially intentional to force users to stick to XDG specification
for config files and minimize the usage of dotfiles in $HOME.  The
binaries are inteded to go to profile/bin or other directory on the
path. But it always possible to bypass this decision by directly
extending home-service-type or home-activation-service-type.

I see what you mean about implicit heuristics and mostly agree.

>
> Having said all that, the documentation helps a lot. Thank you for the
> patch!

Sure ;)

>
> Best,
>
> -Nick
>
> On Fri, Jan 28, 2022, at 5:51 AM, Andrew Tropin wrote:
>> On 2021-12-26 12:17, Nick Zalutskiy wrote:
>>
>>> The following configuration results in a `~/.run` symlink being
>>> created. My expectation is that a `~/run` symlink is created
>>> instead. (ie. not a dotfile)
>>
>> Some how I missed it and not documented home-files-service-type in the
>> manual, I'll add it soon.  Thank you for mentioning it.  It should break
>> this expectation :)
>>
>>>> (home-environment
>>>>   (services
>>>>     (list (service
>>>>             home-bash-service-type
>>>>             (home-bash-configuration
>>>>           (guix-defaults? #t)))
>>>>       (simple-service 'my-files
>>>>               home-files-service-type
>>>>               `(("run" ,(local-file "run")))))))
>>>
>>> This applies to all other targets. My expectation is that the
>>> configuration should expect the exact target and not make an
>>> assumption that all targets are hidden files, since that allows for
>>> more utility:
>>>
>>>> (home-environment
>>>>   (services
>>>>     (list (service
>>>>             home-bash-service-type
>>>>             (home-bash-configuration
>>>>               (guix-defaults? #t)))
>>>>           (simple-service 'config-files
>>>>               home-files-service-type
>>>>               `(("run" ,(local-file "run"))
>>>>                 ("README.txt" ,(local-file "README.txt"))
>>>>                 (".config/guix/channels.scm" ,(local-file "config/guix
>>>>                 (".emacs.d/init.el" ,(local-file "emacs.d/init.el"))
>>>>                 (".vimrc" ,(local-file "vimrc"))
>>>>                 (".gitconfig" ,(local-file "gitconfig")))))))
>>>
>>> Thank you,
>>>
>>> -Nick
>>
>> It's intentional and is a part of a design decision:
>>
>> For example for ("config/guix/channels.scm" ,(local-file "./chans.scm"))
>> chans.scm goes not to ~/.config/guix/channels.scm, but to
>> $XDG_CONFIG_DIR/guix/channels.scm, which can be a different location
>> from ~/.config, absent dot should partially break this expectation.
>>
>> It's a bad practice to use something without "config/..."  prefix and
>> generally it should be avoided, it still possible to use something
>> different in rare use-cases, for example for zsh: ("zshenv"
>> ,zshenv-file-like-here), because it's hard to implement the lookup for
>> initial configuration file other way for shells.
>>
>> You can elaborate more on what you try to achieve and I can try to give
>> you a recommendation how to implement it.
>>
>> -- 
>> Best regards,
>> Andrew Tropin
>>
>> Attachments:
>> * signature.asc

-- 
Best regards,
Andrew Tropin
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#52808; Package guix. (Sun, 30 Jan 2022 17:14:02 GMT) Full text and rfc822 format available.

Message #17 received at 52808 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Andrew Tropin <andrew <at> trop.in>
Cc: 52808 <at> debbugs.gnu.org, Nick Zalutskiy <nick <at> const.fun>
Subject: Re: bug#52808: Guix home should not assume that all targets are dot
 files
Date: Sun, 30 Jan 2022 18:13:31 +0100
Hi Andrew,

Andrew Tropin <andrew <at> trop.in> skribis:

> On 2021-12-26 12:17, Nick Zalutskiy wrote:
>
>> The following configuration results in a `~/.run` symlink being
>> created. My expectation is that a `~/run` symlink is created
>> instead. (ie. not a dotfile)
>
> Some how I missed it and not documented home-files-service-type in the
> manual, I'll add it soon.  Thank you for mentioning it.  It should break
> this expectation :)
>
>>> (home-environment
>>>   (services
>>>     (list (service
>>>             home-bash-service-type
>>>             (home-bash-configuration
>>>           (guix-defaults? #t)))
>>>       (simple-service 'my-files
>>>               home-files-service-type
>>>               `(("run" ,(local-file "run")))))))
>>
>> This applies to all other targets. My expectation is that the
>> configuration should expect the exact target and not make an
>> assumption that all targets are hidden files, since that allows for
>> more utility:

I share Nick’s surprise.  :-)

[...]

> It's intentional and is a part of a design decision:
>
> For example for ("config/guix/channels.scm" ,(local-file "./chans.scm"))
> chans.scm goes not to ~/.config/guix/channels.scm, but to
> $XDG_CONFIG_DIR/guix/channels.scm, which can be a different location
> from ~/.config, absent dot should partially break this expectation.
>
> It's a bad practice to use something without "config/..."  prefix and
> generally it should be avoided, it still possible to use something
> different in rare use-cases, for example for zsh: ("zshenv"
> ,zshenv-file-like-here), because it's hard to implement the lookup for
> initial configuration file other way for shells.

Oh, I see.

> You can elaborate more on what you try to achieve and I can try to give
> you a recommendation how to implement it.

I’d expect ‘home-files-service-type’ to do just that: add files to the
home directory, without trying to be smart.

Would it make sense to distinguish between ‘home-files’ and (say)
‘home-xdg-configuration-files’?

The latter would copy files to $XDG_CONFIG_DIR at activation time,
whereas the former would just copy them to $HOME.


I’d also suggest removing special handling of HOME/files in
symlink-manager.scm.  Relations between the various components of Guix
Home should preferably be made explicit via service extensions, and not
implicit through conventions like this ‘files’ sub-directory.

Thoughts?

Ludo’.




Information forwarded to bug-guix <at> gnu.org:
bug#52808; Package guix. (Wed, 02 Feb 2022 08:12:01 GMT) Full text and rfc822 format available.

Message #20 received at 52808 <at> debbugs.gnu.org (full text, mbox):

From: Andrew Tropin <andrew <at> trop.in>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 52808 <at> debbugs.gnu.org, Julien Lepiller <julien <at> lepiller.eu>,
 Nick Zalutskiy <nick <at> const.fun>
Subject: Re: bug#52808: Guix home should not assume that all targets are dot
 files
Date: Wed, 02 Feb 2022 11:10:54 +0300
[Message part 1 (text/plain, inline)]
On 2022-01-30 18:13, Ludovic Courtès wrote:

> Hi Andrew,
>
> Andrew Tropin <andrew <at> trop.in> skribis:
>
>> On 2021-12-26 12:17, Nick Zalutskiy wrote:
>>
>>> The following configuration results in a `~/.run` symlink being
>>> created. My expectation is that a `~/run` symlink is created
>>> instead. (ie. not a dotfile)
>>
>> Some how I missed it and not documented home-files-service-type in the
>> manual, I'll add it soon.  Thank you for mentioning it.  It should break
>> this expectation :)
>>
>>>> (home-environment
>>>>   (services
>>>>     (list (service
>>>>             home-bash-service-type
>>>>             (home-bash-configuration
>>>>           (guix-defaults? #t)))
>>>>       (simple-service 'my-files
>>>>               home-files-service-type
>>>>               `(("run" ,(local-file "run")))))))
>>>
>>> This applies to all other targets. My expectation is that the
>>> configuration should expect the exact target and not make an
>>> assumption that all targets are hidden files, since that allows for
>>> more utility:
>
> I share Nick’s surprise.  :-)
>
> [...]
>
>> It's intentional and is a part of a design decision:
>>
>> For example for ("config/guix/channels.scm" ,(local-file "./chans.scm"))
>> chans.scm goes not to ~/.config/guix/channels.scm, but to
>> $XDG_CONFIG_DIR/guix/channels.scm, which can be a different location
>> from ~/.config, absent dot should partially break this expectation.
>>
>> It's a bad practice to use something without "config/..."  prefix and
>> generally it should be avoided, it still possible to use something
>> different in rare use-cases, for example for zsh: ("zshenv"
>> ,zshenv-file-like-here), because it's hard to implement the lookup for
>> initial configuration file other way for shells.
>
> Oh, I see.
>
>> You can elaborate more on what you try to achieve and I can try to give
>> you a recommendation how to implement it.
>
> I’d expect ‘home-files-service-type’ to do just that: add files to the
> home directory, without trying to be smart.
>
> Would it make sense to distinguish between ‘home-files’ and (say)
> ‘home-xdg-configuration-files’?

Yep, I can do that, actually, it will be even better for the purpose I
originally had.  I'll make home-files to store files as it is and
symlink manager not to add leading dots and a separate folder for
xdg configs.

Ludo, Nick, what do you think about following names?
~/.guix-home/home-dir-files/
~/.guix-home/xdg-config-dir-files/

>
> The latter would copy files to $XDG_CONFIG_DIR at activation time,
> whereas the former would just copy them to $HOME.
>
>
> I’d also suggest removing special handling of HOME/files in
> symlink-manager.scm.  Relations between the various components of Guix
> Home should preferably be made explicit via service extensions, and not
> implicit through conventions like this ‘files’ sub-directory.
>
> Thoughts?

Unfortunatelly, I don't know how to implement polymorphic behavior the
other way with current extension mechanism, so I would prefer to keep
this relation implicit, to make it possible to use a different machinery
instead of symlink manager to implement advanced techniques similar to
read-only home from Julien's guix-home-manager.

It's almost impossible to turn off symlink manager unintentionally, so
it should be ok.

-- 
Best regards,
Andrew Tropin
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#52808; Package guix. (Tue, 08 Feb 2022 09:48:01 GMT) Full text and rfc822 format available.

Message #23 received at 52808 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Andrew Tropin <andrew <at> trop.in>
Cc: 52808 <at> debbugs.gnu.org, Julien Lepiller <julien <at> lepiller.eu>,
 Nick Zalutskiy <nick <at> const.fun>
Subject: Re: bug#52808: Guix home should not assume that all targets are dot
 files
Date: Tue, 08 Feb 2022 10:46:57 +0100
Hi,

Andrew Tropin <andrew <at> trop.in> skribis:

>>> You can elaborate more on what you try to achieve and I can try to give
>>> you a recommendation how to implement it.
>>
>> I’d expect ‘home-files-service-type’ to do just that: add files to the
>> home directory, without trying to be smart.
>>
>> Would it make sense to distinguish between ‘home-files’ and (say)
>> ‘home-xdg-configuration-files’?
>
> Yep, I can do that, actually, it will be even better for the purpose I
> originally had.  I'll make home-files to store files as it is and
> symlink manager not to add leading dots and a separate folder for
> xdg configs.

Neat.

> Ludo, Nick, what do you think about following names?
> ~/.guix-home/home-dir-files/
> ~/.guix-home/xdg-config-dir-files/

I’d make it ‘…/home-files’ and ‘…/xdg-configuration-files’, but that’s a
detail.

>> I’d also suggest removing special handling of HOME/files in
>> symlink-manager.scm.  Relations between the various components of Guix
>> Home should preferably be made explicit via service extensions, and not
>> implicit through conventions like this ‘files’ sub-directory.
>>
>> Thoughts?
>
> Unfortunatelly, I don't know how to implement polymorphic behavior the
> other way with current extension mechanism, so I would prefer to keep
> this relation implicit,

I’m not sure I follow but maybe I should try by myself to get a better
understanding.

Thanks for your feedback!

Ludo’.




Information forwarded to bug-guix <at> gnu.org:
bug#52808; Package guix. (Tue, 08 Feb 2022 12:59:02 GMT) Full text and rfc822 format available.

Message #26 received at 52808 <at> debbugs.gnu.org (full text, mbox):

From: Xinglu Chen <public <at> yoctocell.xyz>
To: Ludovic Courtès <ludo <at> gnu.org>, Andrew Tropin
 <andrew <at> trop.in>
Cc: 52808 <at> debbugs.gnu.org, Nick Zalutskiy <nick <at> const.fun>
Subject: Re: bug#52808: Guix home should not assume that all targets are dot
 files
Date: Tue, 08 Feb 2022 13:58:13 +0100
[Message part 1 (text/plain, inline)]
Hi,

Ludovic schrieb am Sonntag der 30. Januar 2022 um 18:13 +01:

> I’d expect ‘home-files-service-type’ to do just that: add files to the
> home directory, without trying to be smart.
>
> Would it make sense to distinguish between ‘home-files’ and (say)
> ‘home-xdg-configuration-files’?

What about $XDG_DATA_HOME, or any other standard $XDG_* variable?  :-)

> The latter would copy files to $XDG_CONFIG_DIR at activation time,
> whereas the former would just copy them to $HOME.

When you say “copy”, you mean symlinking, right?  It would also be nice
to have a service which copies (cp) a file during activation and maybe
sets up different permissions for the file, e.g., executable.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#52808; Package guix. (Thu, 10 Feb 2022 20:33:02 GMT) Full text and rfc822 format available.

Message #29 received at 52808 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Xinglu Chen <public <at> yoctocell.xyz>
Cc: 52808 <at> debbugs.gnu.org, Nick Zalutskiy <nick <at> const.fun>,
 Andrew Tropin <andrew <at> trop.in>
Subject: Re: bug#52808: Guix home should not assume that all targets are dot
 files
Date: Thu, 10 Feb 2022 21:32:11 +0100
Hi,

Xinglu Chen <public <at> yoctocell.xyz> skribis:

> Ludovic schrieb am Sonntag der 30. Januar 2022 um 18:13 +01:
>
>> I’d expect ‘home-files-service-type’ to do just that: add files to the
>> home directory, without trying to be smart.
>>
>> Would it make sense to distinguish between ‘home-files’ and (say)
>> ‘home-xdg-configuration-files’?
>
> What about $XDG_DATA_HOME, or any other standard $XDG_* variable?  :-)

Hmm I don’t know?  :-)

>> The latter would copy files to $XDG_CONFIG_DIR at activation time,
>> whereas the former would just copy them to $HOME.
>
> When you say “copy”, you mean symlinking, right? 

Right.

> It would also be nice to have a service which copies (cp) a file
> during activation and maybe sets up different permissions for the
> file, e.g., executable.

Yes.

Ludo’.




Information forwarded to bug-guix <at> gnu.org:
bug#52808; Package guix. (Fri, 11 Feb 2022 15:53:02 GMT) Full text and rfc822 format available.

Message #32 received at 52808 <at> debbugs.gnu.org (full text, mbox):

From: Andrew Tropin <andrew <at> trop.in>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 52808 <at> debbugs.gnu.org, Julien Lepiller <julien <at> lepiller.eu>,
 Nick Zalutskiy <nick <at> const.fun>
Subject: Re: bug#52808: Guix home should not assume that all targets are dot
 files
Date: Fri, 11 Feb 2022 18:52:36 +0300
[Message part 1 (text/plain, inline)]
On 2022-02-08 10:46, Ludovic Courtès wrote:

> Hi,
>
> Andrew Tropin <andrew <at> trop.in> skribis:
>
>>>> You can elaborate more on what you try to achieve and I can try to give
>>>> you a recommendation how to implement it.
>>>
>>> I’d expect ‘home-files-service-type’ to do just that: add files to the
>>> home directory, without trying to be smart.
>>>
>>> Would it make sense to distinguish between ‘home-files’ and (say)
>>> ‘home-xdg-configuration-files’?
>>
>> Yep, I can do that, actually, it will be even better for the purpose I
>> originally had.  I'll make home-files to store files as it is and
>> symlink manager not to add leading dots and a separate folder for
>> xdg configs.
>
> Neat.
>
>> Ludo, Nick, what do you think about following names?
>> ~/.guix-home/home-dir-files/
>> ~/.guix-home/xdg-config-dir-files/
>
> I’d make it ‘…/home-files’ and ‘…/xdg-configuration-files’, but that’s a
> detail.
>
>>> I’d also suggest removing special handling of HOME/files in
>>> symlink-manager.scm.  Relations between the various components of Guix
>>> Home should preferably be made explicit via service extensions, and not
>>> implicit through conventions like this ‘files’ sub-directory.
>>>
>>> Thoughts?
>>
>> Unfortunatelly, I don't know how to implement polymorphic behavior the
>> other way with current extension mechanism, so I would prefer to keep
>> this relation implicit,
>
> I’m not sure I follow but maybe I should try by myself to get a better
> understanding.
>
> Thanks for your feedback!
>
> Ludo’.

I decided to go one step at a time, and prepared a patch series, which:

1. Adds an explicit connection between home-files-service-type and
symlink-manager by introducing a global constant used by both services.

2. Adds a home-xdg-configuration-files-service-type, which accepts a
list of files for XDG_CONFIG_DIR, `(("mpv/mpv.conf" ,file-like-here))

3. Migrates all (gnu home services) to xdg-configuration-files.

4. Make symlink-manager respect XDG_CONIFG_HOME and
xdg-configuration-files-subdir.

After that patch series is merged we can give a time for users to
migrate their self-made home services to xdg-configuration-files and
after for example 2 weeks, remove special handling of dots for
home-files.

[0001-home-Explicitly-connect-home-file-and-symlink-manage.patch (text/x-patch, inline)]
From 0cd37bbc724f9c793898c2655bdd1c335045c5f0 Mon Sep 17 00:00:00 2001
From: Andrew Tropin <andrew <at> trop.in>
Date: Fri, 11 Feb 2022 10:55:01 +0300
Subject: [PATCH 1/5] home: Explicitly connect home-file and symlink-manager
 services.

* gnu/home/services.scm (home-files-directory): New variable.
* gnu/home/symlink-manager.scm (update-symlinks-script): Use
home-files-directory variable from (gnu home services).
---
 gnu/home/services.scm                 | 23 ++++++++++++++---------
 gnu/home/services/symlink-manager.scm | 17 +++++++++--------
 2 files changed, 23 insertions(+), 17 deletions(-)

diff --git a/gnu/home/services.scm b/gnu/home/services.scm
index 1cd19ce7f9..e4e3717b80 100644
--- a/gnu/home/services.scm
+++ b/gnu/home/services.scm
@@ -43,6 +43,8 @@ (define-module (gnu home services)
             home-run-on-change-service-type
             home-provenance-service-type
 
+            home-files-directory
+
             fold-home-service-types
             home-provenance
 
@@ -74,12 +76,11 @@ (define-module (gnu home services)
 ;;; file (details described in the manual).
 ;;;
 ;;; home-files-service-type is similar to etc-service-type, but doesn't extend
-;;; home-activation, because deploy mechanism for config files is pluggable and
-;;; can be different for different home environments: The default one is called
-;;; symlink-manager (will be introudced in a separate patch series), which creates
-;;; links for various dotfiles (like $XDG_CONFIG_HOME/$APP/...) to store, but is
-;;; possible to implement alternative approaches like read-only home from Julien's
-;;; guix-home-manager.
+;;; home-activation, because deploy mechanism for config files is pluggable
+;;; and can be different for different home environments: The default one is
+;;; called symlink-manager, which creates links for various dotfiles and xdg
+;;; configuration files to store, but is possible to implement alternative
+;;; approaches like read-only home from Julien's guix-home-manager.
 ;;;
 ;;; home-run-on-first-login-service-type provides an @file{on-first-login} guile
 ;;; script, which runs provided gexps once, when user makes first login.  It can
@@ -262,11 +263,14 @@ (define (assert-no-duplicates files)
 
   (file-union "files" files))
 
+;; Used by symlink-manager
+(define home-files-directory "files")
+
 (define (files-entry files)
   "Return an entry for the @file{~/.guix-home/files}
 directory containing FILES."
   (with-monad %store-monad
-    (return `(("files" ,(files->files-directory files))))))
+    (return `((,home-files-directory ,(files->files-directory files))))))
 
 (define home-files-service-type
   (service-type (name 'home-files)
@@ -276,8 +280,9 @@ (define home-files-service-type
                 (compose concatenate)
                 (extend append)
                 (default-value '())
-                (description "Configuration files for programs that
-will be put in @file{~/.guix-home/files}.")))
+                (description (format #f "Files that will be put in
+@file{~~/.guix-home/~a}, and further processed during activation."
+                                     home-files-directory))))
 
 (define %initialize-gettext
   #~(begin
diff --git a/gnu/home/services/symlink-manager.scm b/gnu/home/services/symlink-manager.scm
index 314da3ba3e..747bb343d3 100644
--- a/gnu/home/services/symlink-manager.scm
+++ b/gnu/home/services/symlink-manager.scm
@@ -25,12 +25,11 @@ (define-module (gnu home services symlink-manager)
 
 ;;; Comment:
 ;;;
-;;; symlink-manager cares about configuration files: it backs up files
-;;; created by user, removes symlinks and directories created by a
-;;; previous generation, and creates new directories and symlinks to
-;;; configuration files according to the content of files/ directory
-;;; (created by home-files-service) of the current home environment
-;;; generation.
+;;; symlink-manager cares about xdg configurations and other files: it backs
+;;; up files created by user, removes symlinks and directories created by a
+;;; previous generation, and creates new directories and symlinks to files
+;;; according to the content of directories (created by home-files-service) of
+;;; the current home environment generation.
 ;;;
 ;;; Code:
 
@@ -94,7 +93,8 @@ (define ((file-tree-traverse preordering) node)
               (new-home (getenv "GUIX_NEW_HOME"))
               (old-home (getenv "GUIX_OLD_HOME"))
 
-              (new-files-path (string-append new-home "/files"))
+              (new-files-path (string-append
+                               new-home "/" #$home-files-directory))
               ;; Trailing dot is required, because files itself is symlink and
               ;; to make file-system-tree works it should be a directory.
               (new-files-dir-path (string-append new-files-path "/."))
@@ -107,7 +107,8 @@ (define ((file-tree-traverse preordering) node)
               (old-tree (if old-home
                           ((simplify-file-tree "")
                            (file-system-tree
-                            (string-append old-home "/files/.")))
+                            (string-append
+                             old-home "/" #$home-files-directory "/.")))
                           #f))
               (new-tree ((simplify-file-tree "")
                          (file-system-tree new-files-dir-path)))
-- 
2.34.0

[0002-home-Add-home-xdg-configuration-files-service.patch (text/x-patch, inline)]
From 23f7095d60b18b52de0d1aa314c4012cdf55a046 Mon Sep 17 00:00:00 2001
From: Andrew Tropin <andrew <at> trop.in>
Date: Fri, 11 Feb 2022 11:03:02 +0300
Subject: [PATCH 2/5] home: Add home-xdg-configuration-files service.

* gnu/home/services.scm (home-xdg-configuration-files): New variable.
---
 gnu/home/services.scm | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/gnu/home/services.scm b/gnu/home/services.scm
index e4e3717b80..bf044a0421 100644
--- a/gnu/home/services.scm
+++ b/gnu/home/services.scm
@@ -38,12 +38,14 @@ (define-module (gnu home services)
             home-profile-service-type
             home-environment-variables-service-type
             home-files-service-type
+            home-xdg-configuration-files-service-type
             home-run-on-first-login-service-type
             home-activation-service-type
             home-run-on-change-service-type
             home-provenance-service-type
 
             home-files-directory
+            xdg-configuration-files-subdir
 
             fold-home-service-types
             home-provenance
@@ -284,6 +286,27 @@ (define home-files-service-type
 @file{~~/.guix-home/~a}, and further processed during activation."
                                      home-files-directory))))
 
+(define xdg-configuration-files-subdir "config")
+
+(define (xdg-configuration-files files)
+  (map (lambda (lst)
+         (cons (string-append xdg-configuration-files-subdir
+                              "/" (car lst)) (cdr lst)))
+         files))
+
+(define home-xdg-configuration-files-service-type
+  (service-type (name 'home-files)
+                (extensions
+                 (list (service-extension home-files-service-type
+                                          xdg-configuration-files)))
+                (compose concatenate)
+                (extend append)
+                (default-value '())
+                (description (format #f "Files that will be put in
+@file{~~/.guix-home/~a/~a}, and further processed during activation."
+                                     home-files-directory
+                                     xdg-configuration-files))))
+
 (define %initialize-gettext
   #~(begin
       (bindtextdomain %gettext-domain
-- 
2.34.0

[0003-home-shells-Migrate-zsh-to-xdg-configuration-files.patch (text/x-patch, inline)]
From 11f23a48d480a91d6bfba0ff55c1a9831585a4ee Mon Sep 17 00:00:00 2001
From: Andrew Tropin <andrew <at> trop.in>
Date: Fri, 11 Feb 2022 15:03:44 +0300
Subject: [PATCH 3/5] home: shells: Migrate zsh to xdg-configuration-files.

* gnu/home/services.scm (home-zsh-service-type): Additionally extend
home-xdg-configuration-files-service-type.
---
 gnu/home/services/shells.scm | 112 +++++++++++++++++++----------------
 1 file changed, 61 insertions(+), 51 deletions(-)

diff --git a/gnu/home/services/shells.scm b/gnu/home/services/shells.scm
index ca7f4ac0ad..4b3618a868 100644
--- a/gnu/home/services/shells.scm
+++ b/gnu/home/services/shells.scm
@@ -171,56 +171,27 @@ (define-configuration home-zsh-configuration
 won't be read in some cases (if the shell terminates by exec'ing
 another process for example)."))
 
-(define (add-zsh-configuration config)
-  (let* ((xdg-flavor? (home-zsh-configuration-xdg-flavor? config)))
+(define (zsh-filter-fields field)
+  (filter-configuration-fields home-zsh-configuration-fields (list field)))
 
-    (define prefix-file
-      (cut string-append
-        (if xdg-flavor?
-            "config/zsh/."
-            "") <>))
+(define (zsh-serialize-field config field)
+  (serialize-configuration config (zsh-filter-fields field)))
 
-    (define (filter-fields field)
-      (filter-configuration-fields home-zsh-configuration-fields
-                                   (list field)))
+(define* (zsh-field-not-empty? config field)
+  (let ((file-name (symbol->string field))
+        (field-obj (car (zsh-filter-fields field))))
+    (not (null? ((configuration-field-getter field-obj) config)))))
 
-    (define (serialize-field field)
-      (serialize-configuration
-       config
-       (filter-fields field)))
+(define (zsh-file-zshenv config)
+  (mixed-text-file
+   "zshenv"
+   (zsh-serialize-field config 'zshenv)
+   (zsh-serialize-field config 'environment-variables)))
 
-    (define (file-if-not-empty field)
-      (let ((file-name (symbol->string field))
-            (field-obj (car (filter-fields field))))
-        (if (not (null? ((configuration-field-getter field-obj) config)))
-            `(,(prefix-file file-name)
-              ,(mixed-text-file
-                file-name
-                (serialize-field field)))
-            '())))
-
-    (filter
-     (compose not null?)
-     `(,(if xdg-flavor?
-            `("zshenv"
-              ,(mixed-text-file
-                "auxiliary-zshenv"
-                (if xdg-flavor?
-                    "source ${XDG_CONFIG_HOME:-$HOME/.config}/zsh/.zshenv\n"
-                    "")))
-            '())
-       (,(prefix-file "zshenv")
-        ,(mixed-text-file
-          "zshenv"
-          (if xdg-flavor?
-              "export ZDOTDIR=${XDG_CONFIG_HOME:-$HOME/.config}/zsh\n"
-              "")
-          (serialize-field 'zshenv)
-          (serialize-field 'environment-variables)))
-       (,(prefix-file "zprofile")
-        ,(mixed-text-file
-          "zprofile"
-          "\
+(define (zsh-file-zprofile config)
+  (mixed-text-file
+   "zprofile"
+   "\
 # Setups system and user profiles and related variables
 source /etc/profile
 # Setups home environment profile
@@ -229,11 +200,47 @@ (define (file-if-not-empty field)
 # It's only necessary if zsh is a login shell, otherwise profiles will
 # be already sourced by bash
 "
-          (serialize-field 'zprofile)))
+   (zsh-serialize-field config 'zprofile)))
 
-       ,@(list (file-if-not-empty 'zshrc)
-               (file-if-not-empty 'zlogin)
-               (file-if-not-empty 'zlogout))))))
+(define (zsh-file-by-field config field)
+  (match field
+    ('zshenv (zsh-file-zshenv config))
+    ('zprofile (zsh-file-zprofile config))
+    (e (mixed-text-file
+        (symbol->string field)
+        (zsh-serialize-field config field)))))
+
+(define (zsh-get-configuration-files config)
+  `(("zprofile" ,(zsh-file-by-field config 'zprofile)) ;; Always non-empty
+    ,@(if (and (zsh-field-not-empty? config 'zshenv)
+               (zsh-field-not-empty? config 'environment-variables))
+          `(("zshenv" ,(zsh-file-by-field config 'zshenv))) '())
+    ,@(if (zsh-field-not-empty? config 'zshrc)
+          `(("zshrc" ,(zsh-file-by-field config 'zshrc))) '())
+    ,@(if (zsh-field-not-empty? config 'zlogin)
+          `(("zlogin" ,(zsh-file-by-field config 'zlogin))) '())
+    ,@(if (zsh-field-not-empty? config 'zlogout)
+          `(("zlogout" ,(zsh-file-by-field config 'zlogout))) '())))
+
+(define (zsh-home-files config)
+  (define zshenv-auxiliary-file
+    (mixed-text-file
+     "zshenv-auxiliary"
+     "export ZDOTDIR=${XDG_CONFIG_HOME:-$HOME/.config}/zsh\n"
+     "[[ -f $ZDOTDIR/.zshenv ]] && source $ZDOTDIR/.zshenv\n"))
+
+  (if (home-zsh-configuration-xdg-flavor? config)
+      `(("zshenv" ,zshenv-auxiliary-file))
+      (zsh-get-configuration-files config)))
+
+(define (zsh-xdg-configuration-files config)
+  (if (home-zsh-configuration-xdg-flavor? config)
+      (map
+       (lambda (lst)
+         (cons (string-append "zsh/." (car lst))
+               (cdr lst)))
+       (zsh-get-configuration-files config))
+      '()))
 
 (define (add-zsh-packages config)
   (list (home-zsh-configuration-package config)))
@@ -291,7 +298,10 @@ (define home-zsh-service-type
                 (extensions
                  (list (service-extension
                         home-files-service-type
-                        add-zsh-configuration)
+                        zsh-home-files)
+                       (service-extension
+                        home-xdg-configuration-files-service-type
+                        zsh-xdg-configuration-files)
                        (service-extension
                         home-profile-service-type
                         add-zsh-packages)))
-- 
2.34.0

[0004-home-Migrate-fountutils-and-xdg-modules-to-xdg-confi.patch (text/x-patch, inline)]
From ef4c3bbcc0c8c1a251f4ad6c494f8ed30adf45f2 Mon Sep 17 00:00:00 2001
From: Andrew Tropin <andrew <at> trop.in>
Date: Fri, 11 Feb 2022 15:34:46 +0300
Subject: [PATCH 4/5] home: Migrate fountutils and xdg modules to
 xdg-configuration-files.

* gnu/home/services/fontutils.scm (home-fontconfig-service-type): Migrate to
xdg-configuration-files.
* gnu/home/services/xdg.scm (home-xdg-user-directories-service-type,
home-xdg-mime-applications-service-type): Migrate to xdg-configuration-files.
---
 gnu/home/services/fontutils.scm |  4 ++--
 gnu/home/services/xdg.scm       | 31 +++++++++++++++++--------------
 2 files changed, 19 insertions(+), 16 deletions(-)

diff --git a/gnu/home/services/fontutils.scm b/gnu/home/services/fontutils.scm
index 772904367d..6062eaed6a 100644
--- a/gnu/home/services/fontutils.scm
+++ b/gnu/home/services/fontutils.scm
@@ -34,7 +34,7 @@ (define-module (gnu home services fontutils)
 ;;; Code:
 
 (define (add-fontconfig-config-file he-symlink-path)
-  `(("config/fontconfig/fonts.conf"
+  `(("fontconfig/fonts.conf"
      ,(mixed-text-file
        "fonts.conf"
        "<?xml version='1.0'?>
@@ -51,7 +51,7 @@ (define home-fontconfig-service-type
   (service-type (name 'home-fontconfig)
                 (extensions
                  (list (service-extension
-                        home-files-service-type
+                        home-xdg-configuration-files-service-type
                         add-fontconfig-config-file)
                        (service-extension
                         home-run-on-change-service-type
diff --git a/gnu/home/services/xdg.scm b/gnu/home/services/xdg.scm
index d230dd7665..9c43aa93b9 100644
--- a/gnu/home/services/xdg.scm
+++ b/gnu/home/services/xdg.scm
@@ -190,11 +190,11 @@ (define-configuration home-xdg-user-directories-configuration
    "Default directory for videos."))
 
 (define (home-xdg-user-directories-files-service config)
-  `(("config/user-dirs.conf"
+  `(("user-dirs.conf"
      ,(mixed-text-file
        "user-dirs.conf"
        "enabled=False\n"))
-    ("config/user-dirs.dirs"
+    ("user-dirs.dirs"
      ,(mixed-text-file
        "user-dirs.dirs"
       (serialize-configuration
@@ -218,7 +218,7 @@ (define home-xdg-user-directories-service-type
   (service-type (name 'home-xdg-user-directories)
                 (extensions
                  (list (service-extension
-                        home-files-service-type
+                        home-xdg-configuration-files-service-type
                         home-xdg-user-directories-files-service)
                        (service-extension
                         home-activation-service-type
@@ -417,7 +417,7 @@ (define-configuration home-xdg-mime-applications-configuration
    "A list of XDG desktop entries to create.  See
 @code{xdg-desktop-entry}."))
 
-(define (home-xdg-mime-applications-files-service config)
+(define (home-xdg-mime-applications-files config)
   (define (add-xdg-desktop-entry-file entry)
     (let ((file (first entry))
           (config (second entry)))
@@ -425,16 +425,16 @@ (define (add-xdg-desktop-entry-file entry)
           (apply mixed-text-file
                  (format #f "xdg-desktop-~a-entry" file)
                  config))))
+  (map (compose add-xdg-desktop-entry-file serialize-xdg-desktop-entry)
+       (home-xdg-mime-applications-configuration-desktop-entries config)))
 
-  (append
-   `(("config/mimeapps.list"
-      ,(mixed-text-file
-        "xdg-mime-appplications"
-        (serialize-configuration
-         config
-         home-xdg-mime-applications-configuration-fields))))
-   (map (compose add-xdg-desktop-entry-file serialize-xdg-desktop-entry)
-        (home-xdg-mime-applications-configuration-desktop-entries config))))
+(define (home-xdg-mime-applications-xdg-files config)
+  `(("mimeapps.list"
+     ,(mixed-text-file
+       "xdg-mime-appplications"
+       (serialize-configuration
+        config
+        home-xdg-mime-applications-configuration-fields)))))
 
 (define (home-xdg-mime-applications-extension old-config extension-configs)
   (define (extract-fields config)
@@ -469,7 +469,10 @@ (define home-xdg-mime-applications-service-type
                 (extensions
                  (list (service-extension
                         home-files-service-type
-                        home-xdg-mime-applications-files-service)))
+                        home-xdg-mime-applications-files)
+                       (service-extension
+                        home-xdg-configuration-files-service-type
+                        home-xdg-mime-applications-xdg-files)))
                 (compose identity)
                 (extend home-xdg-mime-applications-extension)
                 (default-value (home-xdg-mime-applications-configuration))
-- 
2.34.0

[0005-home-symlink-manager-Respect-XDG_CONFIG_HOME-during-.patch (text/x-patch, inline)]
From 089683bbd301f6e085f00fbd53713f335abac40e Mon Sep 17 00:00:00 2001
From: Andrew Tropin <andrew <at> trop.in>
Date: Fri, 11 Feb 2022 16:14:23 +0300
Subject: [PATCH 5/5] home: symlink-manager: Respect XDG_CONFIG_HOME during
 activation.

* gnu/home/services/symlink-manager.scm (update-symlinks-script): Respect
XDG_CONFIG_HOME during activation.
---
 gnu/home/services/symlink-manager.scm | 25 +++++++++++++++++++++----
 1 file changed, 21 insertions(+), 4 deletions(-)

diff --git a/gnu/home/services/symlink-manager.scm b/gnu/home/services/symlink-manager.scm
index 747bb343d3..418bfbd98a 100644
--- a/gnu/home/services/symlink-manager.scm
+++ b/gnu/home/services/symlink-manager.scm
@@ -85,8 +85,8 @@ (define ((file-tree-traverse preordering) node)
 
        (use-modules (guix build utils))
 
-       (let* ((config-home    (or (getenv "XDG_CONFIG_HOME")
-                                  (string-append (getenv "HOME") "/.config")))
+       (let* ((xdg-config-home (or (getenv "XDG_CONFIG_HOME")
+                                   (string-append (getenv "HOME") "/.config")))
 
               (he-path (string-append (getenv "HOME") "/.guix-home"))
               (new-he-path (string-append he-path ".new"))
@@ -117,13 +117,24 @@ (define ((file-tree-traverse preordering) node)
                (lambda (path)
                  (readlink (string-append new-files-path "/" path))))
 
+              (preprocess-path
+               (lambda (path)
+                 "If file is in xdg-configuration-files-subdir use
+subdirectory from XDG_CONFIG_HOME to generate a target path."
+                 (if (string-prefix? #$xdg-configuration-files-subdir path)
+                     (string-append
+                      (substring xdg-config-home (1+ (string-length home-path)))
+                      (substring
+                       path (string-length #$xdg-configuration-files-subdir)))
+                     (string-append "." path))))
+
               (get-target-path
                (lambda (path)
-                 (string-append home-path "/." path)))
+                 (string-append home-path "/" (preprocess-path path))))
 
               (get-backup-path
                (lambda (path)
-                 (string-append backup-dir "/." path)))
+                 (string-append backup-dir "/" (preprocess-path path))))
 
               (directory?
                (lambda (path)
@@ -224,6 +235,12 @@ (define ((file-tree-traverse preordering) node)
                        (display (G_ " done\n"))))
                     to-create)))))
 
+         (format #t "home-path: ~a\nxdg-config-home: ~a\n"
+                 home-path xdg-config-home)
+
+         (format #t "prepr: ~a\n"
+                 (preprocess-path "config/sway/config"))
+
          (when old-tree
            (cleanup-symlinks))
 
-- 
2.34.0

[Message part 7 (text/plain, inline)]
-- 
Best regards,
Andrew Tropin
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#52808; Package guix. (Sat, 26 Feb 2022 07:14:02 GMT) Full text and rfc822 format available.

Message #35 received at 52808 <at> debbugs.gnu.org (full text, mbox):

From: Andrew Tropin <andrew <at> trop.in>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 52808 <at> debbugs.gnu.org, Julien Lepiller <julien <at> lepiller.eu>,
 Nick Zalutskiy <nick <at> const.fun>
Subject: Re: bug#52808: Guix home should not assume that all targets are dot
 files
Date: Sat, 26 Feb 2022 10:13:29 +0300
[Message part 1 (text/plain, inline)]
On 2022-02-11 18:52, Andrew Tropin wrote:

> On 2022-02-08 10:46, Ludovic Courtès wrote:
>
>> Hi,
>>
>> Andrew Tropin <andrew <at> trop.in> skribis:
>>
>>>>> You can elaborate more on what you try to achieve and I can try to give
>>>>> you a recommendation how to implement it.
>>>>
>>>> I’d expect ‘home-files-service-type’ to do just that: add files to the
>>>> home directory, without trying to be smart.
>>>>
>>>> Would it make sense to distinguish between ‘home-files’ and (say)
>>>> ‘home-xdg-configuration-files’?
>>>
>>> Yep, I can do that, actually, it will be even better for the purpose I
>>> originally had.  I'll make home-files to store files as it is and
>>> symlink manager not to add leading dots and a separate folder for
>>> xdg configs.
>>
>> Neat.
>>
>>> Ludo, Nick, what do you think about following names?
>>> ~/.guix-home/home-dir-files/
>>> ~/.guix-home/xdg-config-dir-files/
>>
>> I’d make it ‘…/home-files’ and ‘…/xdg-configuration-files’, but that’s a
>> detail.
>>
>>>> I’d also suggest removing special handling of HOME/files in
>>>> symlink-manager.scm.  Relations between the various components of Guix
>>>> Home should preferably be made explicit via service extensions, and not
>>>> implicit through conventions like this ‘files’ sub-directory.
>>>>
>>>> Thoughts?
>>>
>>> Unfortunatelly, I don't know how to implement polymorphic behavior the
>>> other way with current extension mechanism, so I would prefer to keep
>>> this relation implicit,
>>
>> I’m not sure I follow but maybe I should try by myself to get a better
>> understanding.
>>
>> Thanks for your feedback!
>>
>> Ludo’.
>
> I decided to go one step at a time, and prepared a patch series, which:
>
> 1. Adds an explicit connection between home-files-service-type and
> symlink-manager by introducing a global constant used by both services.
>
> 2. Adds a home-xdg-configuration-files-service-type, which accepts a
> list of files for XDG_CONFIG_DIR, `(("mpv/mpv.conf" ,file-like-here))
>
> 3. Migrates all (gnu home services) to xdg-configuration-files.
>
> 4. Make symlink-manager respect XDG_CONIFG_HOME and
> xdg-configuration-files-subdir.
>
> After that patch series is merged we can give a time for users to
> migrate their self-made home services to xdg-configuration-files and
> after for example 2 weeks, remove special handling of dots for
> home-files.
>
> From 0cd37bbc724f9c793898c2655bdd1c335045c5f0 Mon Sep 17 00:00:00 2001
> From: Andrew Tropin <andrew <at> trop.in>
> Date: Fri, 11 Feb 2022 10:55:01 +0300
> Subject: [PATCH 1/5] home: Explicitly connect home-file and symlink-manager
>  services.
>
> * gnu/home/services.scm (home-files-directory): New variable.
> * gnu/home/symlink-manager.scm (update-symlinks-script): Use
> home-files-directory variable from (gnu home services).
> ---
>  gnu/home/services.scm                 | 23 ++++++++++++++---------
>  gnu/home/services/symlink-manager.scm | 17 +++++++++--------
>  2 files changed, 23 insertions(+), 17 deletions(-)
>
> diff --git a/gnu/home/services.scm b/gnu/home/services.scm
> index 1cd19ce7f9..e4e3717b80 100644
> --- a/gnu/home/services.scm
> +++ b/gnu/home/services.scm
> @@ -43,6 +43,8 @@ (define-module (gnu home services)
>              home-run-on-change-service-type
>              home-provenance-service-type
>  
> +            home-files-directory
> +
>              fold-home-service-types
>              home-provenance
>  
> @@ -74,12 +76,11 @@ (define-module (gnu home services)
>  ;;; file (details described in the manual).
>  ;;;
>  ;;; home-files-service-type is similar to etc-service-type, but doesn't extend
> -;;; home-activation, because deploy mechanism for config files is pluggable and
> -;;; can be different for different home environments: The default one is called
> -;;; symlink-manager (will be introudced in a separate patch series), which creates
> -;;; links for various dotfiles (like $XDG_CONFIG_HOME/$APP/...) to store, but is
> -;;; possible to implement alternative approaches like read-only home from Julien's
> -;;; guix-home-manager.
> +;;; home-activation, because deploy mechanism for config files is pluggable
> +;;; and can be different for different home environments: The default one is
> +;;; called symlink-manager, which creates links for various dotfiles and xdg
> +;;; configuration files to store, but is possible to implement alternative
> +;;; approaches like read-only home from Julien's guix-home-manager.
>  ;;;
>  ;;; home-run-on-first-login-service-type provides an @file{on-first-login} guile
>  ;;; script, which runs provided gexps once, when user makes first login.  It can
> @@ -262,11 +263,14 @@ (define (assert-no-duplicates files)
>  
>    (file-union "files" files))
>  
> +;; Used by symlink-manager
> +(define home-files-directory "files")
> +
>  (define (files-entry files)
>    "Return an entry for the @file{~/.guix-home/files}
>  directory containing FILES."
>    (with-monad %store-monad
> -    (return `(("files" ,(files->files-directory files))))))
> +    (return `((,home-files-directory ,(files->files-directory files))))))
>  
>  (define home-files-service-type
>    (service-type (name 'home-files)
> @@ -276,8 +280,9 @@ (define home-files-service-type
>                  (compose concatenate)
>                  (extend append)
>                  (default-value '())
> -                (description "Configuration files for programs that
> -will be put in @file{~/.guix-home/files}.")))
> +                (description (format #f "Files that will be put in
> +@file{~~/.guix-home/~a}, and further processed during activation."
> +                                     home-files-directory))))
>  
>  (define %initialize-gettext
>    #~(begin
> diff --git a/gnu/home/services/symlink-manager.scm b/gnu/home/services/symlink-manager.scm
> index 314da3ba3e..747bb343d3 100644
> --- a/gnu/home/services/symlink-manager.scm
> +++ b/gnu/home/services/symlink-manager.scm
> @@ -25,12 +25,11 @@ (define-module (gnu home services symlink-manager)
>  
>  ;;; Comment:
>  ;;;
> -;;; symlink-manager cares about configuration files: it backs up files
> -;;; created by user, removes symlinks and directories created by a
> -;;; previous generation, and creates new directories and symlinks to
> -;;; configuration files according to the content of files/ directory
> -;;; (created by home-files-service) of the current home environment
> -;;; generation.
> +;;; symlink-manager cares about xdg configurations and other files: it backs
> +;;; up files created by user, removes symlinks and directories created by a
> +;;; previous generation, and creates new directories and symlinks to files
> +;;; according to the content of directories (created by home-files-service) of
> +;;; the current home environment generation.
>  ;;;
>  ;;; Code:
>  
> @@ -94,7 +93,8 @@ (define ((file-tree-traverse preordering) node)
>                (new-home (getenv "GUIX_NEW_HOME"))
>                (old-home (getenv "GUIX_OLD_HOME"))
>  
> -              (new-files-path (string-append new-home "/files"))
> +              (new-files-path (string-append
> +                               new-home "/" #$home-files-directory))
>                ;; Trailing dot is required, because files itself is symlink and
>                ;; to make file-system-tree works it should be a directory.
>                (new-files-dir-path (string-append new-files-path "/."))
> @@ -107,7 +107,8 @@ (define ((file-tree-traverse preordering) node)
>                (old-tree (if old-home
>                            ((simplify-file-tree "")
>                             (file-system-tree
> -                            (string-append old-home "/files/.")))
> +                            (string-append
> +                             old-home "/" #$home-files-directory "/.")))
>                            #f))
>                (new-tree ((simplify-file-tree "")
>                           (file-system-tree new-files-dir-path)))
> -- 
> 2.34.0
>
> From 23f7095d60b18b52de0d1aa314c4012cdf55a046 Mon Sep 17 00:00:00 2001
> From: Andrew Tropin <andrew <at> trop.in>
> Date: Fri, 11 Feb 2022 11:03:02 +0300
> Subject: [PATCH 2/5] home: Add home-xdg-configuration-files service.
>
> * gnu/home/services.scm (home-xdg-configuration-files): New variable.
> ---
>  gnu/home/services.scm | 23 +++++++++++++++++++++++
>  1 file changed, 23 insertions(+)
>
> diff --git a/gnu/home/services.scm b/gnu/home/services.scm
> index e4e3717b80..bf044a0421 100644
> --- a/gnu/home/services.scm
> +++ b/gnu/home/services.scm
> @@ -38,12 +38,14 @@ (define-module (gnu home services)
>              home-profile-service-type
>              home-environment-variables-service-type
>              home-files-service-type
> +            home-xdg-configuration-files-service-type
>              home-run-on-first-login-service-type
>              home-activation-service-type
>              home-run-on-change-service-type
>              home-provenance-service-type
>  
>              home-files-directory
> +            xdg-configuration-files-subdir
>  
>              fold-home-service-types
>              home-provenance
> @@ -284,6 +286,27 @@ (define home-files-service-type
>  @file{~~/.guix-home/~a}, and further processed during activation."
>                                       home-files-directory))))
>  
> +(define xdg-configuration-files-subdir "config")
> +
> +(define (xdg-configuration-files files)
> +  (map (lambda (lst)
> +         (cons (string-append xdg-configuration-files-subdir
> +                              "/" (car lst)) (cdr lst)))
> +         files))
> +
> +(define home-xdg-configuration-files-service-type
> +  (service-type (name 'home-files)
> +                (extensions
> +                 (list (service-extension home-files-service-type
> +                                          xdg-configuration-files)))
> +                (compose concatenate)
> +                (extend append)
> +                (default-value '())
> +                (description (format #f "Files that will be put in
> +@file{~~/.guix-home/~a/~a}, and further processed during activation."
> +                                     home-files-directory
> +                                     xdg-configuration-files))))
> +
>  (define %initialize-gettext
>    #~(begin
>        (bindtextdomain %gettext-domain
> -- 
> 2.34.0
>
> From 11f23a48d480a91d6bfba0ff55c1a9831585a4ee Mon Sep 17 00:00:00 2001
> From: Andrew Tropin <andrew <at> trop.in>
> Date: Fri, 11 Feb 2022 15:03:44 +0300
> Subject: [PATCH 3/5] home: shells: Migrate zsh to xdg-configuration-files.
>
> * gnu/home/services.scm (home-zsh-service-type): Additionally extend
> home-xdg-configuration-files-service-type.
> ---
>  gnu/home/services/shells.scm | 112 +++++++++++++++++++----------------
>  1 file changed, 61 insertions(+), 51 deletions(-)
>
> diff --git a/gnu/home/services/shells.scm b/gnu/home/services/shells.scm
> index ca7f4ac0ad..4b3618a868 100644
> --- a/gnu/home/services/shells.scm
> +++ b/gnu/home/services/shells.scm
> @@ -171,56 +171,27 @@ (define-configuration home-zsh-configuration
>  won't be read in some cases (if the shell terminates by exec'ing
>  another process for example)."))
>  
> -(define (add-zsh-configuration config)
> -  (let* ((xdg-flavor? (home-zsh-configuration-xdg-flavor? config)))
> +(define (zsh-filter-fields field)
> +  (filter-configuration-fields home-zsh-configuration-fields (list field)))
>  
> -    (define prefix-file
> -      (cut string-append
> -        (if xdg-flavor?
> -            "config/zsh/."
> -            "") <>))
> +(define (zsh-serialize-field config field)
> +  (serialize-configuration config (zsh-filter-fields field)))
>  
> -    (define (filter-fields field)
> -      (filter-configuration-fields home-zsh-configuration-fields
> -                                   (list field)))
> +(define* (zsh-field-not-empty? config field)
> +  (let ((file-name (symbol->string field))
> +        (field-obj (car (zsh-filter-fields field))))
> +    (not (null? ((configuration-field-getter field-obj) config)))))
>  
> -    (define (serialize-field field)
> -      (serialize-configuration
> -       config
> -       (filter-fields field)))
> +(define (zsh-file-zshenv config)
> +  (mixed-text-file
> +   "zshenv"
> +   (zsh-serialize-field config 'zshenv)
> +   (zsh-serialize-field config 'environment-variables)))
>  
> -    (define (file-if-not-empty field)
> -      (let ((file-name (symbol->string field))
> -            (field-obj (car (filter-fields field))))
> -        (if (not (null? ((configuration-field-getter field-obj) config)))
> -            `(,(prefix-file file-name)
> -              ,(mixed-text-file
> -                file-name
> -                (serialize-field field)))
> -            '())))
> -
> -    (filter
> -     (compose not null?)
> -     `(,(if xdg-flavor?
> -            `("zshenv"
> -              ,(mixed-text-file
> -                "auxiliary-zshenv"
> -                (if xdg-flavor?
> -                    "source ${XDG_CONFIG_HOME:-$HOME/.config}/zsh/.zshenv\n"
> -                    "")))
> -            '())
> -       (,(prefix-file "zshenv")
> -        ,(mixed-text-file
> -          "zshenv"
> -          (if xdg-flavor?
> -              "export ZDOTDIR=${XDG_CONFIG_HOME:-$HOME/.config}/zsh\n"
> -              "")
> -          (serialize-field 'zshenv)
> -          (serialize-field 'environment-variables)))
> -       (,(prefix-file "zprofile")
> -        ,(mixed-text-file
> -          "zprofile"
> -          "\
> +(define (zsh-file-zprofile config)
> +  (mixed-text-file
> +   "zprofile"
> +   "\
>  # Setups system and user profiles and related variables
>  source /etc/profile
>  # Setups home environment profile
> @@ -229,11 +200,47 @@ (define (file-if-not-empty field)
>  # It's only necessary if zsh is a login shell, otherwise profiles will
>  # be already sourced by bash
>  "
> -          (serialize-field 'zprofile)))
> +   (zsh-serialize-field config 'zprofile)))
>  
> -       ,@(list (file-if-not-empty 'zshrc)
> -               (file-if-not-empty 'zlogin)
> -               (file-if-not-empty 'zlogout))))))
> +(define (zsh-file-by-field config field)
> +  (match field
> +    ('zshenv (zsh-file-zshenv config))
> +    ('zprofile (zsh-file-zprofile config))
> +    (e (mixed-text-file
> +        (symbol->string field)
> +        (zsh-serialize-field config field)))))
> +
> +(define (zsh-get-configuration-files config)
> +  `(("zprofile" ,(zsh-file-by-field config 'zprofile)) ;; Always non-empty
> +    ,@(if (and (zsh-field-not-empty? config 'zshenv)
> +               (zsh-field-not-empty? config 'environment-variables))
> +          `(("zshenv" ,(zsh-file-by-field config 'zshenv))) '())
> +    ,@(if (zsh-field-not-empty? config 'zshrc)
> +          `(("zshrc" ,(zsh-file-by-field config 'zshrc))) '())
> +    ,@(if (zsh-field-not-empty? config 'zlogin)
> +          `(("zlogin" ,(zsh-file-by-field config 'zlogin))) '())
> +    ,@(if (zsh-field-not-empty? config 'zlogout)
> +          `(("zlogout" ,(zsh-file-by-field config 'zlogout))) '())))
> +
> +(define (zsh-home-files config)
> +  (define zshenv-auxiliary-file
> +    (mixed-text-file
> +     "zshenv-auxiliary"
> +     "export ZDOTDIR=${XDG_CONFIG_HOME:-$HOME/.config}/zsh\n"
> +     "[[ -f $ZDOTDIR/.zshenv ]] && source $ZDOTDIR/.zshenv\n"))
> +
> +  (if (home-zsh-configuration-xdg-flavor? config)
> +      `(("zshenv" ,zshenv-auxiliary-file))
> +      (zsh-get-configuration-files config)))
> +
> +(define (zsh-xdg-configuration-files config)
> +  (if (home-zsh-configuration-xdg-flavor? config)
> +      (map
> +       (lambda (lst)
> +         (cons (string-append "zsh/." (car lst))
> +               (cdr lst)))
> +       (zsh-get-configuration-files config))
> +      '()))
>  
>  (define (add-zsh-packages config)
>    (list (home-zsh-configuration-package config)))
> @@ -291,7 +298,10 @@ (define home-zsh-service-type
>                  (extensions
>                   (list (service-extension
>                          home-files-service-type
> -                        add-zsh-configuration)
> +                        zsh-home-files)
> +                       (service-extension
> +                        home-xdg-configuration-files-service-type
> +                        zsh-xdg-configuration-files)
>                         (service-extension
>                          home-profile-service-type
>                          add-zsh-packages)))
> -- 
> 2.34.0
>
> From ef4c3bbcc0c8c1a251f4ad6c494f8ed30adf45f2 Mon Sep 17 00:00:00 2001
> From: Andrew Tropin <andrew <at> trop.in>
> Date: Fri, 11 Feb 2022 15:34:46 +0300
> Subject: [PATCH 4/5] home: Migrate fountutils and xdg modules to
>  xdg-configuration-files.
>
> * gnu/home/services/fontutils.scm (home-fontconfig-service-type): Migrate to
> xdg-configuration-files.
> * gnu/home/services/xdg.scm (home-xdg-user-directories-service-type,
> home-xdg-mime-applications-service-type): Migrate to xdg-configuration-files.
> ---
>  gnu/home/services/fontutils.scm |  4 ++--
>  gnu/home/services/xdg.scm       | 31 +++++++++++++++++--------------
>  2 files changed, 19 insertions(+), 16 deletions(-)
>
> diff --git a/gnu/home/services/fontutils.scm b/gnu/home/services/fontutils.scm
> index 772904367d..6062eaed6a 100644
> --- a/gnu/home/services/fontutils.scm
> +++ b/gnu/home/services/fontutils.scm
> @@ -34,7 +34,7 @@ (define-module (gnu home services fontutils)
>  ;;; Code:
>  
>  (define (add-fontconfig-config-file he-symlink-path)
> -  `(("config/fontconfig/fonts.conf"
> +  `(("fontconfig/fonts.conf"
>       ,(mixed-text-file
>         "fonts.conf"
>         "<?xml version='1.0'?>
> @@ -51,7 +51,7 @@ (define home-fontconfig-service-type
>    (service-type (name 'home-fontconfig)
>                  (extensions
>                   (list (service-extension
> -                        home-files-service-type
> +                        home-xdg-configuration-files-service-type
>                          add-fontconfig-config-file)
>                         (service-extension
>                          home-run-on-change-service-type
> diff --git a/gnu/home/services/xdg.scm b/gnu/home/services/xdg.scm
> index d230dd7665..9c43aa93b9 100644
> --- a/gnu/home/services/xdg.scm
> +++ b/gnu/home/services/xdg.scm
> @@ -190,11 +190,11 @@ (define-configuration home-xdg-user-directories-configuration
>     "Default directory for videos."))
>  
>  (define (home-xdg-user-directories-files-service config)
> -  `(("config/user-dirs.conf"
> +  `(("user-dirs.conf"
>       ,(mixed-text-file
>         "user-dirs.conf"
>         "enabled=False\n"))
> -    ("config/user-dirs.dirs"
> +    ("user-dirs.dirs"
>       ,(mixed-text-file
>         "user-dirs.dirs"
>        (serialize-configuration
> @@ -218,7 +218,7 @@ (define home-xdg-user-directories-service-type
>    (service-type (name 'home-xdg-user-directories)
>                  (extensions
>                   (list (service-extension
> -                        home-files-service-type
> +                        home-xdg-configuration-files-service-type
>                          home-xdg-user-directories-files-service)
>                         (service-extension
>                          home-activation-service-type
> @@ -417,7 +417,7 @@ (define-configuration home-xdg-mime-applications-configuration
>     "A list of XDG desktop entries to create.  See
>  @code{xdg-desktop-entry}."))
>  
> -(define (home-xdg-mime-applications-files-service config)
> +(define (home-xdg-mime-applications-files config)
>    (define (add-xdg-desktop-entry-file entry)
>      (let ((file (first entry))
>            (config (second entry)))
> @@ -425,16 +425,16 @@ (define (add-xdg-desktop-entry-file entry)
>            (apply mixed-text-file
>                   (format #f "xdg-desktop-~a-entry" file)
>                   config))))
> +  (map (compose add-xdg-desktop-entry-file serialize-xdg-desktop-entry)
> +       (home-xdg-mime-applications-configuration-desktop-entries config)))
>  
> -  (append
> -   `(("config/mimeapps.list"
> -      ,(mixed-text-file
> -        "xdg-mime-appplications"
> -        (serialize-configuration
> -         config
> -         home-xdg-mime-applications-configuration-fields))))
> -   (map (compose add-xdg-desktop-entry-file serialize-xdg-desktop-entry)
> -        (home-xdg-mime-applications-configuration-desktop-entries config))))
> +(define (home-xdg-mime-applications-xdg-files config)
> +  `(("mimeapps.list"
> +     ,(mixed-text-file
> +       "xdg-mime-appplications"
> +       (serialize-configuration
> +        config
> +        home-xdg-mime-applications-configuration-fields)))))
>  
>  (define (home-xdg-mime-applications-extension old-config extension-configs)
>    (define (extract-fields config)
> @@ -469,7 +469,10 @@ (define home-xdg-mime-applications-service-type
>                  (extensions
>                   (list (service-extension
>                          home-files-service-type
> -                        home-xdg-mime-applications-files-service)))
> +                        home-xdg-mime-applications-files)
> +                       (service-extension
> +                        home-xdg-configuration-files-service-type
> +                        home-xdg-mime-applications-xdg-files)))
>                  (compose identity)
>                  (extend home-xdg-mime-applications-extension)
>                  (default-value (home-xdg-mime-applications-configuration))
> -- 
> 2.34.0
>
> From 089683bbd301f6e085f00fbd53713f335abac40e Mon Sep 17 00:00:00 2001
> From: Andrew Tropin <andrew <at> trop.in>
> Date: Fri, 11 Feb 2022 16:14:23 +0300
> Subject: [PATCH 5/5] home: symlink-manager: Respect XDG_CONFIG_HOME during
>  activation.
>
> * gnu/home/services/symlink-manager.scm (update-symlinks-script): Respect
> XDG_CONFIG_HOME during activation.
> ---
>  gnu/home/services/symlink-manager.scm | 25 +++++++++++++++++++++----
>  1 file changed, 21 insertions(+), 4 deletions(-)
>
> diff --git a/gnu/home/services/symlink-manager.scm b/gnu/home/services/symlink-manager.scm
> index 747bb343d3..418bfbd98a 100644
> --- a/gnu/home/services/symlink-manager.scm
> +++ b/gnu/home/services/symlink-manager.scm
> @@ -85,8 +85,8 @@ (define ((file-tree-traverse preordering) node)
>  
>         (use-modules (guix build utils))
>  
> -       (let* ((config-home    (or (getenv "XDG_CONFIG_HOME")
> -                                  (string-append (getenv "HOME") "/.config")))
> +       (let* ((xdg-config-home (or (getenv "XDG_CONFIG_HOME")
> +                                   (string-append (getenv "HOME") "/.config")))
>  
>                (he-path (string-append (getenv "HOME") "/.guix-home"))
>                (new-he-path (string-append he-path ".new"))
> @@ -117,13 +117,24 @@ (define ((file-tree-traverse preordering) node)
>                 (lambda (path)
>                   (readlink (string-append new-files-path "/" path))))
>  
> +              (preprocess-path
> +               (lambda (path)
> +                 "If file is in xdg-configuration-files-subdir use
> +subdirectory from XDG_CONFIG_HOME to generate a target path."
> +                 (if (string-prefix? #$xdg-configuration-files-subdir path)
> +                     (string-append
> +                      (substring xdg-config-home (1+ (string-length home-path)))
> +                      (substring
> +                       path (string-length #$xdg-configuration-files-subdir)))
> +                     (string-append "." path))))
> +
>                (get-target-path
>                 (lambda (path)
> -                 (string-append home-path "/." path)))
> +                 (string-append home-path "/" (preprocess-path path))))
>  
>                (get-backup-path
>                 (lambda (path)
> -                 (string-append backup-dir "/." path)))
> +                 (string-append backup-dir "/" (preprocess-path path))))
>  
>                (directory?
>                 (lambda (path)
> @@ -224,6 +235,12 @@ (define ((file-tree-traverse preordering) node)
>                         (display (G_ " done\n"))))
>                      to-create)))))
>  
> +         (format #t "home-path: ~a\nxdg-config-home: ~a\n"
> +                 home-path xdg-config-home)
> +
> +         (format #t "prepr: ~a\n"
> +                 (preprocess-path "config/sway/config"))
> +
>           (when old-tree
>             (cleanup-symlinks))
>  
> -- 
> 2.34.0

A gentle reminder/request for code-review.

-- 
Best regards,
Andrew Tropin
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#52808; Package guix. (Sat, 05 Mar 2022 22:45:02 GMT) Full text and rfc822 format available.

Message #38 received at 52808 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Andrew Tropin <andrew <at> trop.in>
Cc: 52808 <at> debbugs.gnu.org, Julien Lepiller <julien <at> lepiller.eu>,
 Nick Zalutskiy <nick <at> const.fun>
Subject: Re: bug#52808: Guix home should not assume that all targets are dot
 files
Date: Sat, 05 Mar 2022 23:44:27 +0100
Hi Andrew,

The patches reached my mailbox around the time I went on vacation and
then fell through the cracks.  Sorry about that!

Andrew Tropin <andrew <at> trop.in> skribis:

> After that patch series is merged we can give a time for users to
> migrate their self-made home services to xdg-configuration-files and
> after for example 2 weeks, remove special handling of dots for
> home-files.

Sounds like a plan!

> From 0cd37bbc724f9c793898c2655bdd1c335045c5f0 Mon Sep 17 00:00:00 2001
> From: Andrew Tropin <andrew <at> trop.in>
> Date: Fri, 11 Feb 2022 10:55:01 +0300
> Subject: [PATCH 1/5] home: Explicitly connect home-file and symlink-manager
>  services.
>
> * gnu/home/services.scm (home-files-directory): New variable.
> * gnu/home/symlink-manager.scm (update-symlinks-script): Use
> home-files-directory variable from (gnu home services).

[...]

> -                (description "Configuration files for programs that
> -will be put in @file{~/.guix-home/files}.")))
> +                (description (format #f "Files that will be put in
> +@file{~~/.guix-home/~a}, and further processed during activation."
> +                                     home-files-directory))))

This hunk would prevent i18n so I suggest dropping it (you can mention
‘home-files-directory’ in a margin comment for good measure).

Otherwise LGTM.

> From 23f7095d60b18b52de0d1aa314c4012cdf55a046 Mon Sep 17 00:00:00 2001
> From: Andrew Tropin <andrew <at> trop.in>
> Date: Fri, 11 Feb 2022 11:03:02 +0300
> Subject: [PATCH 2/5] home: Add home-xdg-configuration-files service.
>
> * gnu/home/services.scm (home-xdg-configuration-files): New variable.

[...]

> +(define xdg-configuration-files-subdir "config")
>
> +(define (xdg-configuration-files files)
> +  (map (lambda (lst)
> +         (cons (string-append xdg-configuration-files-subdir
> +                              "/" (car lst)) (cdr lst)))
> +         files))

I’d just call it “.config” (instead of “config”).  That way, there
wouldn’t be any special treatment.  WDYT?

Also: s/subdir/directory/, and please use ‘match’ instead of car/cdr
(info "(guix) Coding Style").

> +                (description (format #f "Files that will be put in
> +@file{~~/.guix-home/~a/~a}, and further processed during activation."
> +                                     home-files-directory
> +                                     xdg-configuration-files))))

Same as above: drop ‘format’ and write ~/.guix-home/files/.config.

> From 11f23a48d480a91d6bfba0ff55c1a9831585a4ee Mon Sep 17 00:00:00 2001
> From: Andrew Tropin <andrew <at> trop.in>
> Date: Fri, 11 Feb 2022 15:03:44 +0300
> Subject: [PATCH 3/5] home: shells: Migrate zsh to xdg-configuration-files.
>
> * gnu/home/services.scm (home-zsh-service-type): Additionally extend
> home-xdg-configuration-files-service-type.

[...]

> From ef4c3bbcc0c8c1a251f4ad6c494f8ed30adf45f2 Mon Sep 17 00:00:00 2001
> From: Andrew Tropin <andrew <at> trop.in>
> Date: Fri, 11 Feb 2022 15:34:46 +0300
> Subject: [PATCH 4/5] home: Migrate fountutils and xdg modules to
>  xdg-configuration-files.
>
> * gnu/home/services/fontutils.scm (home-fontconfig-service-type): Migrate to
> xdg-configuration-files.
> * gnu/home/services/xdg.scm (home-xdg-user-directories-service-type,
> home-xdg-mime-applications-service-type): Migrate to xdg-configuration-files.

Neat!

> From 089683bbd301f6e085f00fbd53713f335abac40e Mon Sep 17 00:00:00 2001
> From: Andrew Tropin <andrew <at> trop.in>
> Date: Fri, 11 Feb 2022 16:14:23 +0300
> Subject: [PATCH 5/5] home: symlink-manager: Respect XDG_CONFIG_HOME during
>  activation.
>
> * gnu/home/services/symlink-manager.scm (update-symlinks-script): Respect
> XDG_CONFIG_HOME during activation.

I propose to postpone this one after
<https://issues.guix.gnu.org/54180>, and I even offer to rebase it
myself if you want.  :-)

Could you send updated patches?

Thanks in advance, and apologies again for the delay!

Ludo’.




Information forwarded to bug-guix <at> gnu.org:
bug#52808; Package guix. (Wed, 09 Mar 2022 04:27:02 GMT) Full text and rfc822 format available.

Message #41 received at 52808 <at> debbugs.gnu.org (full text, mbox):

From: Andrew Tropin <andrew <at> trop.in>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 52808 <at> debbugs.gnu.org, Julien Lepiller <julien <at> lepiller.eu>,
 Nick Zalutskiy <nick <at> const.fun>
Subject: Re: bug#52808: Guix home should not assume that all targets are dot
 files
Date: Wed, 09 Mar 2022 07:26:07 +0300
[Message part 1 (text/plain, inline)]
On 2022-03-05 23:44, Ludovic Courtès wrote:

> Hi Andrew,
>
> The patches reached my mailbox around the time I went on vacation and
> then fell through the cracks.  Sorry about that!

No problem, I hope you had a good rest and got some fun!

>
> Andrew Tropin <andrew <at> trop.in> skribis:
>
>> After that patch series is merged we can give a time for users to
>> migrate their self-made home services to xdg-configuration-files and
>> after for example 2 weeks, remove special handling of dots for
>> home-files.
>
> Sounds like a plan!
>
>> From 0cd37bbc724f9c793898c2655bdd1c335045c5f0 Mon Sep 17 00:00:00 2001
>> From: Andrew Tropin <andrew <at> trop.in>
>> Date: Fri, 11 Feb 2022 10:55:01 +0300
>> Subject: [PATCH 1/5] home: Explicitly connect home-file and symlink-manager
>>  services.
>>
>> * gnu/home/services.scm (home-files-directory): New variable.
>> * gnu/home/symlink-manager.scm (update-symlinks-script): Use
>> home-files-directory variable from (gnu home services).
>
> [...]
>
>> -                (description "Configuration files for programs that
>> -will be put in @file{~/.guix-home/files}.")))
>> +                (description (format #f "Files that will be put in
>> +@file{~~/.guix-home/~a}, and further processed during activation."
>> +                                     home-files-directory))))
>
> This hunk would prevent i18n so I suggest dropping it (you can mention
> ‘home-files-directory’ in a margin comment for good measure).
>
> Otherwise LGTM.
>

Will fix it.

>> From 23f7095d60b18b52de0d1aa314c4012cdf55a046 Mon Sep 17 00:00:00 2001
>> From: Andrew Tropin <andrew <at> trop.in>
>> Date: Fri, 11 Feb 2022 11:03:02 +0300
>> Subject: [PATCH 2/5] home: Add home-xdg-configuration-files service.
>>
>> * gnu/home/services.scm (home-xdg-configuration-files): New variable.
>
> [...]
>
>> +(define xdg-configuration-files-subdir "config")
>>
>> +(define (xdg-configuration-files files)
>> +  (map (lambda (lst)
>> +         (cons (string-append xdg-configuration-files-subdir
>> +                              "/" (car lst)) (cdr lst)))
>> +         files))
>
> I’d just call it “.config” (instead of “config”).  That way, there
> wouldn’t be any special treatment.  WDYT?

This is a patch series, which introduces preliminary changes and keeps
backward compatibility, so people, who have their personal home services
will be able to gradually migrate them to home-xdg-configuration-files.
In the next patch series special treatment of the dots will be removed
and this directory will become ".config".

>
> Also: s/subdir/directory/, and please use ‘match’ instead of car/cdr
> (info "(guix) Coding Style").
>

Sure.

>> +                (description (format #f "Files that will be put in
>> +@file{~~/.guix-home/~a/~a}, and further processed during activation."
>> +                                     home-files-directory
>> +                                     xdg-configuration-files))))
>
> Same as above: drop ‘format’ and write ~/.guix-home/files/.config.
>
>> From 11f23a48d480a91d6bfba0ff55c1a9831585a4ee Mon Sep 17 00:00:00 2001
>> From: Andrew Tropin <andrew <at> trop.in>
>> Date: Fri, 11 Feb 2022 15:03:44 +0300
>> Subject: [PATCH 3/5] home: shells: Migrate zsh to xdg-configuration-files.
>>
>> * gnu/home/services.scm (home-zsh-service-type): Additionally extend
>> home-xdg-configuration-files-service-type.
>
> [...]
>
>> From ef4c3bbcc0c8c1a251f4ad6c494f8ed30adf45f2 Mon Sep 17 00:00:00 2001
>> From: Andrew Tropin <andrew <at> trop.in>
>> Date: Fri, 11 Feb 2022 15:34:46 +0300
>> Subject: [PATCH 4/5] home: Migrate fountutils and xdg modules to
>>  xdg-configuration-files.
>>
>> * gnu/home/services/fontutils.scm (home-fontconfig-service-type): Migrate to
>> xdg-configuration-files.
>> * gnu/home/services/xdg.scm (home-xdg-user-directories-service-type,
>> home-xdg-mime-applications-service-type): Migrate to xdg-configuration-files.
>
> Neat!
>
>> From 089683bbd301f6e085f00fbd53713f335abac40e Mon Sep 17 00:00:00 2001
>> From: Andrew Tropin <andrew <at> trop.in>
>> Date: Fri, 11 Feb 2022 16:14:23 +0300
>> Subject: [PATCH 5/5] home: symlink-manager: Respect XDG_CONFIG_HOME during
>>  activation.
>>
>> * gnu/home/services/symlink-manager.scm (update-symlinks-script): Respect
>> XDG_CONFIG_HOME during activation.
>
> I propose to postpone this one after
> <https://issues.guix.gnu.org/54180>, and I even offer to rebase it
> myself if you want.  :-)
>
> Could you send updated patches?

Sure, I even replied to bug#54180 ticket :)  Waiting for the merge, after
that will update patches to address your comments and will rebase them
on top of bug#54180.  Also, I need to update the manual as well.

>
> Thanks in advance, and apologies again for the delay!
>
> Ludo’.

-- 
Best regards,
Andrew Tropin
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#52808; Package guix. (Thu, 10 Mar 2022 10:57:02 GMT) Full text and rfc822 format available.

Message #44 received at 52808 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Andrew Tropin <andrew <at> trop.in>
Cc: 52808 <at> debbugs.gnu.org, Julien Lepiller <julien <at> lepiller.eu>,
 Nick Zalutskiy <nick <at> const.fun>
Subject: Re: bug#52808: Guix home should not assume that all targets are dot
 files
Date: Thu, 10 Mar 2022 11:56:01 +0100
Hi Andrew,

Andrew Tropin <andrew <at> trop.in> skribis:

> On 2022-03-05 23:44, Ludovic Courtès wrote:

[...]

>> I propose to postpone this one after
>> <https://issues.guix.gnu.org/54180>, and I even offer to rebase it
>> myself if you want.  :-)
>>
>> Could you send updated patches?
>
> Sure, I even replied to bug#54180 ticket :)  Waiting for the merge, after
> that will update patches to address your comments and will rebase them
> on top of bug#54180.  Also, I need to update the manual as well.

Oh sorry, I had misunderstood your comment in
<https://issues.guix.gnu.org/54180#18>.

I’ve now pushed it so you can happily rebase.  :-)

Thanks,
Ludo’.




Information forwarded to bug-guix <at> gnu.org:
bug#52808; Package guix. (Fri, 11 Mar 2022 07:42:02 GMT) Full text and rfc822 format available.

Message #47 received at 52808 <at> debbugs.gnu.org (full text, mbox):

From: Andrew Tropin <andrew <at> trop.in>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 52808 <at> debbugs.gnu.org, Julien Lepiller <julien <at> lepiller.eu>,
 Nick Zalutskiy <nick <at> const.fun>
Subject: Re: bug#52808: Guix home should not assume that all targets are dot
 files
Date: Fri, 11 Mar 2022 10:41:26 +0300
[Message part 1 (text/plain, inline)]
On 2022-03-05 23:44, Ludovic Courtès wrote:

> Hi Andrew,
>
> The patches reached my mailbox around the time I went on vacation and
> then fell through the cracks.  Sorry about that!
>
> Andrew Tropin <andrew <at> trop.in> skribis:
>
>> After that patch series is merged we can give a time for users to
>> migrate their self-made home services to xdg-configuration-files and
>> after for example 2 weeks, remove special handling of dots for
>> home-files.
>
> Sounds like a plan!
>
>> From 0cd37bbc724f9c793898c2655bdd1c335045c5f0 Mon Sep 17 00:00:00 2001
>> From: Andrew Tropin <andrew <at> trop.in>
>> Date: Fri, 11 Feb 2022 10:55:01 +0300
>> Subject: [PATCH 1/5] home: Explicitly connect home-file and symlink-manager
>>  services.
>>
>> * gnu/home/services.scm (home-files-directory): New variable.
>> * gnu/home/symlink-manager.scm (update-symlinks-script): Use
>> home-files-directory variable from (gnu home services).
>
> [...]
>
>> -                (description "Configuration files for programs that
>> -will be put in @file{~/.guix-home/files}.")))
>> +                (description (format #f "Files that will be put in
>> +@file{~~/.guix-home/~a}, and further processed during activation."
>> +                                     home-files-directory))))
>
> This hunk would prevent i18n so I suggest dropping it (you can mention
> ‘home-files-directory’ in a margin comment for good measure).
>
> Otherwise LGTM.
>

Done.

>
>> From 23f7095d60b18b52de0d1aa314c4012cdf55a046 Mon Sep 17 00:00:00 2001
>> From: Andrew Tropin <andrew <at> trop.in>
>> Date: Fri, 11 Feb 2022 11:03:02 +0300
>> Subject: [PATCH 2/5] home: Add home-xdg-configuration-files service.
>>
>> * gnu/home/services.scm (home-xdg-configuration-files): New variable.
>
> [...]
>
>> +(define xdg-configuration-files-subdir "config")
>>
>> +(define (xdg-configuration-files files)
>> +  (map (lambda (lst)
>> +         (cons (string-append xdg-configuration-files-subdir
>> +                              "/" (car lst)) (cdr lst)))
>> +         files))
>
> I’d just call it “.config” (instead of “config”).  That way, there
> wouldn’t be any special treatment.  WDYT?

Will be done in next patch series.

>
> Also: s/subdir/directory/, and please use ‘match’ instead of car/cdr
> (info "(guix) Coding Style").

Done, done.

>
>
>> +                (description (format #f "Files that will be put in
>> +@file{~~/.guix-home/~a/~a}, and further processed during activation."
>> +                                     home-files-directory
>> +                                     xdg-configuration-files))))
>
> Same as above: drop ‘format’ and write ~/.guix-home/files/.config.
>

Done.

>
>> From 11f23a48d480a91d6bfba0ff55c1a9831585a4ee Mon Sep 17 00:00:00 2001
>> From: Andrew Tropin <andrew <at> trop.in>
>> Date: Fri, 11 Feb 2022 15:03:44 +0300
>> Subject: [PATCH 3/5] home: shells: Migrate zsh to xdg-configuration-files.
>>
>> * gnu/home/services.scm (home-zsh-service-type): Additionally extend
>> home-xdg-configuration-files-service-type.
>
> [...]
>
>> From ef4c3bbcc0c8c1a251f4ad6c494f8ed30adf45f2 Mon Sep 17 00:00:00 2001
>> From: Andrew Tropin <andrew <at> trop.in>
>> Date: Fri, 11 Feb 2022 15:34:46 +0300
>> Subject: [PATCH 4/5] home: Migrate fountutils and xdg modules to
>>  xdg-configuration-files.
>>
>> * gnu/home/services/fontutils.scm (home-fontconfig-service-type): Migrate to
>> xdg-configuration-files.
>> * gnu/home/services/xdg.scm (home-xdg-user-directories-service-type,
>> home-xdg-mime-applications-service-type): Migrate to xdg-configuration-files.
>
> Neat!
>
>> From 089683bbd301f6e085f00fbd53713f335abac40e Mon Sep 17 00:00:00 2001
>> From: Andrew Tropin <andrew <at> trop.in>
>> Date: Fri, 11 Feb 2022 16:14:23 +0300
>> Subject: [PATCH 5/5] home: symlink-manager: Respect XDG_CONFIG_HOME during
>>  activation.
>>
>> * gnu/home/services/symlink-manager.scm (update-symlinks-script): Respect
>> XDG_CONFIG_HOME during activation.
>
> I propose to postpone this one after
> <https://issues.guix.gnu.org/54180>, and I even offer to rebase it
> myself if you want.  :-)
>
> Could you send updated patches?
>
> Thanks in advance, and apologies again for the delay!
>
> Ludo’.

Added two minor patches for symlink-manager.

[0001-home-symlink-manager-Use-existing-home-directory-sym.patch (text/x-patch, inline)]
From 3a6dc64d3366aa37507c83c598cbddb0f0815b6d Mon Sep 17 00:00:00 2001
From: Andrew Tropin <andrew <at> trop.in>
Date: Fri, 11 Mar 2022 08:43:04 +0300
Subject: [PATCH 1/2] home: symlink-manager: Use existing home-directory
 symbol.

* gnu/home/services/symlink-manager.scm (update-symlinks-script): Use
existing home-directory symbol instead of additional getenv call.
---
 gnu/home/services/symlink-manager.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnu/home/services/symlink-manager.scm b/gnu/home/services/symlink-manager.scm
index 767b1bdc01..bce5c85b56 100644
--- a/gnu/home/services/symlink-manager.scm
+++ b/gnu/home/services/symlink-manager.scm
@@ -185,7 +185,7 @@ (define (source-file file)
 
          #$%initialize-gettext
 
-         (let* ((home     (string-append (getenv "HOME") "/.guix-home"))
+         (let* ((home     (string-append home-directory "/.guix-home"))
                 (pivot    (string-append home ".new"))
                 (new-home (getenv "GUIX_NEW_HOME"))
                 (old-home (getenv "GUIX_OLD_HOME")))
-- 
2.34.0

[0002-home-symlink-manager-Add-missing-done-word-in-messag.patch (text/x-patch, inline)]
From aaef728aaf621884cce49539d47abb09a9f1e32d Mon Sep 17 00:00:00 2001
From: Andrew Tropin <andrew <at> trop.in>
Date: Fri, 11 Mar 2022 09:21:41 +0300
Subject: [PATCH 2/2] home: symlink-manager: Add missing 'done' word in
 message.

* gnu/home/services/symlink-manager.scm (update-symlinks-script): Add missing
'done' word in message, keep code width below 80 column.
---
 gnu/home/services/symlink-manager.scm | 24 +++++++++++++-----------
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/gnu/home/services/symlink-manager.scm b/gnu/home/services/symlink-manager.scm
index bce5c85b56..eb13d60496 100644
--- a/gnu/home/services/symlink-manager.scm
+++ b/gnu/home/services/symlink-manager.scm
@@ -107,9 +107,10 @@ (define (strip file)
                         (format #t (G_ "Removing ~a...") file)
                         (delete-file file)
                         (display (G_ " done\n")))
-                      (format #t
-                              (G_ "Skipping ~a (not a symlink to store)... done\n")
-                              file)))))
+                      (format
+                       #t
+                       (G_ "Skipping ~a (not a symlink to store)... done\n")
+                       file)))))
 
             (const #t)                            ;down
             (lambda (directory stat _)            ;up
@@ -121,14 +122,15 @@ (define (strip file)
                       (format #t (G_ "Removed ~a.\n") directory))
                     (lambda args
                       (let ((errno (system-error-errno args)))
-                        (cond ((= ENOTEMPTY errno)
-                               (format
-                                #t
-                                (G_ "Skipping ~a (not an empty directory)...\n")
-                                directory))
-                              ((= ENOTDIR errno) #t)
-                              (else
-                               (apply throw args)))))))))
+                        (cond
+                         ((= ENOTEMPTY errno)
+                          (format
+                           #t
+                           (G_ "Skipping ~a (not an empty directory)... done\n")
+                           directory))
+                         ((= ENOTDIR errno) #t)
+                         (else
+                          (apply throw args)))))))))
             (const #t)                            ;skip
             (const #t)                            ;error
             #t                                    ;init
-- 
2.34.0

[Message part 4 (text/plain, inline)]
Thank you for cleaning up symlink-manager, now it's much nicer, simplier
and I believe easier to maintain.

Rebased previous patch series and addressed all the comments.

[v2-0001-home-Explicitly-connect-home-file-and-symlink-man.patch (text/x-patch, inline)]
From 1509c974029d161009b35bfd76132a86425bdecc Mon Sep 17 00:00:00 2001
From: Andrew Tropin <andrew <at> trop.in>
Date: Fri, 11 Feb 2022 10:55:01 +0300
Subject: [PATCH v2 1/5] home: Explicitly connect home-file and symlink-manager
 services.

* gnu/home/services.scm (home-files-directory): New variable.
* gnu/home/symlink-manager.scm (update-symlinks-script): Use
home-files-directory variable from (gnu home services).
---
 gnu/home/services.scm                 | 22 +++++++++++++---------
 gnu/home/services/symlink-manager.scm | 15 +++++++--------
 2 files changed, 20 insertions(+), 17 deletions(-)

diff --git a/gnu/home/services.scm b/gnu/home/services.scm
index 1cd19ce7f9..32b10e99aa 100644
--- a/gnu/home/services.scm
+++ b/gnu/home/services.scm
@@ -43,6 +43,8 @@ (define-module (gnu home services)
             home-run-on-change-service-type
             home-provenance-service-type
 
+            home-files-directory
+
             fold-home-service-types
             home-provenance
 
@@ -74,12 +76,11 @@ (define-module (gnu home services)
 ;;; file (details described in the manual).
 ;;;
 ;;; home-files-service-type is similar to etc-service-type, but doesn't extend
-;;; home-activation, because deploy mechanism for config files is pluggable and
-;;; can be different for different home environments: The default one is called
-;;; symlink-manager (will be introudced in a separate patch series), which creates
-;;; links for various dotfiles (like $XDG_CONFIG_HOME/$APP/...) to store, but is
-;;; possible to implement alternative approaches like read-only home from Julien's
-;;; guix-home-manager.
+;;; home-activation, because deploy mechanism for config files is pluggable
+;;; and can be different for different home environments: The default one is
+;;; called symlink-manager, which creates links for various dotfiles and xdg
+;;; configuration files to store, but is possible to implement alternative
+;;; approaches like read-only home from Julien's guix-home-manager.
 ;;;
 ;;; home-run-on-first-login-service-type provides an @file{on-first-login} guile
 ;;; script, which runs provided gexps once, when user makes first login.  It can
@@ -262,11 +263,14 @@ (define (assert-no-duplicates files)
 
   (file-union "files" files))
 
+;; Used by symlink-manager
+(define home-files-directory "files")
+
 (define (files-entry files)
   "Return an entry for the @file{~/.guix-home/files}
 directory containing FILES."
   (with-monad %store-monad
-    (return `(("files" ,(files->files-directory files))))))
+    (return `((,home-files-directory ,(files->files-directory files))))))
 
 (define home-files-service-type
   (service-type (name 'home-files)
@@ -276,8 +280,8 @@ (define home-files-service-type
                 (compose concatenate)
                 (extend append)
                 (default-value '())
-                (description "Configuration files for programs that
-will be put in @file{~/.guix-home/files}.")))
+                (description "Files that will be put in
+@file{~~/.guix-home/files}, and further processed during activation.")))
 
 (define %initialize-gettext
   #~(begin
diff --git a/gnu/home/services/symlink-manager.scm b/gnu/home/services/symlink-manager.scm
index eb13d60496..16031ea5d3 100644
--- a/gnu/home/services/symlink-manager.scm
+++ b/gnu/home/services/symlink-manager.scm
@@ -26,12 +26,11 @@ (define-module (gnu home services symlink-manager)
 
 ;;; Comment:
 ;;;
-;;; symlink-manager cares about configuration files: it backs up files
-;;; created by user, removes symlinks and directories created by a
-;;; previous generation, and creates new directories and symlinks to
-;;; configuration files according to the content of files/ directory
-;;; (created by home-files-service) of the current home environment
-;;; generation.
+;;; symlink-manager cares about xdg configurations and other files: it backs
+;;; up files created by user, removes symlinks and directories created by a
+;;; previous generation, and creates new directories and symlinks to files
+;;; according to the content of directories (created by home-files-service) of
+;;; the current home environment generation.
 ;;;
 ;;; Code:
 
@@ -84,7 +83,7 @@ (define (cleanup-symlinks home-generation)
            ;; store item containing a home generation.
            (define config-file-directory
              ;; Note: Trailing slash is needed because "files" is a symlink.
-             (string-append home-generation "/files/"))
+             (string-append home-generation "/" #$home-files-directory "/"))
 
            (define (strip file)
              (string-drop file
@@ -143,7 +142,7 @@ (define (create-symlinks home-generation)
            ;; Create in $HOME symlinks for the files in HOME-GENERATION.
            (define config-file-directory
              ;; Note: Trailing slash is needed because "files" is a symlink.
-             (string-append home-generation "/files/"))
+             (string-append home-generation "/" #$home-files-directory "/"))
 
            (define (strip file)
              (string-drop file
-- 
2.34.0

[v2-0002-home-Add-home-xdg-configuration-files-service.patch (text/x-patch, inline)]
From e98e5ee520fada9c6d100f40fcafa6358b626365 Mon Sep 17 00:00:00 2001
From: Andrew Tropin <andrew <at> trop.in>
Date: Fri, 11 Feb 2022 11:03:02 +0300
Subject: [PATCH v2 2/5] home: Add home-xdg-configuration-files service.

* gnu/home/services.scm (home-xdg-configuration-files): New variable.
---
 gnu/home/services.scm | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/gnu/home/services.scm b/gnu/home/services.scm
index 32b10e99aa..2f441eb968 100644
--- a/gnu/home/services.scm
+++ b/gnu/home/services.scm
@@ -38,12 +38,14 @@ (define-module (gnu home services)
             home-profile-service-type
             home-environment-variables-service-type
             home-files-service-type
+            home-xdg-configuration-files-service-type
             home-run-on-first-login-service-type
             home-activation-service-type
             home-run-on-change-service-type
             home-provenance-service-type
 
             home-files-directory
+            xdg-configuration-files-directory
 
             fold-home-service-types
             home-provenance
@@ -283,6 +285,27 @@ (define home-files-service-type
                 (description "Files that will be put in
 @file{~~/.guix-home/files}, and further processed during activation.")))
 
+(define xdg-configuration-files-directory "config")
+
+(define (xdg-configuration-files files)
+  "Add config/ prefix to each file-path in FILES."
+  (map (match-lambda
+         ((file-path . rest)
+          (cons (string-append xdg-configuration-files-directory "/" file-path)
+                rest)))
+         files))
+
+(define home-xdg-configuration-files-service-type
+  (service-type (name 'home-files)
+                (extensions
+                 (list (service-extension home-files-service-type
+                                          xdg-configuration-files)))
+                (compose concatenate)
+                (extend append)
+                (default-value '())
+                (description "Files that will be put in
+@file{~~/.guix-home/files/config}, and further processed during activation.")))
+
 (define %initialize-gettext
   #~(begin
       (bindtextdomain %gettext-domain
-- 
2.34.0

[v2-0003-home-shells-Migrate-zsh-to-xdg-configuration-file.patch (text/x-patch, inline)]
From 2dcb5da4991607b01b479c12617c00bf0785d247 Mon Sep 17 00:00:00 2001
From: Andrew Tropin <andrew <at> trop.in>
Date: Fri, 11 Feb 2022 15:03:44 +0300
Subject: [PATCH v2 3/5] home: shells: Migrate zsh to xdg-configuration-files.

* gnu/home/services.scm (home-zsh-service-type): Additionally extend
home-xdg-configuration-files-service-type.
---
 gnu/home/services/shells.scm | 122 +++++++++++++++++++----------------
 1 file changed, 66 insertions(+), 56 deletions(-)

diff --git a/gnu/home/services/shells.scm b/gnu/home/services/shells.scm
index ca7f4ac0ad..4b3618a868 100644
--- a/gnu/home/services/shells.scm
+++ b/gnu/home/services/shells.scm
@@ -171,56 +171,27 @@ (define-configuration home-zsh-configuration
 won't be read in some cases (if the shell terminates by exec'ing
 another process for example)."))
 
-(define (add-zsh-configuration config)
-  (let* ((xdg-flavor? (home-zsh-configuration-xdg-flavor? config)))
-
-    (define prefix-file
-      (cut string-append
-        (if xdg-flavor?
-            "config/zsh/."
-            "") <>))
-
-    (define (filter-fields field)
-      (filter-configuration-fields home-zsh-configuration-fields
-                                   (list field)))
-
-    (define (serialize-field field)
-      (serialize-configuration
-       config
-       (filter-fields field)))
-
-    (define (file-if-not-empty field)
-      (let ((file-name (symbol->string field))
-            (field-obj (car (filter-fields field))))
-        (if (not (null? ((configuration-field-getter field-obj) config)))
-            `(,(prefix-file file-name)
-              ,(mixed-text-file
-                file-name
-                (serialize-field field)))
-            '())))
-
-    (filter
-     (compose not null?)
-     `(,(if xdg-flavor?
-            `("zshenv"
-              ,(mixed-text-file
-                "auxiliary-zshenv"
-                (if xdg-flavor?
-                    "source ${XDG_CONFIG_HOME:-$HOME/.config}/zsh/.zshenv\n"
-                    "")))
-            '())
-       (,(prefix-file "zshenv")
-        ,(mixed-text-file
-          "zshenv"
-          (if xdg-flavor?
-              "export ZDOTDIR=${XDG_CONFIG_HOME:-$HOME/.config}/zsh\n"
-              "")
-          (serialize-field 'zshenv)
-          (serialize-field 'environment-variables)))
-       (,(prefix-file "zprofile")
-        ,(mixed-text-file
-          "zprofile"
-          "\
+(define (zsh-filter-fields field)
+  (filter-configuration-fields home-zsh-configuration-fields (list field)))
+
+(define (zsh-serialize-field config field)
+  (serialize-configuration config (zsh-filter-fields field)))
+
+(define* (zsh-field-not-empty? config field)
+  (let ((file-name (symbol->string field))
+        (field-obj (car (zsh-filter-fields field))))
+    (not (null? ((configuration-field-getter field-obj) config)))))
+
+(define (zsh-file-zshenv config)
+  (mixed-text-file
+   "zshenv"
+   (zsh-serialize-field config 'zshenv)
+   (zsh-serialize-field config 'environment-variables)))
+
+(define (zsh-file-zprofile config)
+  (mixed-text-file
+   "zprofile"
+   "\
 # Setups system and user profiles and related variables
 source /etc/profile
 # Setups home environment profile
@@ -229,11 +200,47 @@ (define (file-if-not-empty field)
 # It's only necessary if zsh is a login shell, otherwise profiles will
 # be already sourced by bash
 "
-          (serialize-field 'zprofile)))
-
-       ,@(list (file-if-not-empty 'zshrc)
-               (file-if-not-empty 'zlogin)
-               (file-if-not-empty 'zlogout))))))
+   (zsh-serialize-field config 'zprofile)))
+
+(define (zsh-file-by-field config field)
+  (match field
+    ('zshenv (zsh-file-zshenv config))
+    ('zprofile (zsh-file-zprofile config))
+    (e (mixed-text-file
+        (symbol->string field)
+        (zsh-serialize-field config field)))))
+
+(define (zsh-get-configuration-files config)
+  `(("zprofile" ,(zsh-file-by-field config 'zprofile)) ;; Always non-empty
+    ,@(if (and (zsh-field-not-empty? config 'zshenv)
+               (zsh-field-not-empty? config 'environment-variables))
+          `(("zshenv" ,(zsh-file-by-field config 'zshenv))) '())
+    ,@(if (zsh-field-not-empty? config 'zshrc)
+          `(("zshrc" ,(zsh-file-by-field config 'zshrc))) '())
+    ,@(if (zsh-field-not-empty? config 'zlogin)
+          `(("zlogin" ,(zsh-file-by-field config 'zlogin))) '())
+    ,@(if (zsh-field-not-empty? config 'zlogout)
+          `(("zlogout" ,(zsh-file-by-field config 'zlogout))) '())))
+
+(define (zsh-home-files config)
+  (define zshenv-auxiliary-file
+    (mixed-text-file
+     "zshenv-auxiliary"
+     "export ZDOTDIR=${XDG_CONFIG_HOME:-$HOME/.config}/zsh\n"
+     "[[ -f $ZDOTDIR/.zshenv ]] && source $ZDOTDIR/.zshenv\n"))
+
+  (if (home-zsh-configuration-xdg-flavor? config)
+      `(("zshenv" ,zshenv-auxiliary-file))
+      (zsh-get-configuration-files config)))
+
+(define (zsh-xdg-configuration-files config)
+  (if (home-zsh-configuration-xdg-flavor? config)
+      (map
+       (lambda (lst)
+         (cons (string-append "zsh/." (car lst))
+               (cdr lst)))
+       (zsh-get-configuration-files config))
+      '()))
 
 (define (add-zsh-packages config)
   (list (home-zsh-configuration-package config)))
@@ -291,7 +298,10 @@ (define home-zsh-service-type
                 (extensions
                  (list (service-extension
                         home-files-service-type
-                        add-zsh-configuration)
+                        zsh-home-files)
+                       (service-extension
+                        home-xdg-configuration-files-service-type
+                        zsh-xdg-configuration-files)
                        (service-extension
                         home-profile-service-type
                         add-zsh-packages)))
-- 
2.34.0

[v2-0004-home-Migrate-fountutils-and-xdg-modules-to-xdg-co.patch (text/x-patch, inline)]
From 99ef9ce7d0796642a54497e3a080e94a78fbb03c Mon Sep 17 00:00:00 2001
From: Andrew Tropin <andrew <at> trop.in>
Date: Fri, 11 Feb 2022 15:34:46 +0300
Subject: [PATCH v2 4/5] home: Migrate fountutils and xdg modules to
 xdg-configuration-files.

* gnu/home/services/fontutils.scm (home-fontconfig-service-type): Migrate to
xdg-configuration-files.
* gnu/home/services/xdg.scm (home-xdg-user-directories-service-type,
home-xdg-mime-applications-service-type): Migrate to xdg-configuration-files.
---
 gnu/home/services/fontutils.scm |  4 ++--
 gnu/home/services/xdg.scm       | 31 +++++++++++++++++--------------
 2 files changed, 19 insertions(+), 16 deletions(-)

diff --git a/gnu/home/services/fontutils.scm b/gnu/home/services/fontutils.scm
index 772904367d..6062eaed6a 100644
--- a/gnu/home/services/fontutils.scm
+++ b/gnu/home/services/fontutils.scm
@@ -34,7 +34,7 @@ (define-module (gnu home services fontutils)
 ;;; Code:
 
 (define (add-fontconfig-config-file he-symlink-path)
-  `(("config/fontconfig/fonts.conf"
+  `(("fontconfig/fonts.conf"
      ,(mixed-text-file
        "fonts.conf"
        "<?xml version='1.0'?>
@@ -51,7 +51,7 @@ (define home-fontconfig-service-type
   (service-type (name 'home-fontconfig)
                 (extensions
                  (list (service-extension
-                        home-files-service-type
+                        home-xdg-configuration-files-service-type
                         add-fontconfig-config-file)
                        (service-extension
                         home-run-on-change-service-type
diff --git a/gnu/home/services/xdg.scm b/gnu/home/services/xdg.scm
index 2833198cdf..361a2a6148 100644
--- a/gnu/home/services/xdg.scm
+++ b/gnu/home/services/xdg.scm
@@ -190,11 +190,11 @@ (define-configuration home-xdg-user-directories-configuration
    "Default directory for videos."))
 
 (define (home-xdg-user-directories-files-service config)
-  `(("config/user-dirs.conf"
+  `(("user-dirs.conf"
      ,(mixed-text-file
        "user-dirs.conf"
        "enabled=False\n"))
-    ("config/user-dirs.dirs"
+    ("user-dirs.dirs"
      ,(mixed-text-file
        "user-dirs.dirs"
       (serialize-configuration
@@ -218,7 +218,7 @@ (define home-xdg-user-directories-service-type
   (service-type (name 'home-xdg-user-directories)
                 (extensions
                  (list (service-extension
-                        home-files-service-type
+                        home-xdg-configuration-files-service-type
                         home-xdg-user-directories-files-service)
                        (service-extension
                         home-activation-service-type
@@ -417,7 +417,7 @@ (define-configuration home-xdg-mime-applications-configuration
    "A list of XDG desktop entries to create.  See
 @code{xdg-desktop-entry}."))
 
-(define (home-xdg-mime-applications-files-service config)
+(define (home-xdg-mime-applications-files config)
   (define (add-xdg-desktop-entry-file entry)
     (let ((file (first entry))
           (config (second entry)))
@@ -425,16 +425,16 @@ (define (add-xdg-desktop-entry-file entry)
           (apply mixed-text-file
                  (format #f "xdg-desktop-~a-entry" file)
                  config))))
+  (map (compose add-xdg-desktop-entry-file serialize-xdg-desktop-entry)
+       (home-xdg-mime-applications-configuration-desktop-entries config)))
 
-  (append
-   `(("config/mimeapps.list"
-      ,(mixed-text-file
-        "xdg-mime-appplications"
-        (serialize-configuration
-         config
-         home-xdg-mime-applications-configuration-fields))))
-   (map (compose add-xdg-desktop-entry-file serialize-xdg-desktop-entry)
-        (home-xdg-mime-applications-configuration-desktop-entries config))))
+(define (home-xdg-mime-applications-xdg-files config)
+  `(("mimeapps.list"
+     ,(mixed-text-file
+       "xdg-mime-appplications"
+       (serialize-configuration
+        config
+        home-xdg-mime-applications-configuration-fields)))))
 
 (define (home-xdg-mime-applications-extension old-config extension-configs)
   (define (extract-fields config)
@@ -469,7 +469,10 @@ (define home-xdg-mime-applications-service-type
                 (extensions
                  (list (service-extension
                         home-files-service-type
-                        home-xdg-mime-applications-files-service)))
+                        home-xdg-mime-applications-files)
+                       (service-extension
+                        home-xdg-configuration-files-service-type
+                        home-xdg-mime-applications-xdg-files)))
                 (compose identity)
                 (extend home-xdg-mime-applications-extension)
                 (default-value (home-xdg-mime-applications-configuration))
-- 
2.34.0

[v2-0005-home-symlink-manager-Respect-XDG_CONFIG_HOME-duri.patch (text/x-patch, inline)]
From f34175838dac46093a26971798b08c0679691b34 Mon Sep 17 00:00:00 2001
From: Andrew Tropin <andrew <at> trop.in>
Date: Fri, 11 Mar 2022 10:12:30 +0300
Subject: [PATCH v2 5/5] home: symlink-manager: Respect XDG_CONFIG_HOME during
 activation.

* gnu/home/services/symlink-manager.scm (update-symlinks-script): Respect
XDG_CONFIG_HOME during activation.
---
 gnu/home/services/symlink-manager.scm | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/gnu/home/services/symlink-manager.scm b/gnu/home/services/symlink-manager.scm
index 16031ea5d3..3b851229f3 100644
--- a/gnu/home/services/symlink-manager.scm
+++ b/gnu/home/services/symlink-manager.scm
@@ -50,14 +50,29 @@ (define (update-symlinks-script)
          (define home-directory
            (getenv "HOME"))
 
+         (define xdg-config-home
+           (or (getenv "XDG_CONFIG_HOME")
+               (string-append (getenv "HOME") "/.config")))
+
          (define backup-directory
            (string-append home-directory "/" (number->string (current-time))
                           "-guix-home-legacy-configs-backup"))
 
+         (define (preprocess-file file)
+           "If file is in XDG-CONFIGURATION-FILES-DIRECTORY use
+subdirectory from XDG_CONFIG_HOME to generate a target path."
+           (if (string-prefix? #$xdg-configuration-files-directory file)
+               (string-append
+                (substring xdg-config-home
+                           (1+ (string-length home-directory)))
+                (substring file
+                           (string-length #$xdg-configuration-files-directory)))
+               (string-append "." file)))
+
          (define (target-file file)
            ;; Return the target of FILE, a config file name sans leading dot
            ;; such as "config/fontconfig/fonts.conf" or "bashrc".
-           (string-append home-directory "/." file))
+           (string-append home-directory "/" (preprocess-file file)))
 
          (define (symlink-to-store? file)
            (catch 'system-error
@@ -70,7 +85,7 @@ (define (symlink-to-store? file)
 
          (define (backup-file file)
            (define backup
-             (string-append backup-directory "/." file))
+             (string-append backup-directory "/" (preprocess-file file)))
 
            (mkdir-p backup-directory)
            (format #t (G_ "Backing up ~a...") (target-file file))
-- 
2.34.0

[Message part 10 (text/plain, inline)]
I plan to prepare documentation, second patch series and announcement
next week.

-- 
Best regards,
Andrew Tropin
[signature.asc (application/pgp-signature, inline)]

Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Sun, 20 Mar 2022 18:08:01 GMT) Full text and rfc822 format available.

Notification sent to "Nick Zalutskiy" <nick <at> const.fun>:
bug acknowledged by developer. (Sun, 20 Mar 2022 18:08:01 GMT) Full text and rfc822 format available.

Message #52 received at 52808-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Andrew Tropin <andrew <at> trop.in>
Cc: 52808-done <at> debbugs.gnu.org, Julien Lepiller <julien <at> lepiller.eu>,
 Nick Zalutskiy <nick <at> const.fun>
Subject: Re: bug#52808: Guix home should not assume that all targets are dot
 files
Date: Sun, 20 Mar 2022 19:07:26 +0100
Hi Andrew,

I finally got around to committing it as
6da2a5a5655668f42ec5b26f875ddbc498e132b6.  Thank you!

Ludo’.




Did not alter fixed versions and reopened. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 20 Mar 2022 20:59:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-guix <at> gnu.org:
bug#52808; Package guix. (Sun, 20 Mar 2022 21:01:01 GMT) Full text and rfc822 format available.

Message #57 received at 52808 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: "Nick Zalutskiy" <nick <at> const.fun>,  52808 <at> debbugs.gnu.org, Andrew Tropin
 <andrew <at> trop.in>
Subject: Re: bug#52808: Guix home should not assume that all targets are dot
 files
Date: Sun, 20 Mar 2022 22:00:20 +0100
I wrote:

> I finally got around to committing it as
> 6da2a5a5655668f42ec5b26f875ddbc498e132b6.  Thank you!

I hit “close” too quickly: we still need the patch that changes
‘home-files-service-type’ and/or symlink-manager.scm to not prepend a
dot, so reopening!  :-)

Ludo’.




Information forwarded to bug-guix <at> gnu.org:
bug#52808; Package guix. (Mon, 28 Mar 2022 09:18:02 GMT) Full text and rfc822 format available.

Message #60 received at 52808 <at> debbugs.gnu.org (full text, mbox):

From: Andrew Tropin <andrew <at> trop.in>
To: Ludovic Courtès <ludo <at> gnu.org>, Nick Zalutskiy
 <nick <at> const.fun>, 52808 <at> debbugs.gnu.org
Subject: Re: bug#52808: Guix home should not assume that all targets are dot
 files
Date: Mon, 28 Mar 2022 12:17:41 +0300
[Message part 1 (text/plain, inline)]
On 2022-03-20 22:00, Ludovic Courtès wrote:

> I wrote:
>
>> I finally got around to committing it as
>> 6da2a5a5655668f42ec5b26f875ddbc498e132b6.  Thank you!
>
> I hit “close” too quickly: we still need the patch that changes
> ‘home-files-service-type’ and/or symlink-manager.scm to not prepend a
> dot, so reopening!  :-)
>
> Ludo’.

Forgot to update fish home service in previous patch series, please
apply this patch as well:

[0001-home-shells-Migrate-fish-to-xdg-configuration-files.patch (text/x-patch, inline)]
From 7d9cf53ab574c8ab468bfdae2798de65af6c00b5 Mon Sep 17 00:00:00 2001
From: Andrew Tropin <andrew <at> trop.in>
Date: Mon, 28 Mar 2022 12:14:10 +0300
Subject: [PATCH] home: shells: Migrate fish to xdg-configuration-files.

* gnu/home/services.scm (home-fish-service-type): Migrate to
home-xdg-configuration-files-service-type.
---
 gnu/home/services/shells.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/home/services/shells.scm b/gnu/home/services/shells.scm
index 7b9769bcf3..fb728893e3 100644
--- a/gnu/home/services/shells.scm
+++ b/gnu/home/services/shells.scm
@@ -586,7 +586,7 @@ (define-configuration home-fish-configuration
    serialize-fish-abbreviations))
 
 (define (fish-files-service config)
-  `(("config/fish/config.fish"
+  `(("fish/config.fish"
      ,(mixed-text-file
        "fish-config.fish"
        #~(string-append "\
@@ -650,7 +650,7 @@ (define home-fish-service-type
   (service-type (name 'home-fish)
                 (extensions
                  (list (service-extension
-                        home-files-service-type
+                        home-xdg-configuration-files-service-type
                         fish-files-service)
                        (service-extension
                         home-profile-service-type
-- 
2.34.0

[Message part 3 (text/plain, inline)]
-- 
Best regards,
Andrew Tropin
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#52808; Package guix. (Tue, 29 Mar 2022 09:53:01 GMT) Full text and rfc822 format available.

Message #63 received at 52808 <at> debbugs.gnu.org (full text, mbox):

From: Andrew Tropin <andrew <at> trop.in>
To: Ludovic Courtès <ludo <at> gnu.org>, Nick Zalutskiy
 <nick <at> const.fun>, 52808 <at> debbugs.gnu.org
Subject: Re: bug#52808: Guix home should not assume that all targets are dot
 files
Date: Tue, 29 Mar 2022 12:51:59 +0300
[Message part 1 (text/plain, inline)]
On 2022-03-20 22:00, Ludovic Courtès wrote:

> I wrote:
>
>> I finally got around to committing it as
>> 6da2a5a5655668f42ec5b26f875ddbc498e132b6.  Thank you!
>
> I hit “close” too quickly: we still need the patch that changes
> ‘home-files-service-type’ and/or symlink-manager.scm to not prepend a
> dot, so reopening!  :-)
>
> Ludo’.

A few more minor fixes:

[0001-home-shells-Rename-zsh-related-functions.patch (text/x-patch, inline)]
From 629466d23308e135c4a46951e5ea568677c5ec00 Mon Sep 17 00:00:00 2001
From: Andrew Tropin <andrew <at> trop.in>
Date: Tue, 29 Mar 2022 11:15:56 +0300
Subject: [PATCH 1/2] home: shells: Rename zsh related functions.

* gnu/home/services/shells.scm (home-zsh-service-type): Make zsh related
private functions more consistently named.
---
 gnu/home/services/shells.scm | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/gnu/home/services/shells.scm b/gnu/home/services/shells.scm
index fb728893e3..086fe7d8c4 100644
--- a/gnu/home/services/shells.scm
+++ b/gnu/home/services/shells.scm
@@ -222,7 +222,7 @@ (define (zsh-get-configuration-files config)
     ,@(if (zsh-field-not-empty? config 'zlogout)
           `(("zlogout" ,(zsh-file-by-field config 'zlogout))) '())))
 
-(define (zsh-home-files config)
+(define (add-zsh-dot-configuration config)
   (define zshenv-auxiliary-file
     (mixed-text-file
      "zshenv-auxiliary"
@@ -233,7 +233,7 @@ (define zshenv-auxiliary-file
       `(("zshenv" ,zshenv-auxiliary-file))
       (zsh-get-configuration-files config)))
 
-(define (zsh-xdg-configuration-files config)
+(define (add-zsh-xdg-configuration config)
   (if (home-zsh-configuration-xdg-flavor? config)
       (map
        (lambda (lst)
@@ -298,10 +298,10 @@ (define home-zsh-service-type
                 (extensions
                  (list (service-extension
                         home-files-service-type
-                        zsh-home-files)
+                        add-zsh-dot-configuration)
                        (service-extension
                         home-xdg-configuration-files-service-type
-                        zsh-xdg-configuration-files)
+                        add-zsh-xdg-configuration)
                        (service-extension
                         home-profile-service-type
                         add-zsh-packages)))
-- 
2.34.0

[0002-home-symlink-manager-Handle-non-existing-directory-d.patch (text/x-patch, inline)]
From a71346b059691a982a7dc0c7f4fd708b49566500 Mon Sep 17 00:00:00 2001
From: Andrew Tropin <andrew <at> trop.in>
Date: Tue, 29 Mar 2022 11:56:48 +0300
Subject: [PATCH 2/2] home: symlink-manager: Handle non-existing directory
 during cleanup.

* gnu/home/services/symlink-manager.scm (update-symlinks-script): Handle
non-existing directory during cleanup.
---
 gnu/home/services/symlink-manager.scm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gnu/home/services/symlink-manager.scm b/gnu/home/services/symlink-manager.scm
index 3b851229f3..80ca73fed8 100644
--- a/gnu/home/services/symlink-manager.scm
+++ b/gnu/home/services/symlink-manager.scm
@@ -142,6 +142,7 @@ (define (strip file)
                            #t
                            (G_ "Skipping ~a (not an empty directory)... done\n")
                            directory))
+                         ((= ENOENT errno) #t)
                          ((= ENOTDIR errno) #t)
                          (else
                           (apply throw args)))))))))
-- 
2.34.0

[Message part 4 (text/plain, inline)]

-- 
Best regards,
Andrew Tropin
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#52808; Package guix. (Tue, 29 Mar 2022 10:25:02 GMT) Full text and rfc822 format available.

Message #66 received at 52808 <at> debbugs.gnu.org (full text, mbox):

From: Andrew Tropin <andrew <at> trop.in>
To: Ludovic Courtès <ludo <at> gnu.org>, Nick Zalutskiy
 <nick <at> const.fun>, 52808 <at> debbugs.gnu.org
Subject: Re: bug#52808: Guix home should not assume that all targets are dot
 files
Date: Tue, 29 Mar 2022 13:24:12 +0300
[Message part 1 (text/plain, inline)]
On 2022-03-20 22:00, Ludovic Courtès wrote:

> I wrote:
>
>> I finally got around to committing it as
>> 6da2a5a5655668f42ec5b26f875ddbc498e132b6.  Thank you!
>
> I hit “close” too quickly: we still need the patch that changes
> ‘home-files-service-type’ and/or symlink-manager.scm to not prepend a
> dot, so reopening!  :-)
>
> Ludo’.

Those patches introduce a breaking change, but the surface and number of
people affected should be small if everyone migrated to
xdg-configuration-files.  It removes the special handling of dot files
in symlink-manager and doesn't add a leading dot automatically.

Please, merge them on April 8.

[0001-home-symlink-manager-Remove-appending-of-leading-dot.patch (text/x-patch, inline)]
From 1b556cda9716eba31a8a6dd9d3c263988de26ccf Mon Sep 17 00:00:00 2001
From: Andrew Tropin <andrew <at> trop.in>
Date: Tue, 29 Mar 2022 11:28:30 +0300
Subject: [PATCH 1/2] home: symlink-manager: Remove appending of leading dot.

* gnu/home/services.scm (xdg-configuration-files-directory): Add leading dot.
* gnu/home/services.scm (xdg-configuration-files-service-type): Change name.
* gnu/home/services/shells.scm (add-shell-profile-file,
zsh-get-configuration-files, add-zsh-dot-configuration,
add-zsh-xdg-configuration, add-bash-configuration): Add leading dots.
* gnu/home/services/symlink-manager.scm (update-symlinks-script): Remove
leading dot.
---
 gnu/home/services.scm                 |  8 ++++----
 gnu/home/services/shells.scm          | 20 ++++++++++----------
 gnu/home/services/symlink-manager.scm |  2 +-
 gnu/home/services/xdg.scm             |  2 +-
 4 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/gnu/home/services.scm b/gnu/home/services.scm
index 2f441eb968..17acfcdb09 100644
--- a/gnu/home/services.scm
+++ b/gnu/home/services.scm
@@ -285,10 +285,10 @@ (define home-files-service-type
                 (description "Files that will be put in
 @file{~~/.guix-home/files}, and further processed during activation.")))
 
-(define xdg-configuration-files-directory "config")
+(define xdg-configuration-files-directory ".config")
 
 (define (xdg-configuration-files files)
-  "Add config/ prefix to each file-path in FILES."
+  "Add .config/ prefix to each file-path in FILES."
   (map (match-lambda
          ((file-path . rest)
           (cons (string-append xdg-configuration-files-directory "/" file-path)
@@ -296,7 +296,7 @@ (define (xdg-configuration-files files)
          files))
 
 (define home-xdg-configuration-files-service-type
-  (service-type (name 'home-files)
+  (service-type (name 'home-xdg-configuration)
                 (extensions
                  (list (service-extension home-files-service-type
                                           xdg-configuration-files)))
@@ -304,7 +304,7 @@ (define home-xdg-configuration-files-service-type
                 (extend append)
                 (default-value '())
                 (description "Files that will be put in
-@file{~~/.guix-home/files/config}, and further processed during activation.")))
+@file{~~/.guix-home/files/.config}, and further processed during activation.")))
 
 (define %initialize-gettext
   #~(begin
diff --git a/gnu/home/services/shells.scm b/gnu/home/services/shells.scm
index 086fe7d8c4..8389968c96 100644
--- a/gnu/home/services/shells.scm
+++ b/gnu/home/services/shells.scm
@@ -77,7 +77,7 @@ (define-configuration home-shell-profile-configuration
 really know what you do."))
 
 (define (add-shell-profile-file config)
-  `(("profile"
+  `((".profile"
      ,(mixed-text-file
        "shell-profile"
        "\
@@ -211,16 +211,16 @@ (define (zsh-file-by-field config field)
         (zsh-serialize-field config field)))))
 
 (define (zsh-get-configuration-files config)
-  `(("zprofile" ,(zsh-file-by-field config 'zprofile)) ;; Always non-empty
+  `((".zprofile" ,(zsh-file-by-field config 'zprofile)) ;; Always non-empty
     ,@(if (and (zsh-field-not-empty? config 'zshenv)
                (zsh-field-not-empty? config 'environment-variables))
-          `(("zshenv" ,(zsh-file-by-field config 'zshenv))) '())
+          `((".zshenv" ,(zsh-file-by-field config 'zshenv))) '())
     ,@(if (zsh-field-not-empty? config 'zshrc)
-          `(("zshrc" ,(zsh-file-by-field config 'zshrc))) '())
+          `((".zshrc" ,(zsh-file-by-field config 'zshrc))) '())
     ,@(if (zsh-field-not-empty? config 'zlogin)
-          `(("zlogin" ,(zsh-file-by-field config 'zlogin))) '())
+          `((".zlogin" ,(zsh-file-by-field config 'zlogin))) '())
     ,@(if (zsh-field-not-empty? config 'zlogout)
-          `(("zlogout" ,(zsh-file-by-field config 'zlogout))) '())))
+          `((".zlogout" ,(zsh-file-by-field config 'zlogout))) '())))
 
 (define (add-zsh-dot-configuration config)
   (define zshenv-auxiliary-file
@@ -230,14 +230,14 @@ (define zshenv-auxiliary-file
      "[[ -f $ZDOTDIR/.zshenv ]] && source $ZDOTDIR/.zshenv\n"))
 
   (if (home-zsh-configuration-xdg-flavor? config)
-      `(("zshenv" ,zshenv-auxiliary-file))
+      `((".zshenv" ,zshenv-auxiliary-file))
       (zsh-get-configuration-files config)))
 
 (define (add-zsh-xdg-configuration config)
   (if (home-zsh-configuration-xdg-flavor? config)
       (map
        (lambda (lst)
-         (cons (string-append "zsh/." (car lst))
+         (cons (string-append "zsh/" (car lst))
                (cdr lst)))
        (zsh-get-configuration-files config))
       '()))
@@ -430,7 +430,7 @@ (define* (file-if-not-empty field #:optional (extra-content #f))
           (field-obj (car (filter-fields field))))
       (if (or extra-content
               (not (null? ((configuration-field-getter field-obj) config))))
-          `(,(object->snake-case-string file-name)
+          `(,(string-append "." (object->snake-case-string file-name))
             ,(apply mixed-text-file
                     (object->snake-case-string file-name)
                     (append (or extra-content '())
@@ -439,7 +439,7 @@ (define* (file-if-not-empty field #:optional (extra-content #f))
 
   (filter
    (compose not null?)
-   `(("bash_profile"
+   `((".bash_profile"
       ,(mixed-text-file
         "bash_profile"
         "\
diff --git a/gnu/home/services/symlink-manager.scm b/gnu/home/services/symlink-manager.scm
index 80ca73fed8..23ab1e3955 100644
--- a/gnu/home/services/symlink-manager.scm
+++ b/gnu/home/services/symlink-manager.scm
@@ -67,7 +67,7 @@ (define (preprocess-file file)
                            (1+ (string-length home-directory)))
                 (substring file
                            (string-length #$xdg-configuration-files-directory)))
-               (string-append "." file)))
+               file))
 
          (define (target-file file)
            ;; Return the target of FILE, a config file name sans leading dot
diff --git a/gnu/home/services/xdg.scm b/gnu/home/services/xdg.scm
index 361a2a6148..3b504d7d09 100644
--- a/gnu/home/services/xdg.scm
+++ b/gnu/home/services/xdg.scm
@@ -421,7 +421,7 @@ (define (home-xdg-mime-applications-files config)
   (define (add-xdg-desktop-entry-file entry)
     (let ((file (first entry))
           (config (second entry)))
-      (list (format #f "local/share/applications/~a" file)
+      (list (format #f ".local/share/applications/~a" file)
           (apply mixed-text-file
                  (format #f "xdg-desktop-~a-entry" file)
                  config))))
-- 
2.34.0

[0002-home-Add-home-xdg-data-files-service-type.patch (text/x-patch, inline)]
From 5e1f45fa9ea1aca16843dc85d7d21fd46f3cfcb8 Mon Sep 17 00:00:00 2001
From: Andrew Tropin <andrew <at> trop.in>
Date: Tue, 29 Mar 2022 12:47:39 +0300
Subject: [PATCH 2/2] home: Add home-xdg-data-files-service-type.

* gnu/home/services.scm (home-xdg-data-files-service-type): New variable.
* gnu/home/services/symlink-manager.scm (update-symlinks-script): Add a proper
handling for XDG_DATA_HOME value.
* gnu/home/services/xdg.scm (home-xdg-mime-applications-service-type): Use
home-xdg-data-files service.
---
 gnu/home/services.scm                 | 25 +++++++++++++++++++++++++
 gnu/home/services/symlink-manager.scm | 25 ++++++++++++++++++-------
 gnu/home/services/xdg.scm             |  5 +++--
 3 files changed, 46 insertions(+), 9 deletions(-)

diff --git a/gnu/home/services.scm b/gnu/home/services.scm
index 17acfcdb09..49bd6e3555 100644
--- a/gnu/home/services.scm
+++ b/gnu/home/services.scm
@@ -39,6 +39,7 @@ (define-module (gnu home services)
             home-environment-variables-service-type
             home-files-service-type
             home-xdg-configuration-files-service-type
+            home-xdg-data-files-service-type
             home-run-on-first-login-service-type
             home-activation-service-type
             home-run-on-change-service-type
@@ -46,6 +47,7 @@ (define-module (gnu home services)
 
             home-files-directory
             xdg-configuration-files-directory
+            xdg-data-files-directory
 
             fold-home-service-types
             home-provenance
@@ -306,6 +308,29 @@ (define home-xdg-configuration-files-service-type
                 (description "Files that will be put in
 @file{~~/.guix-home/files/.config}, and further processed during activation.")))
 
+(define xdg-data-files-directory ".local/share")
+
+(define (xdg-data-files files)
+  "Add .local/share prefix to each file-path in FILES."
+  (map (match-lambda
+         ((file-path . rest)
+          (cons (string-append xdg-data-files-directory "/" file-path)
+                rest)))
+         files))
+
+(define home-xdg-data-files-service-type
+  (service-type (name 'home-xdg-data)
+                (extensions
+                 (list (service-extension home-files-service-type
+                                          xdg-data-files)))
+                (compose concatenate)
+                (extend append)
+                (default-value '())
+                (description "Files that will be put in
+@file{~~/.guix-home/files/.local/share}, and further processed during
+activation.")))
+
+
 (define %initialize-gettext
   #~(begin
       (bindtextdomain %gettext-domain
diff --git a/gnu/home/services/symlink-manager.scm b/gnu/home/services/symlink-manager.scm
index 23ab1e3955..6d19258ec7 100644
--- a/gnu/home/services/symlink-manager.scm
+++ b/gnu/home/services/symlink-manager.scm
@@ -54,6 +54,10 @@ (define xdg-config-home
            (or (getenv "XDG_CONFIG_HOME")
                (string-append (getenv "HOME") "/.config")))
 
+         (define xdg-data-home
+           (or (getenv "XDG_DATA_HOME")
+               (string-append (getenv "HOME") "/.local/share")))
+
          (define backup-directory
            (string-append home-directory "/" (number->string (current-time))
                           "-guix-home-legacy-configs-backup"))
@@ -61,13 +65,20 @@ (define backup-directory
          (define (preprocess-file file)
            "If file is in XDG-CONFIGURATION-FILES-DIRECTORY use
 subdirectory from XDG_CONFIG_HOME to generate a target path."
-           (if (string-prefix? #$xdg-configuration-files-directory file)
-               (string-append
-                (substring xdg-config-home
-                           (1+ (string-length home-directory)))
-                (substring file
-                           (string-length #$xdg-configuration-files-directory)))
-               file))
+           (cond
+            ((string-prefix? #$xdg-configuration-files-directory file)
+             (string-append
+              (substring xdg-config-home
+                         (1+ (string-length home-directory)))
+              (substring file
+                         (string-length #$xdg-configuration-files-directory))))
+            ((string-prefix? #$xdg-data-files-directory file)
+             (string-append
+              (substring xdg-data-home
+                         (1+ (string-length home-directory)))
+              (substring file
+                         (string-length #$xdg-data-files-directory))))
+            (else file)))
 
          (define (target-file file)
            ;; Return the target of FILE, a config file name sans leading dot
diff --git a/gnu/home/services/xdg.scm b/gnu/home/services/xdg.scm
index 3b504d7d09..71c028c788 100644
--- a/gnu/home/services/xdg.scm
+++ b/gnu/home/services/xdg.scm
@@ -421,7 +421,8 @@ (define (home-xdg-mime-applications-files config)
   (define (add-xdg-desktop-entry-file entry)
     (let ((file (first entry))
           (config (second entry)))
-      (list (format #f ".local/share/applications/~a" file)
+      ;; TODO: Use xdg-data-files instead of home-files here
+      (list (format #f "applications/~a" file)
           (apply mixed-text-file
                  (format #f "xdg-desktop-~a-entry" file)
                  config))))
@@ -468,7 +469,7 @@ (define home-xdg-mime-applications-service-type
   (service-type (name 'home-xdg-mime-applications)
                 (extensions
                  (list (service-extension
-                        home-files-service-type
+                        home-xdg-data-files-service-type
                         home-xdg-mime-applications-files)
                        (service-extension
                         home-xdg-configuration-files-service-type
-- 
2.34.0

[Message part 4 (text/plain, inline)]
-- 
Best regards,
Andrew Tropin
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#52808; Package guix. (Wed, 30 Mar 2022 19:52:02 GMT) Full text and rfc822 format available.

Message #69 received at 52808 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Andrew Tropin <andrew <at> trop.in>
Cc: 52808 <at> debbugs.gnu.org, Nick Zalutskiy <nick <at> const.fun>
Subject: Re: bug#52808: Guix home should not assume that all targets are dot
 files
Date: Wed, 30 Mar 2022 21:51:00 +0200
Hi Andrew,

Andrew Tropin <andrew <at> trop.in> skribis:

> Those patches introduce a breaking change, but the surface and number of
> people affected should be small if everyone migrated to
> xdg-configuration-files.  It removes the special handling of dot files
> in symlink-manager and doesn't add a leading dot automatically.

Wonderful.  At first sight the patches LGTM.

> Please, merge them on April 8.

Will do, thank you!

Ludo’.




Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Fri, 08 Apr 2022 18:19:03 GMT) Full text and rfc822 format available.

Notification sent to "Nick Zalutskiy" <nick <at> const.fun>:
bug acknowledged by developer. (Fri, 08 Apr 2022 18:19:03 GMT) Full text and rfc822 format available.

Message #74 received at 52808-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Andrew Tropin <andrew <at> trop.in>
Cc: 52808-done <at> debbugs.gnu.org, Nick Zalutskiy <nick <at> const.fun>
Subject: Re: bug#52808: Guix home should not assume that all targets are dot
 files
Date: Fri, 08 Apr 2022 20:18:41 +0200
Hi Andrew,

Andrew Tropin <andrew <at> trop.in> skribis:

> Those patches introduce a breaking change, but the surface and number of
> people affected should be small if everyone migrated to
> xdg-configuration-files.  It removes the special handling of dot files
> in symlink-manager and doesn't add a leading dot automatically.
>
> Please, merge them on April 8.
>
> From 1b556cda9716eba31a8a6dd9d3c263988de26ccf Mon Sep 17 00:00:00 2001
> From: Andrew Tropin <andrew <at> trop.in>
> Date: Tue, 29 Mar 2022 11:28:30 +0300
> Subject: [PATCH 1/2] home: symlink-manager: Remove appending of leading dot.
>
> * gnu/home/services.scm (xdg-configuration-files-directory): Add leading dot.
> * gnu/home/services.scm (xdg-configuration-files-service-type): Change name.
> * gnu/home/services/shells.scm (add-shell-profile-file,
> zsh-get-configuration-files, add-zsh-dot-configuration,
> add-zsh-xdg-configuration, add-bash-configuration): Add leading dots.
> * gnu/home/services/symlink-manager.scm (update-symlinks-script): Remove
> leading dot.

[...]

> From 5e1f45fa9ea1aca16843dc85d7d21fd46f3cfcb8 Mon Sep 17 00:00:00 2001
> From: Andrew Tropin <andrew <at> trop.in>
> Date: Tue, 29 Mar 2022 12:47:39 +0300
> Subject: [PATCH 2/2] home: Add home-xdg-data-files-service-type.
>
> * gnu/home/services.scm (home-xdg-data-files-service-type): New variable.
> * gnu/home/services/symlink-manager.scm (update-symlinks-script): Add a proper
> handling for XDG_DATA_HOME value.
> * gnu/home/services/xdg.scm (home-xdg-mime-applications-service-type): Use
> home-xdg-data-files service.

Pushed as 20645d8467852990413c1ea9cf81cec82d23defd.

Thanks!

Ludo’.




Information forwarded to bug-guix <at> gnu.org:
bug#52808; Package guix. (Sat, 09 Apr 2022 14:30:02 GMT) Full text and rfc822 format available.

Message #77 received at 52808-done <at> debbugs.gnu.org (full text, mbox):

From: Andrew Tropin <andrew <at> trop.in>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 52808-done <at> debbugs.gnu.org, Nick Zalutskiy <nick <at> const.fun>
Subject: Re: bug#52808: Guix home should not assume that all targets are dot
 files
Date: Sat, 09 Apr 2022 17:28:49 +0300
[Message part 1 (text/plain, inline)]
On 2022-04-08 20:18, Ludovic Courtès wrote:

> Hi Andrew,
>
> Andrew Tropin <andrew <at> trop.in> skribis:
>
>> Those patches introduce a breaking change, but the surface and number of
>> people affected should be small if everyone migrated to
>> xdg-configuration-files.  It removes the special handling of dot files
>> in symlink-manager and doesn't add a leading dot automatically.
>>
>> Please, merge them on April 8.
>>
>> From 1b556cda9716eba31a8a6dd9d3c263988de26ccf Mon Sep 17 00:00:00 2001
>> From: Andrew Tropin <andrew <at> trop.in>
>> Date: Tue, 29 Mar 2022 11:28:30 +0300
>> Subject: [PATCH 1/2] home: symlink-manager: Remove appending of leading dot.
>>
>> * gnu/home/services.scm (xdg-configuration-files-directory): Add leading dot.
>> * gnu/home/services.scm (xdg-configuration-files-service-type): Change name.
>> * gnu/home/services/shells.scm (add-shell-profile-file,
>> zsh-get-configuration-files, add-zsh-dot-configuration,
>> add-zsh-xdg-configuration, add-bash-configuration): Add leading dots.
>> * gnu/home/services/symlink-manager.scm (update-symlinks-script): Remove
>> leading dot.
>
> [...]
>
>> From 5e1f45fa9ea1aca16843dc85d7d21fd46f3cfcb8 Mon Sep 17 00:00:00 2001
>> From: Andrew Tropin <andrew <at> trop.in>
>> Date: Tue, 29 Mar 2022 12:47:39 +0300
>> Subject: [PATCH 2/2] home: Add home-xdg-data-files-service-type.
>>
>> * gnu/home/services.scm (home-xdg-data-files-service-type): New variable.
>> * gnu/home/services/symlink-manager.scm (update-symlinks-script): Add a proper
>> handling for XDG_DATA_HOME value.
>> * gnu/home/services/xdg.scm (home-xdg-mime-applications-service-type): Use
>> home-xdg-data-files service.
>
> Pushed as 20645d8467852990413c1ea9cf81cec82d23defd.
>
> Thanks!
>
> Ludo’.

Hi Ludo,

Thank you very much!

Can you merge other patches from this thread too, please?

-- 
Best regards,
Andrew Tropin
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#52808; Package guix. (Sun, 10 Apr 2022 20:53:02 GMT) Full text and rfc822 format available.

Message #80 received at 52808 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Andrew Tropin <andrew <at> trop.in>
Cc: 52808 <at> debbugs.gnu.org, Nick Zalutskiy <nick <at> const.fun>
Subject: Re: bug#52808: Guix home should not assume that all targets are dot
 files
Date: Sun, 10 Apr 2022 22:52:36 +0200
Andrew Tropin <andrew <at> trop.in> skribis:

> From 629466d23308e135c4a46951e5ea568677c5ec00 Mon Sep 17 00:00:00 2001
> From: Andrew Tropin <andrew <at> trop.in>
> Date: Tue, 29 Mar 2022 11:15:56 +0300
> Subject: [PATCH 1/2] home: shells: Rename zsh related functions.
>
> * gnu/home/services/shells.scm (home-zsh-service-type): Make zsh related
> private functions more consistently named.

[...]

> From a71346b059691a982a7dc0c7f4fd708b49566500 Mon Sep 17 00:00:00 2001
> From: Andrew Tropin <andrew <at> trop.in>
> Date: Tue, 29 Mar 2022 11:56:48 +0300
> Subject: [PATCH 2/2] home: symlink-manager: Handle non-existing directory
>  during cleanup.
>
> * gnu/home/services/symlink-manager.scm (update-symlinks-script): Handle
> non-existing directory during cleanup.

Applied as well.

I hope I didn’t miss anything else.  Otherwise let’s open a new issue!

Thanks,
Ludo’.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 09 May 2022 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 352 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.