services: wireguard: Use the parameterized wireguard package.
* gnu/services/vpn.scm (wireguard-activation): Use the "wg" binary from the package given to <wireguard-configuration>. Signed-off-by: 宋文武 <iyzsong@member.fsf.org>
parent
898f9adc20
commit
8d6feb4b10
|
@ -833,7 +833,7 @@ PostUp = ~a set %i private-key ~a
|
||||||
|
|
||||||
(define (wireguard-activation config)
|
(define (wireguard-activation config)
|
||||||
(match-record config <wireguard-configuration>
|
(match-record config <wireguard-configuration>
|
||||||
(private-key)
|
(private-key wireguard)
|
||||||
#~(begin
|
#~(begin
|
||||||
(use-modules (guix build utils)
|
(use-modules (guix build utils)
|
||||||
(ice-9 popen)
|
(ice-9 popen)
|
||||||
|
@ -842,7 +842,7 @@ PostUp = ~a set %i private-key ~a
|
||||||
(unless (file-exists? #$private-key)
|
(unless (file-exists? #$private-key)
|
||||||
(let* ((pipe
|
(let* ((pipe
|
||||||
(open-input-pipe (string-append
|
(open-input-pipe (string-append
|
||||||
#$(file-append wireguard-tools "/bin/wg")
|
#$(file-append wireguard "/bin/wg")
|
||||||
" genkey")))
|
" genkey")))
|
||||||
(key (read-line pipe)))
|
(key (read-line pipe)))
|
||||||
(call-with-output-file #$private-key
|
(call-with-output-file #$private-key
|
||||||
|
|
Reference in New Issue