all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: zimoun <zimon.toutoune@gmail.com>
To: Ricardo Wurmus <rekado@elephly.net>
Cc: Guix Devel <guix-devel@gnu.org>
Subject: Re: GUIX_EXTENSIONS_PATH pattern
Date: Tue, 09 Feb 2021 01:40:37 +0100	[thread overview]
Message-ID: <864kimkr96.fsf@gmail.com> (raw)
In-Reply-To: <875z32rxse.fsf@elephly.net>

Hi Ricardo,

On Mon, 08 Feb 2021 at 23:37, Ricardo Wurmus <rekado@elephly.net> wrote:

> 1. do you mean “share/guix” here?
>
> 2. I don’t know if this is a good idea, because the extensions really
> are in the “extensions” sub-directory.  Why would the variable refer to
> a more generic parent directory?

Let take an example, the recent Ludo’s explorer.

  <https://notabug.org/civodul/guix-explorer/>

It is easy to transform it as an extension and then use “guix explore”.


But 2 things are strict:

 - user side: GUIX_EXTENSIONS_PATH
 - extensioner side: define-module

Maybe I am wrong and I miss something.  From my understanding,

 - the file must be located at $GUIX_EXTENSIONS_PATH
 - the module must be defined as (guix extension explore)

because of:

--8<---------------cut here---------------start------------->8---
    (match (search-path (extension-directories)
                        (format #f "~a.scm" command))
[...]
       (resolve-interface `(guix extensions ,command)))))
--8<---------------cut here---------------end--------------->8---


So, taking the previous example, it would be easy to say: hey, clone
this, export GUIX_EXTENSIONS_PATH as /path/to/checkout and run “guix
explore”.  But, to work, the repo must have the structure:

 - guix-explorer
   - guix
     - extensions
       - explore.scm

because the module and in the same time $GUIX_EXTENSIONS_PATH must be
“guix-explore/guix/extensions“.  I feel something is wrong.  And I
initially proposed to append ’/guix/extensions’ by default to
GUIX_EXTENSIONS_PATH in ’extension-directories’.

I do not understand why it should be a problem.


BTW, for packages as GWL, it does not change.  It is just an agreement
between the two sides, right?


> 3. My opinion is that ~/.config/guix should not get special treatment.
> People can use different profiles for “guix pull”.

Ok, fine with me.  It is reasonable to have GUIX_EXTENSIONS_PATH defined
by user preference in their ~/.bash_profile or whatever.


> Perhaps we can invite some other people to comment on this.  I have
> become confused about what is the best way forward (which is one of the
> reasons why it took me so long to reply).

For sure!  Even if we are already on guix-devel. :-)


>> BTW, I have not tried to adapt and makes it work for extension as
>> subcommand.  I have in mind: “guix git log” or “guix system foo”.  Well,
>> these subcommands are not defined as ’define-command’ but we could take
>> this road.  WDYT?
>
> I haven’t really thought about this, but extensions for sub-commands of
> sub-commands currently only work by replacing the parent command, so
> they cannot be composed.

Indeed, it is a separated topic. :-) First, the subcommand should use
something like ’define-command’.


> We probably could add a mechanism to that (guix extensions system foo)
> would extend the “guix system” command, but this would require more work
> as the “system” command is responsible for dispatching to the
> sub-command.  I don’t know if there’s a good generic way to implement
> this.  “guix system foo” could bypass the “guix system” entry point if
> (guix extensions system foo) exists, but this may have unwanted
> consequences.

Yeah, you have right.  It needs more thoughts and discussions.


Cheers,
simon


      reply	other threads:[~2021-02-09  0:48 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-15 20:33 GUIX_EXTENSIONS_PATH error? zimoun
2021-01-15 20:45 ` Ricardo Wurmus
2021-01-15 20:55   ` zimoun
2021-01-15 22:24     ` Ricardo Wurmus
2021-01-15 22:32       ` zimoun
2021-01-15 22:42         ` Ricardo Wurmus
2021-01-15 22:58           ` zimoun
2021-01-15 23:17             ` Ricardo Wurmus
2021-01-16  1:49           ` zimoun
2021-02-01  7:41             ` GUIX_EXTENSIONS_PATH pattern zimoun
2021-02-08 22:37               ` Ricardo Wurmus
2021-02-09  0:40                 ` zimoun [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=864kimkr96.fsf@gmail.com \
    --to=zimon.toutoune@gmail.com \
    --cc=guix-devel@gnu.org \
    --cc=rekado@elephly.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.