unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* adding custom package to guix home
@ 2022-06-26 19:12 rdes via
  2022-06-26 20:10 ` Dominic Martinez
  0 siblings, 1 reply; 3+ messages in thread
From: rdes via @ 2022-06-26 19:12 UTC (permalink / raw)
  To: help-guix@gnu.org

Hello,

I'm trying to add emacs-svg to my package list in my guix home configuration, but I'm getting "no code for module (emacs-svg)" error when using use-module​ and "guix home: error: emacs-svg: unknown package" error when I include the package definition in the guix home configuration file.

I've added my configuration files my snippets: <https://gitlab.com/-/snippets/2360492>.

Thanks,
Ryan Desfosses

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: adding custom package to guix home
  2022-06-26 19:12 adding custom package to guix home rdes via
@ 2022-06-26 20:10 ` Dominic Martinez
  2022-06-26 23:13   ` rdes
  0 siblings, 1 reply; 3+ messages in thread
From: Dominic Martinez @ 2022-06-26 20:10 UTC (permalink / raw)
  To: rdes; +Cc: help-guix

[-- Attachment #1: Type: text/plain, Size: 1582 bytes --]


rdes via <help-guix@gnu.org> writes:

> Hello,
>
> I'm trying to add emacs-svg to my package list in my guix home configuration,
> but I'm getting "no code for module (emacs-svg)" error when using use-module​ and
> "guix home: error: emacs-svg: unknown package" error when I include the package
> definition in the guix home configuration file.
>
> I've added my configuration files my snippets: <https://gitlab.com/-/snippets/2360492>.

There's two separate problems here: trying to use 'emacs-svg' as a
specification, and Guile module loading.

`specification->package' turns a specification (what you type into 'guix
install') into a package (the actual variable that contains the
package). However, it only works on packages that are part of your Guix
installation. Instead, you should directly add the variable you defined
to the packages list:

#+begin_src scheme
(home-environment
  (packages
    (cons*
      emacs-svg
      (map specification->package...))))
#+end_src

As for why `#:use-module (emacs-svg)' didn't work, I'm assuming you
didn't augment Guile's load path. You can augment the load path either
through an environment variable, or for a specific Guix command via the
command line:

#+begin_src shell
GUILE_LOAD_PATH=$GUILE_LOAD_PATH:path/to/module/dir guix ...
# or
guix -L path/to/module/dir ...
#+end_src

You also shouldn't put `emacs-svg' as the last line in your module. That
pattern is useful when developing a package (e.g. with a 'guix.scm' file
in your repo), but modules should not evaluate to a value.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 227 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: adding custom package to guix home
  2022-06-26 20:10 ` Dominic Martinez
@ 2022-06-26 23:13   ` rdes
  0 siblings, 0 replies; 3+ messages in thread
From: rdes @ 2022-06-26 23:13 UTC (permalink / raw)
  To: Dominic Martinez; +Cc: help-guix

Thank you Mr. Martinez,

I appreciate you taking the time to explain this to me.  Your recommendations resolved my issues.

- Ryan




Sent with Proton Mail secure email.

------- Original Message -------
On Sunday, June 26th, 2022 at 4:10 PM, Dominic Martinez <dom@dominicm.dev> wrote:


> rdes via help-guix@gnu.org writes:
>
> > Hello,
> >
> > I'm trying to add emacs-svg to my package list in my guix home configuration,
> > but I'm getting "no code for module (emacs-svg)" error when using use-module and
> > "guix home: error: emacs-svg: unknown package" error when I include the package
> > definition in the guix home configuration file.
> >
> > I've added my configuration files my snippets: https://gitlab.com/-/snippets/2360492.
>
>
> There's two separate problems here: trying to use 'emacs-svg' as a
> specification, and Guile module loading.
>
> `specification->package' turns a specification (what you type into 'guix
>
> install') into a package (the actual variable that contains the
> package). However, it only works on packages that are part of your Guix
> installation. Instead, you should directly add the variable you defined
> to the packages list:
>
> #+begin_src scheme
> (home-environment
> (packages
> (cons*
> emacs-svg
> (map specification->package...))))
>
> #+end_src
>
> As for why `#:use-module (emacs-svg)' didn't work, I'm assuming you didn't augment Guile's load path. You can augment the load path either through an environment variable, or for a specific Guix command via the command line: #+begin_src shell GUILE_LOAD_PATH=$GUILE_LOAD_PATH:path/to/module/dir guix ... # or guix -L path/to/module/dir ... #+end_src You also shouldn't put` emacs-svg' as the last line in your module. That
> pattern is useful when developing a package (e.g. with a 'guix.scm' file
> in your repo), but modules should not evaluate to a value.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-06-26 23:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-26 19:12 adding custom package to guix home rdes via
2022-06-26 20:10 ` Dominic Martinez
2022-06-26 23:13   ` rdes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).