mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2025-01-12 06:06:53 -05:00
pull: Honor '/etc/guix/channels.scm'.
* guix/scripts/pull.scm (channel-list)[global-file]: New variable. [channels]: Honor it. * doc/guix.texi (Invoking guix pull): Document it.
This commit is contained in:
parent
b74ed90916
commit
49af34cfac
2 changed files with 22 additions and 1 deletions
|
@ -3666,6 +3666,21 @@ descriptions, and deploys it. Source code is downloaded from a
|
|||
@uref{https://git-scm.com, Git} repository, by default the official
|
||||
GNU@tie{}Guix repository, though this can be customized.
|
||||
|
||||
Specifically, @command{guix pull} downloads code from the @dfn{channels}
|
||||
(@pxref{Channels}) specified by one of the followings, in this order:
|
||||
|
||||
@enumerate
|
||||
@item
|
||||
the @option{--channels} option;
|
||||
@item
|
||||
the user's @file{~/.config/guix/channels.scm} file;
|
||||
@item
|
||||
the system-wide @file{/etc/guix/channels.scm} file;
|
||||
@item
|
||||
the built-in default channels specified in the @code{%default-channels}
|
||||
variable.
|
||||
@end enumerate
|
||||
|
||||
On completion, @command{guix package} will use packages and package
|
||||
versions from this just-retrieved copy of Guix. Not only that, but all
|
||||
the Guix commands and Scheme modules will also be taken from that latest
|
||||
|
@ -3763,7 +3778,8 @@ configuration in the @file{~/.config/guix/channels.scm} file or using the
|
|||
@item --channels=@var{file}
|
||||
@itemx -C @var{file}
|
||||
Read the list of channels from @var{file} instead of
|
||||
@file{~/.config/guix/channels.scm}. @var{file} must contain Scheme code that
|
||||
@file{~/.config/guix/channels.scm} or @file{/etc/guix/channels.scm}.
|
||||
@var{file} must contain Scheme code that
|
||||
evaluates to a list of channel objects. @xref{Channels}, for more
|
||||
information.
|
||||
|
||||
|
|
|
@ -714,6 +714,9 @@ (define file
|
|||
(define default-file
|
||||
(string-append (config-directory) "/channels.scm"))
|
||||
|
||||
(define global-file
|
||||
(string-append %sysconfdir "/guix/channels.scm"))
|
||||
|
||||
(define (load-channels file)
|
||||
(let ((result (load* file (make-user-module '((guix channels))))))
|
||||
(if (and (list? result) (every channel? result))
|
||||
|
@ -725,6 +728,8 @@ (define channels
|
|||
(load-channels file))
|
||||
((file-exists? default-file)
|
||||
(load-channels default-file))
|
||||
((file-exists? global-file)
|
||||
(load-channels global-file))
|
||||
(else
|
||||
%default-channels)))
|
||||
|
||||
|
|
Loading…
Reference in a new issue