diff --git a/channels.d/metznet.scm b/channels.d/metznet.scm index 9bcd3b0..6d5d313 100644 --- a/channels.d/metznet.scm +++ b/channels.d/metznet.scm @@ -1,5 +1,6 @@ -;; See channels.scm for why this needs an explicit import. -(use-modules (guix channels)) +;; See channels.scm for why this needs a real define-module. +(define-module (channels.d metznet) + #:use-module (guix channels)) (channel (name 'metznet-channel) diff --git a/channels.d/nonguix.scm b/channels.d/nonguix.scm index 95520f5..108d749 100644 --- a/channels.d/nonguix.scm +++ b/channels.d/nonguix.scm @@ -1,5 +1,6 @@ -;; See channels.scm for why this needs an explicit import. -(use-modules (guix channels)) +;; See channels.scm for why this needs a real define-module. +(define-module (channels.d nonguix) + #:use-module (guix channels)) (channel (name 'nonguix) diff --git a/channels.d/nonguixgames.scm b/channels.d/nonguixgames.scm index ce1c6ba..544b787 100644 --- a/channels.d/nonguixgames.scm +++ b/channels.d/nonguixgames.scm @@ -1,5 +1,6 @@ -;; See channels.scm for why this needs an explicit import. -(use-modules (guix channels)) +;; See channels.scm for why this needs a real define-module. +(define-module (channels.d nonguixgames) + #:use-module (guix channels)) (channel (name 'guix-gaming-games) diff --git a/channels.scm b/channels.scm index 47e82ff..d37ae87 100644 --- a/channels.scm +++ b/channels.scm @@ -1,14 +1,15 @@ ;; channels.scm -- reads the channels.d dir to get a list of channel objects - -;; guix pull -C pre-imports (guix channels) into the file's environment -;; (see load-channels/make-user-module in guix/scripts/pull.scm), which is -;; why this worked without an explicit import. But `guix pull` also -;; compiles every .scm file under this channel's own checkout as an -;; ordinary package module (see standard-module-derivation), and that -;; environment does NOT pre-import it -- so `channel` (a macro from (guix -;; channels), used in channels.d/*.scm) and %default-channels come up -;; unbound there unless imported explicitly. -(use-modules (gnu) (guix channels) ((ice-9 ftw) #:select (scandir))) +;; +;; `guix pull` also compiles every .scm file under this channel's own +;; checkout as an ordinary package module (see standard-module-derivation) +;; and then loads each by its path-derived module name (e.g. this file as +;; (channels)) to build the package cache -- so, like metznet/machines/*.scm, +;; this needs a real define-module matching its path, not just a bare +;; script relying on guix pull -C's implicit (guix channels) import. +(define-module (channels) + #:use-module (gnu) + #:use-module (guix channels) + #:use-module ((ice-9 ftw) #:select (scandir))) (define channel-files (scandir "./channels.d"