unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Chris Marusich <cmmarusich@gmail.com>
To: Ricardo Wurmus <rekado@elephly.net>
Cc: help-guix <help-guix@gnu.org>
Subject: Re: Real-world example for channels?
Date: Sun, 27 Jan 2019 16:46:13 -0800	[thread overview]
Message-ID: <87r2cxa9t6.fsf@gmail.com> (raw)
In-Reply-To: <87munnt45x.fsf@elephly.net> (Ricardo Wurmus's message of "Sun, 27 Jan 2019 00:00:58 +0100")


[-- Attachment #1.1: Type: text/plain, Size: 1194 bytes --]

Ricardo Wurmus <rekado@elephly.net> writes:

> No files are expected to be included.  You only include files that you
> want to offer.  There is no prescribed file layout, nor is there any
> naming convention.
>
> You #:use-module these modules like any other module.
>
> If the repository contains a file “foo.scm” which starts with
> “(define-module (foo) …)”, then you can “#:use-module (foo)” after the
> repository has been added as a channel.
>
> I suggest putting modules in separate namespaces.  All modules provided
> by “guix-bimsb”, for example, are in the “bimsb” namespace.

I agree with Hartmut.  I also found this confusing.  I've attached a
patch to try clarifying it.  What do you think?

If the Guix manual had told me that the repository's root directory will
basically be added to the Guile load path, I would have understood the
expected file structure immediately.  The Guile manual clearly describes
the requirements for making modules available via the load path.

Maybe the existing text was clear enough for some.  I read it but still
wasn't sure exactly how Guix expected me to lay out my channel's files.

-- 
Chris

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-doc-Clarify-channel-file-structure.patch --]
[-- Type: text/x-patch, Size: 2012 bytes --]

From d382cbddd11e86bd9b69f271782d2dccba180a05 Mon Sep 17 00:00:00 2001
From: Chris Marusich <cmmarusich@gmail.com>
Date: Sun, 27 Jan 2019 16:29:30 -0800
Subject: [PATCH] doc: Clarify channel file structure.

Suggested by Hartmut Goebel <h.goebel@crazy-compilers.com>.

* doc/guix.texi (Channels): Clarify how a channel author should structure the
files in their channel's Git repository.
---
 doc/guix.texi | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 22fc03b8f..5499ebf5b 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -3691,10 +3691,20 @@ share your improvements, which are basic tenets of
 email us at @email{guix-devel@@gnu.org} if you'd like to discuss this.
 @end quotation
 
-Once you have a Git repository containing your own package modules, you can
-write @code{~/.config/guix/channels.scm} to instruct @command{guix pull} to
-pull from your personal channel @emph{in addition} to the default Guix
-channel(s):
+To create a channel, create a Git repository containing your own package
+modules and make it available.  The repository can contain anything, but a
+useful channel will contain Guile modules that export packages.  Once you
+start using a channel, Guix will behave as if the root directory of that
+channel's Git repository has been added to the Guile load path (@pxref{Load
+Paths,,, guile, GNU Guile Reference Manual}).  For example, if your channel
+contains a file at @file{my-packages/my-tools.scm} that defines a Guile
+module, then the module will be available under the name @code{(my-packages
+my-tools)}, and you will be able to use it like any other module
+(@pxref{Modules,,, guile, GNU Guile Reference Manual}).
+
+To use a channel, you can write @code{~/.config/guix/channels.scm} to instruct
+@command{guix pull} to pull from your personal channel @emph{in addition} to
+the default Guix channel(s):
 
 @vindex %default-channels
 @lisp
-- 
2.20.1


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

  reply	other threads:[~2019-01-28  0:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-26 22:16 Real-world example for channels? Hartmut Goebel
2019-01-26 23:00 ` Ricardo Wurmus
2019-01-28  0:46   ` Chris Marusich [this message]
2019-01-28  6:57     ` Konrad Hinsen
2019-02-12 16:24     ` Ludovic Courtès
2019-02-13  5:41       ` Chris Marusich
2019-01-27  9:52 ` Efraim Flashner
2019-01-28  0:49 ` Chris Marusich

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=87r2cxa9t6.fsf@gmail.com \
    --to=cmmarusich@gmail.com \
    --cc=help-guix@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.
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).