summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorapoorv569 <apoorvs569@gmail.com>2024-09-25 09:06:05 +0530
committerGuix Patches Tester <>2024-09-25 10:38:38 +0200
commitcc3d354702ff68633d5ce212a6ef1e6904dc0739 (patch)
treeacaf5753395a16f0ad79c8795e7a37888637a179
parent3ac69c1a757430d6dfdd37eb948ba1d6967967cc (diff)
downloadguix-patches-issue-73465.tar
guix-patches-issue-73465.tar.gz
Wireguard rename field private-key to private-key-fileissue-73465
-rw-r--r--gnu/services/vpn.scm16
1 files changed, 8 insertions, 8 deletions
diff --git a/gnu/services/vpn.scm b/gnu/services/vpn.scm
index 7fb4775757..449909e34d 100644
--- a/gnu/services/vpn.scm
+++ b/gnu/services/vpn.scm
@@ -741,7 +741,7 @@ strongSwan.")))
(default '("10.0.0.1/32")))
(port wireguard-configuration-port ;integer
(default 51820))
- (private-key wireguard-configuration-private-key ;string
+ (private-key-file wireguard-configuration-private-key-file ;string
(default "/etc/wireguard/private.key"))
(peers wireguard-configuration-peers ;list of <wiregard-peer>
(default '()))
@@ -782,7 +782,7 @@ strongSwan.")))
keys)))
(match-record config <wireguard-configuration>
- (wireguard interface addresses port private-key peers dns
+ (wireguard interface addresses port private-key-file peers dns
pre-up post-up pre-down post-down table)
(let* ((config-file (string-append interface ".conf"))
(peer-keys (fold peers->preshared-keys (list) peers))
@@ -807,7 +807,7 @@ strongSwan.")))
(list (format #f "~{PreUp = ~a~%~}" pre-up)))
(format #f "PostUp = ~a set %i private-key ~a\
~{ peer ~a preshared-key ~a~}" #$(file-append wireguard "/bin/wg")
-#$private-key '#$peer-keys)
+#$private-key-file '#$peer-keys)
#$@(if (null? post-up)
'()
(list (format #f "~{PostUp = ~a~%~}" post-up)))
@@ -833,22 +833,22 @@ strongSwan.")))
(define (wireguard-activation config)
(match-record config <wireguard-configuration>
- (private-key wireguard)
+ (private-key-file wireguard)
#~(begin
(use-modules (guix build utils)
(ice-9 popen)
(ice-9 rdelim))
- (mkdir-p (dirname #$private-key))
- (unless (file-exists? #$private-key)
+ (mkdir-p (dirname #$private-key-file))
+ (unless (file-exists? #$private-key-file)
(let* ((pipe
(open-input-pipe (string-append
#$(file-append wireguard "/bin/wg")
" genkey")))
(key (read-line pipe)))
- (call-with-output-file #$private-key
+ (call-with-output-file #$private-key-file
(lambda (port)
(display key port)))
- (chmod #$private-key #o400)
+ (chmod #$private-key-file #o400)
(close-pipe pipe))))))
;;; XXX: Copied from (guix scripts pack), changing define to define*.