help-guix
[Top][All Lists]
Advanced

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

Re: adding custom package to guix home


From: Dominic Martinez
Subject: Re: adding custom package to guix home
Date: Sun, 26 Jun 2022 16:10:13 -0400
User-agent: mu4e 1.6.11; emacs 28.1.50

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: signature.asc
Description: PGP signature


reply via email to

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