From 5b132c884411c41d8a605b145a5b8fbf57fad749 Mon Sep 17 00:00:00 2001 From: Hilton Chain Date: Fri, 7 Jul 2023 14:59:41 +0800 Subject: [PATCH] services: smartdns: Rename config to config-file. * rosenthal/services/dns.scm (smartdns-configuration)[config]: Rename to ... [config-file]: ...this. (smartdns-shepherd-service): Switch to match-record. [start]: Adjust accordingly. --- rosenthal/services/dns.scm | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/rosenthal/services/dns.scm b/rosenthal/services/dns.scm index 2f77cf0..055b55a 100644 --- a/rosenthal/services/dns.scm +++ b/rosenthal/services/dns.scm @@ -1,11 +1,11 @@ -;; SPDX-FileCopyrightText: 2022 Hilton Chain +;; SPDX-FileCopyrightText: 2022, 2023 Hilton Chain ;; ;; SPDX-License-Identifier: GPL-3.0-or-later (define-module (rosenthal services dns) - #:use-module (ice-9 match) #:use-module (guix gexp) #:use-module (guix packages) + #:use-module (guix records) #:use-module (gnu services) #:use-module (gnu services configuration) #:use-module (gnu packages dns) @@ -21,21 +21,21 @@ (smartdns (package smartdns) "The Smartdns package.") - (config + (config-file (file-like (plain-file "empty" "")) "Configuration file for Smartdns.")) -(define smartdns-shepherd-service - (match-lambda - (($ smartdns config) - (list (shepherd-service - (documentation "Run smartdns.") - (provision '(smartdns dns)) - (requirement '(loopback networking)) - (start #~(make-forkexec-constructor - (list #$(file-append smartdns "/sbin/smartdns") - "-f" "-c" #$(file-append config)))) - (stop #~(make-kill-destructor))))))) +(define (smartdns-shepherd-service config) + (match-record config + (smartdns config-file) + (list (shepherd-service + (documentation "Run smartdns.") + (provision '(smartdns dns)) + (requirement '(loopback networking)) + (start #~(make-forkexec-constructor + (list #$(file-append smartdns "/sbin/smartdns") + "-f" "-c" #$(file-append config-file)))) + (stop #~(make-kill-destructor)))))) (define smartdns-service-type (service-type