diff --git a/channels.scm b/channels.scm index d37ae87..bef641f 100644 --- a/channels.scm +++ b/channels.scm @@ -11,9 +11,17 @@ #:use-module (guix channels) #:use-module ((ice-9 ftw) #:select (scandir))) +;; ./channels.d only resolves when the process's CWD happens to be this +;; file's own directory, which isn't true once guix pull loads this as a +;; plain module (e.g. from the store) to build its package cache -- anchor +;; to this file's own location instead. +(define here (dirname (current-filename))) + +(define channels-directory (string-append here "/channels.d")) + (define channel-files - (scandir "./channels.d" + (scandir channels-directory (lambda (file) (string-suffix? ".scm" file)))) -(append (map (lambda (file) (load (string-append "./channels.d/" file))) channel-files) %default-channels) +(append (map (lambda (file) (load (string-append channels-directory "/" file))) channel-files) %default-channels)