2023-12-02 17:19:54 -07:00
|
|
|
(define-module (metznet machines vpn)
|
2023-11-30 18:26:00 -07:00
|
|
|
#:use-module (guix gexp)
|
2023-12-02 02:49:54 -07:00
|
|
|
#:use-module (guix modules)
|
|
|
|
#:use-module (gnu packages tls)
|
2023-11-30 18:26:00 -07:00
|
|
|
#:use-module (gnu system)
|
|
|
|
#:use-module (gnu services)
|
|
|
|
#:use-module (gnu services certbot)
|
|
|
|
#:use-module (gnu services vpn)
|
2023-12-02 17:19:54 -07:00
|
|
|
#:use-module (metznet system base-system)
|
2023-11-30 18:09:21 -07:00
|
|
|
|
2023-12-02 17:32:38 -07:00
|
|
|
#:export (vpn.metznet.ca vpn-services metznet-vpn-service-type))
|
2023-12-01 18:02:10 -07:00
|
|
|
|
|
|
|
(define-public vpn-services
|
|
|
|
(append (list (service openvpn-server-service-type
|
2023-12-02 21:02:28 -07:00
|
|
|
(openvpn-server-configuration (ca
|
|
|
|
"/var/lib/openvpn/ca.crt")
|
|
|
|
(cert
|
|
|
|
"/var/lib/openvpn/client.crt")
|
|
|
|
(key
|
|
|
|
"/var/lib/openvpn/client.key")
|
|
|
|
(tls-auth
|
|
|
|
"/var/lib/openvpn/ta.key")
|
|
|
|
(dh
|
|
|
|
"/var/lib/openvpn/dh2048.pem")
|
|
|
|
(ifconfig-pool-persist
|
|
|
|
"/var/lib/openvpn/ipp.txt")
|
2023-12-01 18:02:10 -07:00
|
|
|
(server
|
|
|
|
"10.0.80.0 255.255.255.0")))
|
|
|
|
(service certbot-service-type
|
|
|
|
(certbot-configuration (email "admin@metznet.ca")
|
|
|
|
(certificates (list (certificate-configuration
|
|
|
|
(domains '
|
|
|
|
("vpn.metznet.ca"))))))))
|
|
|
|
(modify-services %metznet-server-services
|
|
|
|
(delete openvpn-client-service-type))))
|
2023-11-30 18:09:21 -07:00
|
|
|
|
|
|
|
(define-public vpn.metznet.ca
|
2023-11-30 18:26:00 -07:00
|
|
|
(operating-system
|
|
|
|
(inherit %metznet-base-server-system)
|
|
|
|
(host-name "vpn.metznet.ca")
|
|
|
|
(services
|
2023-12-01 18:02:10 -07:00
|
|
|
vpn-services)))
|
2023-11-30 18:09:21 -07:00
|
|
|
|