Subject: bug#77558: Unattended-updates broken with personal channel

From: "Timo Wilken" <[email-masked]>
Date: Sat, 05 Apr 2025 20:48:22 +0200

Hi,

I'm using Guix' `unattended-upgrade-service-type' as follows, with my own
channel containing modules under (tw ...):
https://cgit.twilken.net/dotfiles/tree/tw/system/btl.scm?h=02bc0c28c3e438428630cc7757741f05e89358bd#n135

--8<---------------cut here
      (service unattended-upgrade-service-type
        (unattended-upgrade-configuration
         (schedule "0 21 * * *")
         (channels #~(@ (tw channels) %system-channels))
         (operating-system-expression
          #~(@ (tw system btl) %btl-system))))
--8<---------------cut here

This used to work, but now doesn't. The Shepherd timer fails with the
following messages:

--8<---------------cut here
starting upgrade...
guix time-machine: error: failed to load '/gnu/store/yqsacwns98qbaz7bz4clvbniaipq6632-channels.scm':
ice-9/boot-9.scm:4388:12: Module named (tw channels) has no public interface
command "/gnu/store/m7278cq1lq6bmspm84df7vp0zarq973b-guix-1.4.0-35.a9239a7/bin/guix" "time-machine" "-C" "/gnu/store/yqsacwns98qbaz7bz4clvbniaipq6632-channels.scm" "--" "system" "reconfigure" "-e" "(@ (tw system btl) %btl-system)" failed with status 1
--8<---------------cut here

Wrapping the g-exps as follows does not work:

--8<---------------cut here
(with-imported-modules (source-module-closure '((tw ...))) #~...)
--8<---------------cut here

...because `source-module-closure' filters out any modules that do not match
the format (gnu ...) or (guix ...). If I give a `#:select?' function to
`source-module-closure' that includes my own channel's modules (and its
dependencies'), then I get errors about Guix not being able to find patches on
`guix system reconfigure':

--8<---------------cut here
builder for `/gnu/store/2w5lm372yrbxjb98s6q2xax8fdl4dg1f-module-import-compiled.drv' failed with exit code 1
build of /gnu/store/2w5lm372yrbxjb98s6q2xax8fdl4dg1f-module-import-compiled.drv failed
View build log at '/var/log/guix/drvs/2w/5lm372yrbxjb98s6q2xax8fdl4dg1f-module-import-compiled.drv.gz'.
--8<---------------cut here

>From /var/log/guix/drvs/2w/5lm372yrbxjb98s6q2xax8fdl4dg1f-module-import-compiled.drv.gz:

--8<---------------cut here
ice-9/eval.scm:159:9: ERROR:
  1. &formatted-message:
      format: "~a: patch not found\n"
      arguments: ("icecat-makeicecat.patch")
--8<---------------cut here

So: is there a supported way in which I can use expressions from my personal
channel in `unattended-upgrade-configuration'?

Cheers,
Timo