summaryrefslogtreecommitdiff
path: root/gnu/services
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2020-08-24 14:52:39 +0200
committerLudovic Courtès <ludo@gnu.org>2020-08-24 23:23:57 +0200
commit0d203eeaa69a42a914a9981449805014ab6b7b77 (patch)
treed365e8bc9d212b3134bf0187f3425e475f9f4a8e /gnu/services
parent54a87b2a0cce10be256571a975e116cb60fb0f76 (diff)
services: unattended-upgrade: Add 'operating-system-file' field.
* gnu/services/admin.scm (<unattended-upgrade-configuration>)[operating-system-file]: New field. (unattended-upgrade-mcron-jobs): Honor it. * doc/guix.texi (Unattended Upgrades): Document it.
Diffstat (limited to 'gnu/services')
-rw-r--r--gnu/services/admin.scm9
1 files changed, 7 insertions, 2 deletions
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>
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?'.