[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
10/13: doc: cookbook: Remove outdated section about GUIX_PACKAGE_PATH.
From: |
guix-commits |
Subject: |
10/13: doc: cookbook: Remove outdated section about GUIX_PACKAGE_PATH. |
Date: |
Sat, 6 May 2023 12:21:18 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit 86bf0c5a3f31fad0b1af68ecfa803a49173e003e
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Sat May 6 18:01:16 2023 +0200
doc: cookbook: Remove outdated section about GUIX_PACKAGE_PATH.
The section insisted on GUIX_PACKAGE_PATH, mentioned version 0.16, and
didn't say much about channels, which made it look obsolete.
* doc/guix-cookbook.texi (GUIX_PACKAGE_PATH): Remove section.
(Guix channels): Rename to...
(Channels): ... this. Merge most of the explanations previously in the
GUIX_PACKAGE_PATH section. Say more about channels and add
cross-references.
---
doc/guix-cookbook.texi | 83 ++++++++++++++++++++++++++++++++------------------
1 file changed, 53 insertions(+), 30 deletions(-)
diff --git a/doc/guix-cookbook.texi b/doc/guix-cookbook.texi
index b9fb916f4a..2aae5a4871 100644
--- a/doc/guix-cookbook.texi
+++ b/doc/guix-cookbook.texi
@@ -628,30 +628,25 @@ The @code{use-modules} expression tells which of the
modules we need in the file
Modules are a collection of values and procedures. They are commonly called
``libraries'' or ``packages'' in other programming languages.
-@node @samp{GUIX_PACKAGE_PATH}
-@subsubsection @samp{GUIX_PACKAGE_PATH}
+@node Channels
+@subsubsection Channels
-@emph{Note: Starting from Guix 0.16, the more flexible Guix @dfn{channels} are
the
-preferred way and supersede @samp{GUIX_PACKAGE_PATH}. See next section.}
+@cindex channel
+Guix and its package collection can be extended through @dfn{channels}.
+A channel is a Git repository, public or not, containing @file{.scm}
+files that provide packages (@pxref{Defining Packages,,, guix, GNU Guix
+Reference Manual}) or services (@pxref{Defining Services,,, guix, GNU
+Guix Reference Manual}).
-It can be tedious to specify the file from the command line instead of simply
-calling @code{guix package --install my-hello} as you would do with the
official
-packages.
-
-Guix makes it possible to streamline the process by adding as many ``package
-declaration directories'' as you want.
-
-Create a directory, say @file{~/guix-packages} and add it to the
@samp{GUIX_PACKAGE_PATH}
-environment variable:
+How would you go about creating a channel? First, create a directory
+that will contain your @file{.scm} files, say @file{~/my-channel}:
@example
-$ mkdir ~/guix-packages
-$ export GUIX_PACKAGE_PATH=~/guix-packages
+mkdir ~/my-channel
@end example
-To add several directories, separate them with a colon (@code{:}).
-
-Our previous @samp{my-hello} needs some adjustments though:
+Suppose you want to add the @samp{my-hello} package we saw previously;
+it first needs some adjustments:
@lisp
(define-module (my-hello)
@@ -692,9 +687,9 @@ package. If you want to use @code{define-public} in this
use-case nonetheless,
sure the file ends with an evaluation of @code{my-hello}:
@lisp
-; ...
+;; ...
(define-public my-hello
- ; ...
+ ;; ...
)
my-hello
@@ -702,22 +697,50 @@ my-hello
This last example is not very typical.
-Now @samp{my-hello} should be part of the package collection like all other
official
-packages. You can verify this with:
+Now how do you make that package visible to @command{guix} commands so
+you can test your packages? You need to add the directory to the search
+path using the @option{-L} command-line option, as in these examples:
+
+@example
+guix show -L ~/my-channel my-hello
+guix build -L ~/my-channel my-hello
+@end example
+
+The final step is to turn @file{~/my-channel} into an actual channel,
+making your package collection seamlessly available @i{via} any
+@command{guix} command. To do that, you first need to make it a Git
+repository:
@example
-$ guix package --show=my-hello
+cd ~/my-channel
+git init
+git add my-hello.scm
+git commit -m "First commit of my channel."
@end example
-@node Guix channels
-@subsubsection Guix channels
+And that's it, you have a channel! From there on, you can add this
+channel to your channel configuration in
+@file{~/.config/guix/channels.scm} (@pxref{Specifying Additional
+Channels,,, guix, GNU Guix Reference Manual}); assuming you keep your
+channel local for now, the @file{channels.scm} would look something like
+this:
+
+@lisp
+(append (list (channel
+ (name 'my-channel)
+ (url (string-append "file://" (getenv "HOME")
+ "/my-channel"))))
+ %default-channels)
+@end lisp
-Guix 0.16 features channels, which is very similar to @samp{GUIX_PACKAGE_PATH}
but
-provides better integration and provenance tracking. Channels are not
-necessarily local, they can be maintained as a public Git repository for
-instance. Of course, several channels can be used at the same time.
+Next time you run @command{guix pull}, your channel will be picked up
+and the packages it defines will be readily available to all the
+@command{guix} commands, even if you do not pass @option{-L}. The
+@command{guix describe} command will show that Guix is, indeed, using
+both the @code{my-channel} and the @code{guix} channels.
-@xref{Channels,,, guix, GNU Guix Reference Manual} for setup details.
+@xref{Creating a Channel,,, guix, GNU Guix Reference Manual}, for
+details.
@node Direct checkout hacking
@subsubsection Direct checkout hacking
- branch master updated (1cb0dee3a3 -> c625e5b64d), guix-commits, 2023/05/06
- 01/13: tests: Add missing module imports for marionette-evaluated code., guix-commits, 2023/05/06
- 04/13: gnu: python-ldap: Update to 3.4.3., guix-commits, 2023/05/06
- 10/13: doc: cookbook: Remove outdated section about GUIX_PACKAGE_PATH.,
guix-commits <=
- 02/13: services: dbus-service, secret-service: Do not cause (fibers) to be loaded., guix-commits, 2023/05/06
- 03/13: gnu: mod-wsgi: Update to 4.9.4., guix-commits, 2023/05/06
- 09/13: gnu: glances: Update to 3.3.1.1., guix-commits, 2023/05/06
- 06/13: lint: archival: Warn against non-origin package sources., guix-commits, 2023/05/06
- 05/13: gnu: gitile: Fix build., guix-commits, 2023/05/06
- 11/13: gnu: hostapd: Add ACS and full dynamic vlan support, guix-commits, 2023/05/06
- 07/13: gnu: msmtp: Install old msmtpqueue scripts, guix-commits, 2023/05/06
- 12/13: doc: Use G-Expressions for package definition example., guix-commits, 2023/05/06
- 08/13: gnu: python-ujson: Update to 5.7.0., guix-commits, 2023/05/06
- 13/13: download: Refer to the 'guile-gnutls' package and not 'gnutls'., guix-commits, 2023/05/06