unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Dominic Martinez <dom@dominicm.dev>
To: rdes <rdes@proton.me>
Cc: help-guix@gnu.org
Subject: Re: adding custom package to guix home
Date: Sun, 26 Jun 2022 16:10:13 -0400	[thread overview]
Message-ID: <87v8snb1xe.fsf@dominicm.dev> (raw)
In-Reply-To: <Uwbenf2PdMgcwpPGBza5v63p87xVSi_JGWNHBhK3f5eV1YEdwW6ChfcaFTj8NxWquDoRd_DfFJB1hY1SYN-JhMN5lf22Z4Ira39RiwuVQQM=@proton.me>

[-- 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 --]

  reply	other threads:[~2022-06-26 20:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-26 19:12 adding custom package to guix home rdes via
2022-06-26 20:10 ` Dominic Martinez [this message]
2022-06-26 23:13   ` rdes

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

  List information: https://guix.gnu.org/

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

  git send-email \
    --in-reply-to=87v8snb1xe.fsf@dominicm.dev \
    --to=dom@dominicm.dev \
    --cc=help-guix@gnu.org \
    --cc=rdes@proton.me \
    /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.
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).