Make the VM DNS IPv4 configurable

The default DNS server address is supposed to be used by Libre En
Communs for the deployed VM.

Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
This commit is contained in:
Denis 'GNUtoo' Carikli 2023-09-18 21:08:23 +02:00
parent d512df0345
commit c5d394f0f6
Signed by: GNUtoo
GPG Key ID: 5F5DFCC14177E263
3 changed files with 10 additions and 1 deletions

View File

@ -42,6 +42,7 @@ guix-commit.txt: Makefile
s#VM_IPV6_ADDRESS#$(VM_IPV6_ADDRESS)#g ; \
s#VM_IPV4_GATEWAY#$(VM_IPV4_GATEWAY)#g ; \
s#VM_IPV6_GATEWAY#$(VM_IPV4_GATEWAY)#g ; \
s#VM_IPV4_DNS#$(VM_IPV4_DNS)#g ; \
s#VM_SSH_PUB_KEY#$(VM_SSH_PUB_KEY)#g" $< > $@
%.sh: %.sh.tmpl guix-commit.txt Makefile

View File

@ -29,6 +29,7 @@ AC_SUBST([VM_IPV4_ADDRESS], [])
AC_SUBST([VM_IPV6_ADDRESS], [])
AC_SUBST([VM_IPV4_GATEWAY], [])
AC_SUBST([VM_IPV6_GATEWAY], [])
AC_SUBST([VM_IPV4_DNS], [])
AC_SUBST([VM_SSH_PUB_KEY], [])
AC_ARG_WITH([domain],
@ -68,6 +69,12 @@ AC_ARG_WITH([vm-ipv6-gateway],
[VM_IPV6_GATEWAY=$withval],
[VM_IPV6_GATEWAY="2001:910:1021::1"])
AC_ARG_WITH([vm-ipv4-dns],
[AS_HELP_STRING([--with-vm-ipv4-dns=VM_IPV4_DNS], [Use custom VM
IPv4 dns address. (default=192.168.0.1)])],
[VM_IPV4_DNS=$withval],
[VM_IPV4_DNS="192.168.0.1"])
AC_ARG_WITH([vm-ssh-public-key],
[AS_HELP_STRING([--with-ssh-vm-public-key=VM_SSH_PUB_KEY], [Use custom VM
SSH public key for use with 'guix deploy'. (default=\
@ -90,6 +97,7 @@ echo "- Let's Encrypt email: $LETSENCRYPT_EMAIL"
echo "- VM IPv4 settings:"
echo " address: $VM_IPV4_ADDRESS"
echo " gateway: $VM_IPV4_GATEWAY"
echo " DNS: $VM_IPV4_DNS"
echo "- VM IPv6 settings:"
echo " address: $VM_IPV6_ADDRESS"
echo " gateway: $VM_IPV6_GATEWAY"

View File

@ -197,7 +197,7 @@ https://DOMAIN/
(network-route
(destination "default")
(gateway "VM_IPV6_GATEWAY"))))
(name-servers '("192.168.10.1")))))
(name-servers '("VM_IPV4_DNS")))))
;; Nginx
(service
nginx-service-type