#:modules and #:imported-modules are distinct arguments. #:modules is the
modules that your builder is going to use (as in "they go in a (use-modules
...) form"), while #:imported-modules is the modules that need to be available
in the build environment. It's complaining at build-time that it can't find that
module to use, because you haven't told it to include that module in the build
environment. #:imported-modules should give a superset of what #:modules gives,
especially if a module in use is going to have indirect
requirements. Thankfully, wrangling together those indirect requirements is
already implemented in (guix modules) as source-module-closure.
Thus, you could conceptually do
(arguments
`(#:imported-modules (,@(source-module-closure
'((gnu packages jami)
,@%gnu-build-system-modules)))
#:modules ((gnu packages jami)
,@(@@ (guix build-system gnu) %default-modules))))
And in theory it would work. Note, though, that this would pull in the entire
module dependency graph of (gnu packages jami), and this may include things that
source-module-closure would have a hard time detecting and aren't really
needed. Ideally this procedure would be generalized and put in (guix build
<something>), but I can understand if that's not possible. Note also that you
could simply splice in the definition of your procedure into the builder
manually, like so:
(define my-procedure-code '(lambda (a b c) ...))
(arguments
`(#:phases (let ((my-procedure ,my-procedure-code)) (modify-phases ...))))
Hope that helps, thanks for the work on Jami y'all!