guix-devel
[Top][All Lists]
Advanced

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

Re: GUIX_EXTENSIONS_PATH error?


From: zimoun
Subject: Re: GUIX_EXTENSIONS_PATH error?
Date: Sat, 16 Jan 2021 02:49:40 +0100

Hi Ricardo,

About the precedence, i.e., extension that overrides default command,
see patch#45910.

<http://issues.guix.gnu.org/45910>


On Fri, 15 Jan 2021 at 23:42, Ricardo Wurmus <rekado@elephly.net> wrote:
> zimoun <zimon.toutoune@gmail.com> writes:

> We can change this, but we’d need to agree on an as yet unused directory
> as the root for extensions.

I do not know, maybe I will change my mind after a good ol’ black
coffee. :-)

We could say that:

 1. the prototype of GUIX_EXTENSIONS_PATH is path/to/guix
 2. the folder /extensions is implicitly appended 
 3. ~/.config/guix is implicitly appended

The patch attached does that.  But, the definition of the package ’guix’
needs to be tweaked (not done) in agreement, especially:

--8<---------------cut here---------------start------------->8---
      (native-search-paths
       (list (search-path-specification
              (variable "GUIX_EXTENSIONS_PATH")
              (files '("share/guix/extensions")))))
--8<---------------cut here---------------end--------------->8---


>> Moreover, it could nice to have GUIX_EXTENSIONS_PATH look by default
>> in ~/.config/guix/extensions, i.e., by default
>> GUIX_EXTENSIONS_PATH=~/.config.
>
> The last part of this sentence is what I meant above: we need to avoid
> that, because that would cause
> ~/.config/guix/current/share/guile/site/3.0/guix/scripts/ to be included
> in the search for extensions.

It is easy to filter out by adding rules in ’extensions-directories’. :-)

> I have added a search path specification to the “guix” package itself,
> so that it will set GUIX_EXTENSIONS_PATH to
> $profile/share/guix/extensions automatically.  The idea is to update the
> format of the “channels.scm” file to allow for the installation of extra
> packages into the “guix pull” profile (by default that’s
> ~/.config/guix/current).

I see.  Well, I need to fail myself to really understand…

> This way I could say that I want the freshly pulled Guix to also install
> the “gwl” package in the same profile, and that new Guix would
> automatically have the “gwl” extension’s “workflow” sub-command.

I agree.


Cheers,
simon
--

diff --git a/guix/ui.scm b/guix/ui.scm
index ad78d5cedd..e918b5b64f 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -2066,8 +2066,10 @@ contain a 'define-command' form."
 (define (extension-directories)
   "Return the list of directories containing Guix extensions."
   (filter file-exists?
-          (parse-path
-           (getenv "GUIX_EXTENSIONS_PATH"))))
+          (map (cut string-append <> "/extensions")
+               (parse-path
+                (string-append (config-directory) ":"
+                 (getenv "GUIX_EXTENSIONS_PATH"))))))
 
 (define (commands)
   "Return the list of commands, alphabetically sorted."

reply via email to

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