Hi guixers! I'm in need of some assistance to fix my unattended-upgrades
service. I have a modular configuration, and I have tried to use the
following service definition:


       (service unattended-upgrade-service-type
                (unattended-upgrade-configuration
                 (schedule "0 1 * * 0")
                 (reboot? #t)
                 (operating-system-expression
                  (with-imported-modules
                      (source-module-closure
                       '((systems latitude-7420-system)))
                    #~(begin
                        (use-modules (systems latitude-7420-system))
                        latitude-7420-os)))
                 (system-expiration (* 60 24 3600))))

Error:

      2026-05-20 19:11:00 guix system: error: failed to evaluate expression 
'(begin (use-modules (systems latitude-7420-system)) latitude-7420-os)':

The code:

#!/gnu/store/aqpggy9i24nnx39d8ysxsms6zv4icnm5-guile-3.0.9/bin/guile
--no-auto-compile !# (eval-when (expand load eval) (let ((extensions
(quote ())) (prepend (lambda (items lst) (let loop ((items items) (lst
lst)) (if (null? items) lst (loop (cdr items) (cons (car items) (delete
(car items) lst)))))))) (set! %load-path (prepend (cons
"/gnu/store/4aagxvcz2ajyawrsg3pmfwaz5gbjyg3g-module-import" (map (lambda
(extension) (string-append extension "/share/guile/site/"
(effective-version))) extensions)) %load-path)) (set!
%load-compiled-path (prepend (cons
"/gnu/store/d19il8by3c9mqmphvfdjkga5q3nxcbkd-module-import-compiled"
(map (lambda (extension) (string-append extension "/lib/guile/"
(effective-version) "/site-ccache")) extensions))
%load-compiled-path))))(begin (use-modules (guix build utils) (gnu
services herd) (srfi srfi-34)) (setvbuf (current-output-port) (quote
line)) (setvbuf (current-error-port) (quote line)) (setenv
"SSL_CERT_DIR"
"/gnu/store/v9i76lmhx0rlq46wyypv62wh2s3igqcf-nss-certs-3.101.4/etc/ssl/certs")
(format #t "starting upgrade...~%") (guard (c ((invoke-error? c)
(report-invoke-error c) (exit 1))) (apply invoke
"/gnu/store/0wz0y0aqidg9dr4kn51w1r6aypsc21l8-guix-1.5.0-2.520785e/bin/guix"
"time-machine" "-C"
"/gnu/store/42r8shqrfbkna7qxhiqfjschgkxw5lrp-channels.scm" "--" "system"
"reconfigure" (list "-e" (object->string (quote (begin (use-modules
(systems latitude-7420-system)) latitude-7420-os))))) (guard (c
((invoke-error? c) (report-invoke-error c))) (invoke
"/gnu/store/0wz0y0aqidg9dr4kn51w1r6aypsc21l8-guix-1.5.0-2.520785e/bin/guix"
"system" "delete-generations" "5184000s")) (unless #t (format #t
"restarting services...~%") (for-each restart-service (quote
(unattended-upgrade)))) (format #t "upgrade complete~%") (when #t
(format #t "rebooting system~%") (force-output) (stop-service (quote
root)))))


I am using operating-system-expression because my configuration is also
a channel.

The module (systems latitude-7420-system) has the variable
latitude-7420-os in it, which is an operating system. This OS variable
also inherits from others OSs: one in (systems laptop-system)... and
that OS inherits from (systems base-system). These modules appear to be
imported correctly with #:use-module in there respective files.

I have read the section in the manual on unattended-upgrades, and tried
both the operating-system-file suggestion for a modular config, and the
OS expression alternative, neither worked for me.

I can reconfigure my OS using the modular config without issue.

Any tips?


--
John T. Haman
[email protected]

Reply via email to