From 0d203eeaa69a42a914a9981449805014ab6b7b77 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 24 Aug 2020 14:52:39 +0200 Subject: services: unattended-upgrade: Add 'operating-system-file' field. * gnu/services/admin.scm ()[operating-system-file]: New field. (unattended-upgrade-mcron-jobs): Honor it. * doc/guix.texi (Unattended Upgrades): Document it. --- gnu/services/admin.scm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'gnu') diff --git a/gnu/services/admin.scm b/gnu/services/admin.scm index 6ed3de9423..61bc17b2fe 100644 --- a/gnu/services/admin.scm +++ b/gnu/services/admin.scm @@ -49,6 +49,7 @@ unattended-upgrade-service-type unattended-upgrade-configuration unattended-upgrade-configuration? + unattended-upgrade-configuration-operating-system-file unattended-upgrade-configuration-channels unattended-upgrade-configuration-schedule unattended-upgrade-configuration-services-to-restart @@ -198,6 +199,8 @@ Old log files are removed or compressed according to the configuration.") (define-record-type* unattended-upgrade-configuration make-unattended-upgrade-configuration unattended-upgrade-configuration? + (operating-system-file unattended-upgrade-operating-system-file + (default "/run/current-system/configuration.scm")) (schedule unattended-upgrade-configuration-schedule (default "30 01 * * 0")) (channels unattended-upgrade-configuration-channels @@ -228,6 +231,9 @@ Old log files are removed or compressed according to the configuration.") (define expiration (unattended-upgrade-system-expiration config)) + (define config-file + (unattended-upgrade-operating-system-file config)) + (define code (with-imported-modules (source-module-closure '((guix build utils) (gnu services herd))) @@ -271,8 +277,7 @@ Old log files are removed or compressed according to the configuration.") (report-invoke-error c))) (invoke #$(file-append guix "/bin/guix") "time-machine" "-C" #$channels - "--" "system" "reconfigure" - "/run/current-system/configuration.scm") + "--" "system" "reconfigure" #$config-file) ;; 'guix system delete-generations' fails when there's no ;; matching generation. Thus, catch 'invoke-error?'. -- cgit 1.4.1