bug-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#52808: Guix home should not assume that all targets are dot files


From: Andrew Tropin
Subject: bug#52808: Guix home should not assume that all targets are dot files
Date: Wed, 02 Feb 2022 11:10:54 +0300

On 2022-01-30 18:13, Ludovic Courtès wrote:

> 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/

>
> 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

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]