summaryrefslogtreecommitdiff
path: root/px/services/ntp.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/ntp.scm
parent0b426d7b7ed8e176bf464ef9e0683f74a6c9d20f (diff)
rewrite: apply guix-reference formatting; cleanup some module imports
Diffstat (limited to 'px/services/ntp.scm')
-rw-r--r--px/services/ntp.scm65
1 files changed, 34 insertions, 31 deletions
diff --git a/px/services/ntp.scm b/px/services/ntp.scm
index bbba3c6..fd5bc24 100644
--- a/px/services/ntp.scm
+++ b/px/services/ntp.scm
@@ -15,21 +15,22 @@
#:use-module (ice-9 pretty-print)
#:use-module (srfi srfi-1)
- #:export (chrony-service-configuration
- chrony-service-type))
+ #:export (chrony-service-configuration chrony-service-type))
;;
;; Chrony SERVICE
;;
(define-record-type* <chrony-service-configuration>
- chrony-service-configuration make-chrony-service-configuration
+ chrony-service-configuration
+ make-chrony-service-configuration
chrony-service-configuration?
- (package chrony-service-configuration-package
- (default chrony))
- (user chrony-service-configuration-user
- (default "root"))
- (config chrony-service-configuration-config
+ (package
+ chrony-service-configuration-package
+ (default chrony))
+ (user chrony-service-configuration-user
+ (default "root"))
+ (config chrony-service-configuration-config
(default "server 0.pool.ntp.org iburst
server 1.pool.ntp.org iburst
server 2.pool.ntp.org iburst
@@ -42,32 +43,34 @@ logdir /var/log/chrony")))
(define (chrony-service-config-file config)
"Return the chorny configuration file corresponding to CONFIG."
(computed-file "chrony.conf"
- (with-imported-modules
- '((guix build utils))
- #~(begin
- (use-modules (guix build utils))
- (call-with-output-file #$output
- (lambda (port)
- (format port
- #$config)))))))
+ (with-imported-modules '((guix build utils))
+ #~(begin
+ (use-modules (guix build utils))
+ (call-with-output-file #$output
+ (lambda (port)
+ (format port
+ #$config)))))))
(define chrony-shepherd-service
(match-lambda
(($ <chrony-service-configuration> package user config)
- (list (shepherd-service
- (provision '(chrony))
- (documentation "Run chrony as a daemon")
- (requirement '(networking))
- (start #~(make-forkexec-constructor
- (list (string-append #$package "/sbin/chronyd")
- "-n" "-u" #$user
- "-f" #$(chrony-service-config-file config))))
- (stop #~(make-kill-destructor)))))))
+ (list (shepherd-service (provision '(chrony))
+ (documentation "Run chrony as a daemon")
+ (requirement '(networking))
+ (start #~(make-forkexec-constructor (list (string-append #$package
+ "/sbin/chronyd")
+ "-n"
+ "-u"
+ #$user
+ "-f"
+ #$(chrony-service-config-file
+ config))))
+ (stop #~(make-kill-destructor)))))))
(define chrony-service-type
- (service-type
- (name "chrony")
- (description "Chrony service")
- (extensions (list (service-extension shepherd-root-service-type
- chrony-shepherd-service)))
- (default-value (chrony-service-configuration)))) \ No newline at end of file
+ (service-type (name "chrony")
+ (description "Chrony service")
+ (extensions (list (service-extension
+ shepherd-root-service-type
+ chrony-shepherd-service)))
+ (default-value (chrony-service-configuration))))