Hilton Chain <[email protected]> writes:
> [...]
>
> Additionally, channels can specify their inputs (‘dependencies’, with the main
> Guix channel implicitly) ...
>
> [...]
>
> branch, commit, and introduction are missing for the channel itself. So
> information in .guix-channel alone is insufficient to construct the equivalent
> channels.scm.
>
> [...]
Correction:
1. The main Guix channel is an implicit dependency, but not automatically pulled
in.
2. Channel name is also missing from .guix-channel. So what's missing are name,
branch, commit and introduction.
Here's an example that can be appended to (guix channels) in Guix source tree.
The example manually gives missing information and constructs channel instances
from an URL. With channel instances available, it's ready to build a new Guix.
--8<---------------cut here---------------start------------->8---
(use-modules (ice-9 pretty-print))
(define* (channel-metadata->channels metadata #:key name url branch commit
introduction)
(cons* %default-guix-channel
(channel
(name name)
(url (or url (channel-metadata-url metadata)))
(branch branch)
(commit commit)
(introduction introduction))
(channel-metadata-dependencies metadata)))
(let* ((url "https://codeberg.org/guix-science/guix-science")
(checkout commit relation (update-cached-checkout url))
(channels
(channel-metadata->channels
(read-channel-metadata-from-source checkout)
#:name 'guix-science
#:url url
#:branch "master"
#:commit commit
#:introduction
(make-channel-introduction
"b1fe5aaff3ab48e798a4cce02f0212bc91f423dc"
(openpgp-fingerprint
"CA4F 8CF4 37D7 478F DA05 5FD4 4213 7701 1A37 8446"))))
(instances
(with-store store
(latest-channel-instances store channels))))
(pretty-print channels)
(pretty-print instances))
--8<---------------cut here---------------end--------------->8---
Run it:
--8<---------------cut here---------------start------------->8---
guix repl guix/channels.scm
--8<---------------cut here---------------end--------------->8---
Output (formatting adjusted):
--8<---------------cut here---------------start------------->8---
Updating channel 'guix' from Git repository at
'https://git.guix.gnu.org/guix.git'...
Updating channel 'guix-science' from Git repository at
'https://codeberg.org/guix-science/guix-science'...
(#<<channel> name: guix url: "https://git.guix.gnu.org/guix.git"
branch: "master"
commit: #f
introduction: #<<channel-introduction> first-signed-commit:
"9edb3f66fd807b096b48283debdcddccfea34bad"
first-commit-signer:
#vu8(187 176 45 223 44 234 246 168 13 29 230 67 162 160 109 242 163 58 84 250)>
location: ((filename . "/tmp/guix/guix/channels.scm") (line . 227)
(column . 2))>
#<<channel> name: guix-science url:
"https://codeberg.org/guix-science/guix-science"
branch: "master"
commit: "f95819b948d022ff245fcf24808b02ff7989d433"
introduction: #<<channel-introduction> first-signed-commit:
"b1fe5aaff3ab48e798a4cce02f0212bc91f423dc"
first-commit-signer:
#vu8(202 79 140 244 55 215 71 143 218 5 95 212 66 19 119 1 26 55 132 70)>
location: ((filename . "/tmp/guix/guix/channels.scm") (line .
1375) (column . 9))>)
(#<<channel-instance> channel: #<<channel> name: guix
url:
"https://git.guix.gnu.org/guix.git"
branch: "master"
commit: #f
introduction:
#<<channel-introduction> first-signed-commit:
"9edb3f66fd807b096b48283debdcddccfea34bad"
first-commit-signer: #vu8(187 176 45 223 44 234 246 168 13 29 230 67 162 160
109 242 163 58 84 250)>
location: ((filename .
"/tmp/guix/guix/channels.scm") (line . 227) (column . 2))>
commit: "a639dc9f4767b55d5a9240a76c82957533273657"
checkout:
"/gnu/store/zhfwwbi2gfqfbin45vcshrbrczd9m3hr-guix-a639dc9">
#<<channel-instance> channel: #<<channel> name: guix-science url:
"https://codeberg.org/guix-science/guix-science"
branch: "master"
commit:
"f95819b948d022ff245fcf24808b02ff7989d433"
introduction:
#<<channel-introduction> first-signed-commit:
"b1fe5aaff3ab48e798a4cce02f0212bc91f423dc"
first-commit-signer: #vu8(202 79 140 244 55 215 71 143 218 5 95 212 66 19 119
1 26 55 132 70)>
location: ((filename .
"/tmp/guix/guix/channels.scm") (line . 1375) (column . 9))>
commit: "f95819b948d022ff245fcf24808b02ff7989d433"
checkout:
"/gnu/store/86fdq0l3y2kalaxgaln0qjyc3j3cd8cq-guix-science-f95819b">)
--8<---------------cut here---------------end--------------->8---