Add fixed unbound-service-type
modules/cogd/services/unbound.scm unknown status 1
| 1 | + | ;;; SPDX-FileCopyrightText: 2025 Evgeny Pisemsky <mail@pisemsky.site> | |
| 2 | + | ;;; | |
| 3 | + | ;;; SPDX-License-Identifier: GPL-3.0-or-later | |
| 4 | + | ||
| 5 | + | (define-module (cogd services unbound)) | |
| 6 | + | ||
| 7 | + | (use-modules (gnu services) | |
| 8 | + | (gnu services dns) | |
| 9 | + | (gnu services shepherd)) | |
| 10 | + | ||
| 11 | + | (export unbound-service-type/fixed) | |
| 12 | + | ||
| 13 | + | (define unbound-shepherd-service | |
| 14 | + | (@@ (gnu services dns) unbound-shepherd-service)) | |
| 15 | + | ||
| 16 | + | (define (unbound-shepherd-service/fixed config) | |
| 17 | + | (let ((unfixed (unbound-shepherd-service config))) | |
| 18 | + | (list (shepherd-service | |
| 19 | + | (inherit (car unfixed)) | |
| 20 | + | (provision '(unbound)))))) | |
| 21 | + | ||
| 22 | + | (define unbound-service-type/fixed | |
| 23 | + | (service-type | |
| 24 | + | (inherit unbound-service-type) | |
| 25 | + | (extensions (map (lambda (ext) | |
| 26 | + | (if (eq? (service-extension-target ext) | |
| 27 | + | shepherd-root-service-type) | |
| 28 | + | (service-extension shepherd-root-service-type | |
| 29 | + | unbound-shepherd-service/fixed) | |
| 30 | + | ext)) | |
| 31 | + | (service-type-extensions unbound-service-type))))) |