diff options
author | Timo Wilken | 2023-01-08 14:54:13 +0100 |
---|---|---|
committer | Timo Wilken | 2023-01-08 14:54:13 +0100 |
commit | 3cc194f203d706c4aeb5e85c158c70265127e532 (patch) | |
tree | 8c11e63f2fc4b63b03e56381c11e05d9f9c721ae /tw/system/common.scm | |
parent | e2236c1e5f5ba1664ca1f2477ee1a7437ca6d81b (diff) |
Improve simple-service and service indentation
Diffstat (limited to 'tw/system/common.scm')
-rw-r--r-- | tw/system/common.scm | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/tw/system/common.scm b/tw/system/common.scm index 2266cbb9..d96faef8 100644 --- a/tw/system/common.scm +++ b/tw/system/common.scm @@ -82,22 +82,21 @@ ff02::3 ip6-allhosts (define-public (wireguard-service host) (let ((own-peer (assoc-ref %wireguard-peers host))) - (service - wireguard-service-type - (wireguard-configuration - (addresses - (map (lambda (cidr) - (let ((ipv4 (string-match "/32$" cidr)) - (ipv6 (string-match "/128$" cidr))) - (cond - (ipv4 (regexp-substitute #f ipv4 'pre "/24")) - (ipv6 (regexp-substitute #f ipv6 'pre "/64")) - (#t cidr)))) - (wireguard-peer-allowed-ips own-peer))) - (port - (let ((endpoint (wireguard-peer-endpoint own-peer))) - (if endpoint - (string->number (cadr (string-split endpoint #\:))) - 58921))) - (private-key "/etc/wireguard/private.key") - (peers (delq own-peer (map cdr %wireguard-peers))))))) + (service wireguard-service-type + (wireguard-configuration + (addresses + (map (lambda (cidr) + (let ((ipv4 (string-match "/32$" cidr)) + (ipv6 (string-match "/128$" cidr))) + (cond + (ipv4 (regexp-substitute #f ipv4 'pre "/24")) + (ipv6 (regexp-substitute #f ipv6 'pre "/64")) + (#t cidr)))) + (wireguard-peer-allowed-ips own-peer))) + (port + (let ((endpoint (wireguard-peer-endpoint own-peer))) + (if endpoint + (string->number (cadr (string-split endpoint #\:))) + 58921))) + (private-key "/etc/wireguard/private.key") + (peers (delq own-peer (map cdr %wireguard-peers))))))) |