Guix home should not assume that all targets are dot files

  • Done
  • quality assurance status badge
Details
4 participants
  • Andrew Tropin
  • Ludovic Courtès
  • Nick Zalutskiy
  • Xinglu Chen
Owner
unassigned
Submitted by
Nick Zalutskiy
Severity
normal
N
N
Nick Zalutskiy wrote on 26 Dec 2021 18:17
(address . bug-guix@gnu.org)
6050c325-9ae9-406a-97fe-91bdf9bcd12a@www.fastmail.com
The following configuration results in a `~/.run` symlink being created. My expectation is that a `~/run` symlink is created instead. (ie. not a dotfile)

Toggle quote (10 lines)
> (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:

Toggle quote (15 lines)
> (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
Attachment: file
A
A
Andrew Tropin wrote on 28 Jan 2022 11:51
87bkzw2kvm.fsf@trop.in
On 2021-12-26 12:17, Nick Zalutskiy wrote:

Toggle quote (4 lines)
> 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 :)

Toggle quote (34 lines)
>> (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
-----BEGIN PGP SIGNATURE-----

iQJDBAEBCgAtFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmHzys0PHGFuZHJld0B0
cm9wLmluAAoJECII0glYwd6w/iUP/j9ysCXYCXrPV+9rweTqixC150fBRMUYpbD8
/Gz3hOCbORvQ+vOksTYWAF1k2/xU4orz/oXqOGhMNAuD9Rv+KntpZ+DsO9pRkQbt
+o9qs5b3JkB0EBfUWYddguOrSVTg38VG25HyJm4LK3GW3yVlImEgiCilaN7cf9dd
ViGmovywc74AKi3wsM7Zxml1nS8QMy6zdZo9Mm1MVp6RHBreCcrBEum0AFbw0zPx
Il3qAynorByapfluuo2FkD2r3yMekvjUaRNY600fZoKir0WyAG28QiDqelC7TPYp
VaiYguhmNlLUk3o10hiZnShJ6saqJwCaAN6KBWEDC8ekZL+3+LCuIX9mFIJNM+a3
oEz1MISSG467gMnd4ZJMhG9MeUgUnbsSBD/th96ES3VXL6V0xtQFD0wqyLcoFL4w
xqP2KOSkTkyeW6cm0dyYbtk7gBBIvaVduIESv77zk4dMazF7Or1gkAq+DMGz8ys9
IMZ2DEE3Zr2DEungfXaF7Bbbf9FU8kZVt42tEBRTiJvZZREMVc3TaLMDlBoBl2jE
d+zVtjeOqYOrLDIhQmRhOlWXFOEMABLyHvhTVOeJrW/BfcrosohBPA9Fcd1XC7O+
GJeUOTcjxkkwUXAeTyocLoYYL1VDCoFQyH38zBsGlgvoHJ+g+Z3+XdvvJr0UleeB
kN/hN2F7
=vJjk
-----END PGP SIGNATURE-----

N
N
Nick Zalutskiy wrote on 28 Jan 2022 14:33
5f2cd1dd-c91d-4fed-8b45-3261e53d92a5@www.fastmail.com
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:
Toggle quote (66 lines)
> 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
A
A
Andrew Tropin wrote on 28 Jan 2022 16:22
875yq33mxw.fsf@trop.in
On 2022-01-28 08:33, Nick Zalutskiy wrote:

Toggle quote (12 lines)
> 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.

Toggle quote (5 lines)
>
> 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.

Toggle quote (6 lines)
>
> 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.

Toggle quote (4 lines)
>
> Having said all that, the documentation helps a lot. Thank you for the
> patch!

Sure ;)

Toggle quote (73 lines)
>
> 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
-----BEGIN PGP SIGNATURE-----

iQJDBAEBCgAtFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmH0ChsPHGFuZHJld0B0
cm9wLmluAAoJECII0glYwd6w9G0QAIKS/dTSksJCJccaUgYhpr86oDmP+eKDG4tv
+Dcnp/XlbOLtxyDkzbbugs5o5ZnPwtDFXgNospkWhkNgTLJ1svdCA1s0mHpxd/6g
gLgGIl4nerysOGPc1Ycf3BkK8FAXNYpzS+5OR8CARrx7OU6slvpulblY7Vzfk2eD
Nt4z6jqmEUiZXq/sJGY7Gqj0auuVFJ9OxR5zGwNAWo7D8BdTusrbbBeqJqid48yf
5DHbUmqML+ZPraWCYasT6bgwiJr0k2+ANHM8lLzDkIwWuc1fhLdCKNEVZGaBnifV
SoOOJzQkJ4QdaVu878Hy5FrwkEfTLrRXy54OmB9UCtBCYgvSn4Rvwu5uzQ05wHpP
0SlrrEDKwnWbUX+4ndGjXdbNbkNAmrBPS6dH8WalVddC4bVvKm0TcTJ1IQJfFE2T
5H0FPNLrj4USjsWon3D1Q4QeOhF8LeQ1UHRYrdUhGRTWXdrfSpvLr7NbLb9R/rkb
VSHyC2fFbX4/01bt6VaV49mgOkf++YJYzFkGaZDtn9eTEt2pADNi6DgdbKOfRpVn
0W4xBntV37/gBGCT9teqD7w/yTWakqOQ8cQN0OI+BsCZ6WiTuaH5VCurMODM5noa
EjSmalsACJGJT8XnazALd2mbqLzpLnZEAOMTP6vWCxipaYQcnNsMV/ZFv5xR4Yt4
SDYgqpvV
=q4zE
-----END PGP SIGNATURE-----

L
L
Ludovic Courtès wrote on 30 Jan 2022 18:13
(name . Andrew Tropin)(address . andrew@trop.in)
87o83t9mf8.fsf@gnu.org
Hi Andrew,

Andrew Tropin <andrew@trop.in> skribis:

Toggle quote (25 lines)
> 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. :-)

[...]

Toggle quote (13 lines)
> 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.

Toggle quote (3 lines)
> 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’.
A
A
Andrew Tropin wrote on 2 Feb 2022 09:10
(name . Ludovic Courtès)(address . ludo@gnu.org)
878rutzo1d.fsf@trop.in
On 2022-01-30 18:13, Ludovic Courtès wrote:

Toggle quote (57 lines)
> Hi Andrew,
>
> Andrew Tropin <andrew@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/

Toggle quote (12 lines)
>
> 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
-----BEGIN PGP SIGNATURE-----

iQJDBAEBCgAtFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmH6PI4PHGFuZHJld0B0
cm9wLmluAAoJECII0glYwd6w4VgP/1aPYshRcoiRI50ajVWFn+iTiceimi0OgH/3
S/sPbeFjJwWZAOjZDkuyU3edEgdTIAl9uZ8O7SfSjuLggWRakz/JiUgmTkQhSsno
oaygfJb1Em8LTY3ATR2Uf8KZJbpJEU6Vf7DdK8uymXIBNofO+9z6B3wyoyjRVOEV
yU9HRB7Pp57Jeo6iKu6P1TWZczmbFHq2svRHu9SGGUB6kgnE/cbitMon9zu1v346
a62IXx0+dHq3gvCJMTSxTxVgBVAwrL+xkViRe64BoNh6RglfzGsEWYvpSnI1qzm2
XlgOWDTF0vPxb/1T3ZHGLt0GDhl5VASYEAoMQUxbHRyeX+hTB2AePzU0DtxTMCOj
CfCeTZksg4kLD64S1GIAWP1r3eq04WXKneWnNuQTFFV5hUOOFJSJ8ziBBXo+HArr
ATH1Fk0egZ875hFcswV0mN3J71MRUot3LlTtHGOTBNc3241lu1nZJ3Z8/ukMFNF5
JAOEJOFcmatq7XybVHUiGdV4m6kg2WtgfmjN7qlWce6cN0IDl7Oqj1Hn9cx6gKDu
NiDYuoV43gil2IB0xzxAMXaHk0IkywZL1wz2gwZGnE0U5NhsC0tKRmPpKX4UJ6Wn
s1xmsoDvPJDfjzbeCyI9XwwyCRKxW1KotovbYI+OnSBAEDJDV1QOYnm6Zy787jVE
3q3/g57v
=UKYf
-----END PGP SIGNATURE-----

L
L
Ludovic Courtès wrote on 8 Feb 2022 10:46
(name . Andrew Tropin)(address . andrew@trop.in)
87zgn1bsha.fsf@gnu.org
Hi,

Andrew Tropin <andrew@trop.in> skribis:

Toggle quote (14 lines)
>>> 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.

Toggle quote (4 lines)
> 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.

Toggle quote (11 lines)
>> 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’.
X
X
Xinglu Chen wrote on 8 Feb 2022 13:58
875yppzfa2.fsf@yoctocell.xyz
Hi,

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

Toggle quote (6 lines)
> 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? :-)

Toggle quote (3 lines)
> 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.
-----BEGIN PGP SIGNATURE-----

iQJJBAEBCAAzFiEEAVhh4yyK5+SEykIzrPUJmaL7XHkFAmICaOUVHHB1YmxpY0B5
b2N0b2NlbGwueHl6AAoJEKz1CZmi+1x5p5wP/3TXtI9luU2R54gWPU1NQxaWqBnI
VDNx4C1BT9B7DfV9jT25FtoXnBrMZGeDY4O/dBu2lZwEh4yePdL2PAyTOT9QWUB1
HzRbb8AI5Be3YOufO3T3ZuL+o2pmmEf3m0FlMxrCB+mTA6SsDfWtDt47lhSx9+v2
VCJHkdpY6EIXFCekO1jZowGZZ/kWB67bckVgbCWxb0i4Tu1MR63gFAX/hgllLzs0
ynaZB/Qrupzflx0tsxELDR8aQbR6y24Mpc8PuXev/NrP7vqcGpLMZOxdQgK9UYIa
S/oyCMEd8og77jOL28bhnR0YQ2NOeN3UVRW8BjjFKAHlytko5KwZWwrQ3UnSaotu
2LtIhabzbSObpShZUer4PLobOgRjDFr2k+ENuVqi3wEmoPIcLsX9IXKE6ny2DmTy
GTuB1HbO1h2iPXTQdAgprbRvRrRUSM1HhgAjEhSwMG1YqqNDK3sQz4UsBv3gn+al
ite3ekMpdNDDMz6t0oVymvsh6a0TXDDXlskzy4mqkzDI8qgHeie8NIjYygZLlVxA
k9+7rdx9UhAtkHYxEQGOMrGNsOsK3axIKABqEnD1T80QDkHm+muJUjyr3JHrbgQd
vHaRqtII7Pvim4jjwhWWNLatVLfeoo7NLq/56pYtY6YKePvyhaQTNY937/1+wcY9
ayu7EoMe0TrB0uVv
=JT36
-----END PGP SIGNATURE-----

L
L
Ludovic Courtès wrote on 10 Feb 2022 21:32
(name . Xinglu Chen)(address . public@yoctocell.xyz)
878rui5upg.fsf@gnu.org
Hi,

Xinglu Chen <public@yoctocell.xyz> skribis:

Toggle quote (10 lines)
> 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? :-)

Toggle quote (5 lines)
>> 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.

Toggle quote (4 lines)
> 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’.
A
A
Andrew Tropin wrote on 11 Feb 2022 16:52
(name . Ludovic Courtès)(address . ludo@gnu.org)
87r189s8mz.fsf@trop.in
On 2022-02-08 10:46, Ludovic Courtès wrote:

Toggle quote (45 lines)
> Hi,
>
> Andrew Tropin <andrew@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 23f7095d60b18b52de0d1aa314c4012cdf55a046 Mon Sep 17 00:00:00 2001
From: Andrew Tropin <andrew@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(+)

Toggle diff (49 lines)
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 ef4c3bbcc0c8c1a251f4ad6c494f8ed30adf45f2 Mon Sep 17 00:00:00 2001
From: Andrew Tropin <andrew@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(-)

Toggle diff (98 lines)
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@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(-)

Toggle diff (57 lines)
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
--
Best regards,
Andrew Tropin
-----BEGIN PGP SIGNATURE-----

iQJDBAEBCgAtFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmIGhkQPHGFuZHJld0B0
cm9wLmluAAoJECII0glYwd6wFucP/iPnHFKo/gkCj+azi72XXAPUWec60GCh4pfQ
gSzE/9NA8e/E+16xnGtVQcAcsB6ujXm7gOpyHCxjrC1OfZewbhCeh9+t5S1vZYGd
oOWmJOd4Y6+YnpOkTZmKGOhDSyxO4UfFIowmd1QoFStgSc0uEKTIWmnB+8do9M81
6Hyjb8ygCIh0mDV4osYMob6kg0K3h1I09Ynp3Fa6lKZ62b8MHrGj+3YDI+uaLa6b
ygbis7P1k3e0WQ3uZDMuPX32QiQ7cJT1dmFT18siTlmJiIx2LNcYlwRyh34QJhWK
j9bKJwRKrJDm2duxtiM3je9KNIwnqkKwLUMqbhjCByu79hWgXJnoOAKmtwhzsTdj
sYso2+hJYXhz56jCKNOrTWKD7dWq35sJk4exOfq4tK8PheiTR3/srsA8cIw/mFoD
IoKA8hk3uCtroC3S0MZRQvAeUImtfABKWpHeGUETvTXuLvMeSSszuodayLJd9P0T
t1GZBCyZux5AvUOeFuwLP2N/omwhjjDYl/3M/fBm/Vv5MpFKDH3FGqcbqv+IxDB3
qR91k6j6F83Q7TYX6FC2mMO2UFv2XjlmsLSMF5SCeFPvf0socbdUUpDRfKceLVwz
rkpWnB358sPPH3kshRpFVOJLeOn/l7MP55+/gUqVVtRB+Ux5bYBiB+9CtboI42/E
Ik01RWy+
=ns8e
-----END PGP SIGNATURE-----

A
A
Andrew Tropin wrote on 26 Feb 2022 08:13
(name . Ludovic Courtès)(address . ludo@gnu.org)
87lexydrs6.fsf@trop.in
On 2022-02-11 18:52, Andrew Tropin wrote:

Toggle quote (481 lines)
> On 2022-02-08 10:46, Ludovic Courtès wrote:
>
>> Hi,
>>
>> Andrew Tropin <andrew@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@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@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@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@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
> - `(("c
This message was truncated. Download the full message here.
-----BEGIN PGP SIGNATURE-----

iQJDBAEBCgAtFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmIZ0xkPHGFuZHJld0B0
cm9wLmluAAoJECII0glYwd6wg5IQAJP2X3Jkz4e1I9JKEQ0t5xVvpRcN23mbomMr
Aogn4GTPU6MjitAjqZK/uYD/wEwOU5auHivffiUTr3MkVjTDXoj0dZw2fGHHcqs/
PDaxUiMwxZVm9Ktt3iFdjs7IFtBr5SmgGhh+K9ELMsx3ZbDD2Mxa22x5BaxObPDK
9jMse2d1bo2EIeYWJ/7GyqN2M6gAfWax84CQhuX1eLAteSg/NCDUxHXt5Eze3llf
YLm+NyrzEMdHAUV7ZFyN8V2EeRkkBkoEp1HDzfGwEvzt93sgRLfGjTVawV+TpT36
HDbVI3SNbuJuKfFN5aUHzVqXaegAkxZi77YHs3FGYKv66EJAwBEMOsiN0rh+BtA1
/8X7x57NBBoVupWtmKKdgRwZhtzxVpj2aeuMpOyJfrHSBqLrMJxqXQZjeEx26DK+
W+6YzDIUD6YgSDOdhEcNX1KOcX241HJ7OoAZQo6qpXjUwubmmGydn6ko6QFQ0bfM
tjSY+SagGwsvTaCwZanXWvAa7bCMKoHkEHcFescAd3ZUjHQ2S9VSv06ZNh/Uc1JG
UzoRfvKXR52ne05LFN0I4uiSHFXztt67RRvA2PC6Aq5W6gUuuhae1ZpHAHCrdz12
LTGUkk3UyX5KewxPUA6SFDnjvVIShrOZhZlAHOwuc4RwTvUXkBWlyV72kTOr5IQ+
ByvcFsol
=DPup
-----END PGP SIGNATURE-----

L
L
Ludovic Courtès wrote on 5 Mar 2022 23:44
(name . Andrew Tropin)(address . andrew@trop.in)
871qzgm33o.fsf@gnu.org
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@trop.in> skribis:

Toggle quote (5 lines)
> 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!

Toggle quote (10 lines)
> From 0cd37bbc724f9c793898c2655bdd1c335045c5f0 Mon Sep 17 00:00:00 2001
> From: Andrew Tropin <andrew@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).

[...]

Toggle quote (6 lines)
> - (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.

Toggle quote (7 lines)
> From 23f7095d60b18b52de0d1aa314c4012cdf55a046 Mon Sep 17 00:00:00 2001
> From: Andrew Tropin <andrew@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.

[...]

Toggle quote (8 lines)
> +(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").

Toggle quote (5 lines)
> + (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.

Toggle quote (8 lines)
> From 11f23a48d480a91d6bfba0ff55c1a9831585a4ee Mon Sep 17 00:00:00 2001
> From: Andrew Tropin <andrew@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.

[...]

Toggle quote (11 lines)
> From ef4c3bbcc0c8c1a251f4ad6c494f8ed30adf45f2 Mon Sep 17 00:00:00 2001
> From: Andrew Tropin <andrew@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!

Toggle quote (9 lines)
> From 089683bbd301f6e085f00fbd53713f335abac40e Mon Sep 17 00:00:00 2001
> From: Andrew Tropin <andrew@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’.
A
A
Andrew Tropin wrote on 9 Mar 2022 05:26
(name . Ludovic Courtès)(address . ludo@gnu.org)
87o82fwy3k.fsf@trop.in
On 2022-03-05 23:44, Ludovic Courtès wrote:

Toggle quote (5 lines)
> 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!

Toggle quote (34 lines)
>
> Andrew Tropin <andrew@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@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.

Toggle quote (20 lines)
>> From 23f7095d60b18b52de0d1aa314c4012cdf55a046 Mon Sep 17 00:00:00 2001
>> From: Andrew Tropin <andrew@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".

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

Sure.

Toggle quote (45 lines)
>> + (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@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@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@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.

Toggle quote (5 lines)
>
> Thanks in advance, and apologies again for the delay!
>
> Ludo’.

--
Best regards,
Andrew Tropin
-----BEGIN PGP SIGNATURE-----

iQJDBAEBCgAtFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmIoLF8PHGFuZHJld0B0
cm9wLmluAAoJECII0glYwd6wBjQP/jVYHKadKL5KesHSs5O6wGMQYjxJPQPx4ruA
/fSlNWl5k5P0wVa5ew38Lwx0sfC2Q4yAJJFkMc7hnaELcexM1kzmshNR3uQEJKhD
+pBqus03ZZEFNRls6Z7BdRFSmQAzTBGcLRuy8FSOC9fQLGQEIvXUv02m1W+q1rU+
asU9vOY7DQCCeHENOhJ82K7IoklKrOqxK/8onBD4RP97OvsR9qRR2rSREm/U0gG+
h0PNZnP9t54/xGVzc0nJZg+smUCkSPeanxEkm/leIJxEW5DyteMIhgH6zpYkyVZ3
QkA6FTlHl76GheQfVoyG0AWpAsIZGBn2lT6wAnmGELQG2uLah6+wrznslYqRzUOY
fDNbrvVtsS+y0hWsyn/1zY9X/qaNNHWpLz+s5nzAr856Nuvz6P0LTEn+JQKxDwbn
hjSYnwm62SE1Z5LXEkWXVlH+7RlvrpG9jzcxKnYy5JA4Plc6papk9UVWshPmgW9a
Uunoz7KZBWk2ET24ZsEs8rbka06lOd2SXm85sE8oh1lfBowM09aD/DHajnxeKSLa
ZXdtD1sPCsHQ67aeMT76uPEa5Pkwrwo3Od/eUqfX6n6PiU7aTwCzevIWOAlF7EeI
SsqJOJkPO5Cjc0uZJUmBKzA/qyTlt1U3WM3vRHQVE168nGlfjwIT0N2x8roa9fLX
a2+guCL+
=yd+/
-----END PGP SIGNATURE-----

L
L
Ludovic Courtès wrote on 10 Mar 2022 11:56
(name . Andrew Tropin)(address . andrew@trop.in)
87r17axeim.fsf@gnu.org
Hi Andrew,

Andrew Tropin <andrew@trop.in> skribis:

Toggle quote (2 lines)
> On 2022-03-05 23:44, Ludovic Courtès wrote:

[...]

Toggle quote (10 lines)
>> 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

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

Thanks,
Ludo’.
A
A
Andrew Tropin wrote on 11 Mar 2022 08:41
(name . Ludovic Courtès)(address . ludo@gnu.org)
87o82dkkbd.fsf@trop.in
On 2022-03-05 23:44, Ludovic Courtès wrote:

Toggle quote (38 lines)
> 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@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@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.

Toggle quote (21 lines)
>
>> From 23f7095d60b18b52de0d1aa314c4012cdf55a046 Mon Sep 17 00:00:00 2001
>> From: Andrew Tropin <andrew@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.

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

Done, done.

Toggle quote (10 lines)
>
>
>> + (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.

Toggle quote (43 lines)
>
>> From 11f23a48d480a91d6bfba0ff55c1a9831585a4ee Mon Sep 17 00:00:00 2001
>> From: Andrew Tropin <andrew@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@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@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.
From 3a6dc64d3366aa37507c83c598cbddb0f0815b6d Mon Sep 17 00:00:00 2001
From: Andrew Tropin <andrew@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(-)

Toggle diff (15 lines)
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
From aaef728aaf621884cce49539d47abb09a9f1e32d Mon Sep 17 00:00:00 2001
From: Andrew Tropin <andrew@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(-)

Toggle diff (44 lines)
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
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.
From e98e5ee520fada9c6d100f40fcafa6358b626365 Mon Sep 17 00:00:00 2001
From: Andrew Tropin <andrew@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(+)

Toggle diff (49 lines)
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
From 99ef9ce7d0796642a54497e3a080e94a78fbb03c Mon Sep 17 00:00:00 2001
From: Andrew Tropin <andrew@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(-)

Toggle diff (98 lines)
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
From f34175838dac46093a26971798b08c0679691b34 Mon Sep 17 00:00:00 2001
From: Andrew Tropin <andrew@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(-)

Toggle diff (46 lines)
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
I plan to prepare documentation, second patch series and announcement
next week.

--
Best regards,
Andrew Tropin
-----BEGIN PGP SIGNATURE-----

iQJDBAEBCgAtFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmIq/ScPHGFuZHJld0B0
cm9wLmluAAoJECII0glYwd6wulAQAIV0kkYIifh66/uDx/80aZ8xJZlJEYv+/64O
z4ZOzZVWuPvzOPcL/JwumIz1GC78tioWlVCaoKivs0x+3NH1N4wQVBc3SUKbxfqU
WIIMxoq02Wt/slGwNdt60Bzi7SBitoLiiH4MS1TUJTqr09x79G7vLs8q7zPCvcvo
c1usaibWFThdtA5Y07cFqa6rZgqrQDWQrOdxka+SRbiIJ8485ILovafdjDBfA+PG
HVa3PxEitdCdU4QaN/seBIDn6ap4ziFzXtMzefyasoV0mLYaShWW4mu2Rq8P83nx
DG0E8hzU1LgSjfkb4LZIx+epp3KcFa0Y3abwTOAfgYqKoodlSKJQnjOHmcHe78oh
F52K7696PwVXqOn+mETTeVNOnhFlQzNS5s3MLQEnNCOpCqHyc4ByzP9v/NdpJC0i
3SfHt7b3azoKi11HO1T3yUnd6Zp7yRTu7aS1crYZg449vSOeY7ueDEZz1SaZdI2N
YyV31vEVaZvwEM8SEwifGM9ljWy3kfx+q3sWWOrD/mYWzeflx/NIzak8ri7mfXEv
z5GnJ9nYzW5gVvm06s9zo/kpRYb+g7I6KN07o8Qe1yW1VWkCBx4taeoNjrNrcrq1
dnnda9e/q78F9k97LlveYUQRCr5LH5RMzS2yccnTxxLVhJQKdwQbyGsWtju9gPxR
/BKOc+9T
=HkF5
-----END PGP SIGNATURE-----

L
L
Ludovic Courtès wrote on 20 Mar 2022 19:07
(name . Andrew Tropin)(address . andrew@trop.in)
87mthklcpt.fsf@gnu.org
Hi Andrew,

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

Ludo’.
Closed
L
L
Ludovic Courtès wrote on 20 Mar 2022 22:00
87h77sl4pn.fsf_-_@gnu.org
I wrote:

Toggle quote (3 lines)
> 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
A
Andrew Tropin wrote on 28 Mar 2022 11:17
87y20ubfm2.fsf@trop.in
On 2022-03-20 22:00, Ludovic Courtès wrote:

Toggle quote (11 lines)
> 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:
From 7d9cf53ab574c8ab468bfdae2798de65af6c00b5 Mon Sep 17 00:00:00 2001
From: Andrew Tropin <andrew@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(-)

Toggle diff (24 lines)
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
--
Best regards,
Andrew Tropin
-----BEGIN PGP SIGNATURE-----

iQJDBAEBCgAtFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmJBfTUPHGFuZHJld0B0
cm9wLmluAAoJECII0glYwd6wSj8P/24ucilDoqq2r7Epzp6yExhE26xNfgOzmUeN
wJ2kdhoQyNhDEZwqaGC+ccYkX+HFVni0Ph0eZg+icthSTpc9qIqZ4FmrkmtMcnJF
Acu6IkB7LfQvUhQZA655YLMPzLHanZ1kgK7bnmf/sHL/2yQfY+Mdiy2odqhPhX3+
MJTjhfu2sL5NWFZQUlqXbv7qj0W1blP2XO7MPRwa+hLb7Kw7I8E/cDStuiX7Ed5e
K4marusmb8rPzIQE/Z3WqparRGf5h35bYXGgcs/pkY0XQps5lfiMnEbhAX84Xv+g
KaxSZhISMylugw5pXuNWapfZ3OzWpxe5HI6AQQSRqVf15M9uQs9QaW0aB92yDOy1
pa4k1dFo1/kOcbDvG/6OCoKvkJvYJnc5+sHAikAO+0kf0X39LWqKCT56ErxDQoxY
cUotLiy+2Pe35rpSr4JElh1h5aMlICzNXNcwLoXio5FOIDVqPFON9FLB4UWA/rd2
XQ25HRuZ01AKNAOCwXneJ0SEick9tQ7WQ1Tc8O7NUr3Q1n5ovmtDPTT6jKXR60+I
4tc2ZilKpZAn8k3hKmRM8RsCtM8HsgSXWIOfqbZ6bvhfNlL5HLGsaCEsG47gxzIh
GEGevNWAK4Cgcc/5iGMBhBu3yn++D7h/cTB78TbOsH8PyWsMa+sEDS5GtipSD5BW
JktceF3a
=4VGR
-----END PGP SIGNATURE-----

A
A
Andrew Tropin wrote on 29 Mar 2022 11:51
87fsn1f5mo.fsf@trop.in
On 2022-03-20 22:00, Ludovic Courtès wrote:

Toggle quote (11 lines)
> 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:
From 629466d23308e135c4a46951e5ea568677c5ec00 Mon Sep 17 00:00:00 2001
From: Andrew Tropin <andrew@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(-)

Toggle diff (37 lines)
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
From a71346b059691a982a7dc0c7f4fd708b49566500 Mon Sep 17 00:00:00 2001
From: Andrew Tropin <andrew@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(+)

Toggle diff (14 lines)
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
--
Best regards,
Andrew Tropin
-----BEGIN PGP SIGNATURE-----

iQJDBAEBCgAtFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmJC1r8PHGFuZHJld0B0
cm9wLmluAAoJECII0glYwd6wW+gP/irj2SRC6zaFIjLeJ5NTj6/1qglobQ6td/of
SrKWdjtkhHOdFw8fGSh+sxsnbddSx55Z6VlF1INpbNu+dexVjj/k8+xTkn2FNT/J
xVE37UHzxMrHwTr9+LV+FZauzhJzCh1uf50OX6S7TUYRXKz58hWKcGT2ziN6hG9T
Nk2s22yEbd06hmqN0KiznPxWZuS9KL4yKZ1zi/NbUEYkbhauyOGzJ0UO59XLKXKg
pKS9L0TZBvbTUIJoKzZ8LpdzV3wTgzeCWuV/7Du1GyVfZvZMiqrL5uc+uuw+92y5
rRt+vHnrLI7ZMdVeyUaJAlUXiCRZGGxJ2BSJm+yzvqmDjM+T2Ql6MMii4bTfwyLc
bODoCApwYkdk6xao+G2u0f3L7qSxbn+smu+AY6eWJS7li5d2hfS2Re2rc+/+ZeED
gsJnJfuZbSFCCfbr7AMxkx0IacpIZl/lt6FFkkgyO1uhwG4PBkSbvtPdgNH+xDE2
EnK7rAG+NM0kB7UdcnawFByAJfNSDpTUVBULnQx6BBd5sUIq2wEzPwDt1U39hxX1
NK2EyimijMZd5uWQyWlBUFYx4dl3HqDs7447UBn7yPLi8rfTad9a4kS7w0tEbGRy
O2M8Aq9EAJ9tFkKVwO+dSJkz8T6LfbZrZetDPrNI5osRTo0882WCIiq6gDefurQJ
NSgEW1cs
=S+qk
-----END PGP SIGNATURE-----

A
A
Andrew Tropin wrote on 29 Mar 2022 12:24
878rstf44z.fsf@trop.in
On 2022-03-20 22:00, Ludovic Courtès wrote:

Toggle quote (11 lines)
> 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.
--
Best regards,
Andrew Tropin
-----BEGIN PGP SIGNATURE-----

iQJDBAEBCgAtFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmJC3kwPHGFuZHJld0B0
cm9wLmluAAoJECII0glYwd6wemYQAIqGizTv/391UhCfwRYj2ha/yeNHdMgaRfaW
DjF2C7VgbwSvVzMJULFaZb+NWOjJwATtSMkBzM/2vY32vXBlJYBDfchWDSWZqPQM
9LwwO5HTU5GekwG1ZMPyiTgh+cNE8gy9M84vkTdJg8zKmb0jTvRDDv+DueQXxaCv
83uwBxPuP2KksrxY+MWexzxDd3CIeSfkm3xTbmIUMS8CGkgsaqO/hQpjlcT2KiXm
cIusfRJ2FwP/BsyPIk0aSvgw4eJqTuNxBVJw7YxDRkuvFvtpqkE9kffets4PjZpj
rIAL9OisDmmbB8U36Qr1EGkMayh+7UEZjjSGIj7UlfIUblY7fipz+pJtNjUp+w96
VmqJmSoM4vJ3HbQFYCswppw1LlnX9HssfA9MvJikv/J4sOkSHsoVXnCEWuRj/RL2
nLQr7SpRahZUibIPdsOPTwzzQg9dKH57LHmnH8lpKCU13aoi/JaQkeQZCd6hcsFe
+6Y+QY0zjN5/ssd6Okq54Qt5g37yX1DIpTibnfRhuctmBwdBrwwt81Wc4cOXyaLL
Ep2XYdZVtACMNgBOGUA+yLp5ILZoMnvYyPxbMb4qQ7ZQBgD3Ljp0TYAZBni9prP8
cod5jPyhG7oB/z/yrOthN2wQf93tV8WymL7p4rC1JOgY9hcAMWY4mXm+Uzo/c+dV
u+JXwOrI
=wmIG
-----END PGP SIGNATURE-----

L
L
Ludovic Courtès wrote on 30 Mar 2022 21:51
(name . Andrew Tropin)(address . andrew@trop.in)
87mth7te1n.fsf@gnu.org
Hi Andrew,

Andrew Tropin <andrew@trop.in> skribis:

Toggle quote (5 lines)
> 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.

Toggle quote (2 lines)
> Please, merge them on April 8.

Will do, thank you!

Ludo’.
L
L
Ludovic Courtès wrote on 8 Apr 2022 20:18
(name . Andrew Tropin)(address . andrew@trop.in)
87ee27bfr2.fsf@gnu.org
Hi Andrew,

Andrew Tropin <andrew@trop.in> skribis:

Toggle quote (20 lines)
> 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@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.

[...]

Toggle quote (11 lines)
> From 5e1f45fa9ea1aca16843dc85d7d21fd46f3cfcb8 Mon Sep 17 00:00:00 2001
> From: Andrew Tropin <andrew@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’.
Closed
A
A
Andrew Tropin wrote on 9 Apr 2022 16:28
(name . Ludovic Courtès)(address . ludo@gnu.org)
87y20e2uvy.fsf@trop.in
On 2022-04-08 20:18, Ludovic Courtès wrote:

Toggle quote (43 lines)
> Hi Andrew,
>
> Andrew Tropin <andrew@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@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@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
-----BEGIN PGP SIGNATURE-----

iQJDBAEBCgAtFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmJRmCEPHGFuZHJld0B0
cm9wLmluAAoJECII0glYwd6wwzUP/j6cJLKdLHzHwdUNXJ4OY9R7H7RnEn+N23kC
yuTW4oibtX1k9zZ4hnZuE8H8pnfD/p8pilb5QgpeqSBKf26YzpAblrPZ78i0U4GP
39mTjDZa/Fh/8ja/YNW4FaLdrQKSOpVNol1ckfTAIR/4Lqq3E25BTpgeoNBinfAG
5j6+O/lErrOqA9vNdktiIcl3UqTHdp46Exmb9rib7zAUZh32K2+qYeJiK8u3K/r1
xM7vAkelLFFs3Wh1ZVZi5vpypw3uZvtRt3kHVChskSQbMYha2WlIWxWgYqxIkNRM
eJ37Lxp9nDjb2HkA3yKWEVnpNe7rguQBpTLFmUD/0q2EKiB2HdO9kZbcjuoULlSg
4kBqQcvm4x2Eboa/oyhIxqxbspitW0/3PwAiWSjWkUWGbz9B9l1Cr3sbVC0xJTHq
p+0a5pTydSRfnKZuXKLr38DwZNzNc2tQkS7pvamBltNuOHnZV0D88UN5qjm+u+NO
KZTp2wj1lW4WWT4o+NbJSCUAjuWRuaZwafl0HD+LV3pbFfsStUOF2WnOroNpQ978
C911weQz2WxMv5x0/p+ll00NoLeoxAnAW+bnsW07/9JB+9yO5d1Y9bxIywtRWzM0
kYwQsNb2fQYl9wdYZRJAW3TnHqkZ+rLTwCLstNqCWO1I/tskYpf3bmmlsTz6I+P/
sBKUPfGh
=9+R9
-----END PGP SIGNATURE-----

Closed
L
L
Ludovic Courtès wrote on 10 Apr 2022 22:52
(name . Andrew Tropin)(address . andrew@trop.in)
87bkx84q5n.fsf@gnu.org
Andrew Tropin <andrew@trop.in> skribis:

Toggle quote (8 lines)
> From 629466d23308e135c4a46951e5ea568677c5ec00 Mon Sep 17 00:00:00 2001
> From: Andrew Tropin <andrew@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.

[...]

Toggle quote (9 lines)
> From a71346b059691a982a7dc0c7f4fd708b49566500 Mon Sep 17 00:00:00 2001
> From: Andrew Tropin <andrew@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’.
?
Your comment

This issue is archived.

To comment on this conversation send an email to 52808@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 52808
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch