summaryrefslogtreecommitdiff
path: root/px/services/package-management.scm
diff options
context:
space:
mode:
authorFranz Geffke <franz@pantherx.org>2023-11-06 20:08:14 +0000
committerFranz Geffke <franz@pantherx.org>2023-11-06 20:08:14 +0000
commit47b4c9c854915df93893dbaa993accfacf9027fe (patch)
tree4f9b1742d63fcfbc94cc6b8d84f76c4d00c3a0b7 /px/services/package-management.scm
parent0b426d7b7ed8e176bf464ef9e0683f74a6c9d20f (diff)
rewrite: apply guix-reference formatting; cleanup some module imports
Diffstat (limited to 'px/services/package-management.scm')
-rw-r--r--px/services/package-management.scm71
1 files changed, 39 insertions, 32 deletions
diff --git a/px/services/package-management.scm b/px/services/package-management.scm
index d393d2d..1550826 100644
--- a/px/services/package-management.scm
+++ b/px/services/package-management.scm
@@ -15,50 +15,57 @@
;;
(define-record-type* <px-unattended-upgrades-configuration>
- px-unattended-upgrades-configuration make-px-unattended-upgrades-configuration
+ px-unattended-upgrades-configuration
+ make-px-unattended-upgrades-configuration
px-unattended-upgrades-configuration?
- (package px-unattended-upgrades-configuration-package
- (default px-unattended-upgrades))
+ (package
+ px-unattended-upgrades-configuration-package
+ (default px-unattended-upgrades))
(timeout px-unattended-upgrades-timeout
(default 300)))
-
(define (px-unattended-upgrades-configuration->script config)
(match config
(($ <px-unattended-upgrades-configuration> package timeout)
- (computed-file
- "px-unattended-upgrades.sh"
- #~(begin
- (call-with-output-file #$output
- (lambda (port)
- (display "# AUTO GENERATED BY: px-unattended-upgrades-shepherd-service\n\n" port)
- (display "echo \"$(date) > service started: \"\n" port)
- (format port "echo \"$(date) > sleep for: ~a\"\n" #$timeout)
- (format port "sleep ~a\n" #$timeout)
- (display "echo \"$(date) > start upgrade\"\n" port)
- (format port "~a/bin/px-unattended-upgrades\n" #$package))))))))
+ (computed-file "px-unattended-upgrades.sh"
+ #~(begin
+ (call-with-output-file #$output
+ (lambda (port)
+ (display
+ "# AUTO GENERATED BY: px-unattended-upgrades-shepherd-service
+"
+ port)
+ (display "echo \"$(date) > service started: \"\n"
+ port)
+ (format port "echo \"$(date) > sleep for: ~a\"\n"
+ #$timeout)
+ (format port "sleep ~a\n"
+ #$timeout)
+ (display "echo \"$(date) > start upgrade\"\n" port)
+ (format port "~a/bin/px-unattended-upgrades\n"
+ #$package))))))))
(define (px-unattended-upgrades-shepherd-service config)
(match config
(($ <px-unattended-upgrades-configuration> package timeout)
(let ((script (px-unattended-upgrades-configuration->script config)))
- (list (shepherd-service
- (provision '(px-unattended-upgrades))
- (documentation "Run px-unattended-upgrades once after reboot")
- (requirement '(networking user-processes))
- (one-shot? #t)
- (start #~(make-forkexec-constructor
- (list (string-append #$bash "/bin/bash")
- #$script)
- #:log-file "/var/log/px-unattended-upgrades.log"))
- (stop #~(make-kill-destructor))))))))
-
+ (list (shepherd-service (provision '(px-unattended-upgrades))
+ (documentation
+ "Run px-unattended-upgrades once after reboot")
+ (requirement '(networking user-processes))
+ (one-shot? #t)
+ (start #~(make-forkexec-constructor (list (string-append #$bash
+ "/bin/bash")
+ #$script)
+ #:log-file
+ "/var/log/px-unattended-upgrades.log"))
+ (stop #~(make-kill-destructor))))))))
(define px-unattended-upgrades-service-type
- (service-type
- (name 'px-unattended-upgrades)
- (description "PantherX unattended upgrades service")
- (extensions (list (service-extension shepherd-root-service-type
- px-unattended-upgrades-shepherd-service)))
- (default-value (px-unattended-upgrades-configuration))))
+ (service-type (name 'px-unattended-upgrades)
+ (description "PantherX unattended upgrades service")
+ (extensions (list (service-extension
+ shepherd-root-service-type
+ px-unattended-upgrades-shepherd-service)))
+ (default-value (px-unattended-upgrades-configuration))))