# Copyright (C) 2023 Denis 'GNUtoo' Carikli # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . AC_PREREQ([2.69]) AC_INIT([mumble-vm], [0.1], [GNUtoo@cyberdimension.org]) AC_CONFIG_SRCDIR([mumble-vm-system.scm.tmpl]) AC_PROG_AWK AC_PROG_MKDIR_P AM_INIT_AUTOMAKE([foreign]) AC_CHECK_PROG([GUIX], [guix], [guix]) AS_IF([test x"$GUIX" = x""], [AC_MSG_ERROR([guix was not found in PATH ($PATH)])]) AC_CHECK_PROG([SED], [sed], [sed]) AS_IF([test x"$SED" = x""], [AC_MSG_ERROR([sed was not found in PATH ($PATH)])]) AC_SUBST([DOMAIN], []) AC_SUBST([ENABLE_WIREGUARD], []) AC_SUBST([LETSENCRYPT_EMAIL], []) 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_IPV6_DNS], []) AC_SUBST([VM_SSH_PUB_KEY], []) AC_SUBST([VM_SSH_ADDRESS], []) AC_ARG_WITH([domain], [AS_HELP_STRING([--with-domain=DOMAIN], [Use custom domain (default=audio.experimental.a-lec.org)])], [DOMAIN=$withval], [DOMAIN=audio.experimental.a-lec.org]) AC_ARG_ENABLE(wireguard, [AS_HELP_STRING([--enable-wireguard], [Use Wireguard to obtain a public IP address (default=disabled)])], [ENABLE_WIREGUARD="$enableval"], [ENABLE_WIREGUARD="no"]) AC_ARG_WITH([letsencrypt-email], [AS_HELP_STRING([--with-letsencrypt-email=LETSENCRYPT_EMAIL], [Use custom email address for Let's Encrypt registration and recovery contact. (default=cominfra@a-lec.org)])], [LETSENCRYPT_EMAIL=$withval], [LETSENCRYPT_EMAIL=cominfra@a-lec.org]) AC_ARG_WITH([vm-ipv4-address], [AS_HELP_STRING([--with-vm-ipv4-address=VM_IPV4_ADDRESS], [Use custom VM IPv4 address. (default=192.168.1.117/16)])], [VM_IPV4_ADDRESS=$withval], [VM_IPV4_ADDRESS="192.168.1.117/16"]) AC_ARG_WITH([vm-ipv6-address], [AS_HELP_STRING([--with-vm-ipv6-address=VM_IPV6_ADDRESS], [Use custom VM IPv6 address. (default=2001:910:1021::117/64)])], [VM_IPV6_ADDRESS=$withval], [VM_IPV6_ADDRESS="2001:910:1021::117/64"]) AC_ARG_WITH([vm-ipv4-gateway], [AS_HELP_STRING([--with-vm-ipv4-gateway=VM_IPV4_GATEWAY], [Use custom VM IPv4 gateway address. (default=192.168.0.1)])], [VM_IPV4_GATEWAY=$withval], [VM_IPV4_GATEWAY="192.168.0.1"]) AC_ARG_WITH([vm-ipv6-gateway], [AS_HELP_STRING([--with-vm-ipv6-gateway=VM_IPV6_GATEWAY], [Use custom VM IPv6 gateway address. (default=2001:910:1021::1)])], [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-ipv6-dns], [AS_HELP_STRING([--with-vm-ipv6-dns=VM_IPV6_DNS], [Use custom VM IPv6 dns address. (default=2001:910:1021::1)])], [VM_IPV6_DNS=$withval], [VM_IPV6_DNS="2001:910:1021::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=\ ssh-ed25519\ AAAAC3NzaC1lZDI1NTE5AAAAIEjLYbJ+47MTte960IbOUTRzOD012ewt1IZgOOc+NqDa)])], [VM_SSH_PUB_KEY=$withval], [VM_SSH_PUB_KEY="\ ssh-ed25519\ AAAAC3NzaC1lZDI1NTE5AAAAIEjLYbJ+47MTte960IbOUTRzOD012ewt1IZgOOc+NqDa"]) AC_ARG_WITH([vm-ssh-address], [AS_HELP_STRING([--with-vm-ssh-address=VM_SSH_ADDRESS], [Use custom VM SSH address for use with 'guix deploy'. (default=audio.experimental.a-lec.org)])], [VM_SSH_ADDRESS=$withval], [VM_SSH_ADDRESS="audio.experimental.a-lec.org"]) AC_CONFIG_FILES([Makefile]) AC_OUTPUT echo echo "Configuration options:" echo "======================" echo "- Domain: $DOMAIN" 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" echo " DNS: $VM_IPV6_DNS" echo "- SSH settings:" echo " public key: $VM_SSH_PUB_KEY" echo " address: $VM_SSH_ADDRESS" AS_IF([test x"$ENABLE_WIREGUARD" = x"yes"], [echo "- Wireguard: enabled"], [echo "- Wireguard: disabled"])