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

Previous Next

Package: guix;

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

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

Severity: normal

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

Bug is archived. No further changes may be made.

Full log


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

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

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

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

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

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

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

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

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

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

This bug report was last modified 3 years and 39 days ago.

Previous Next


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