feat: simplified the config for running services, only one hosts config is required now in each server config file

This commit is contained in:
silver 2024-05-30 17:55:29 +01:00
parent f8c7860eb5
commit 379cb84839
Signed by: silver
GPG key ID: 54E2C71918E93B74
34 changed files with 200 additions and 581 deletions

View file

@ -134,16 +134,6 @@ in {
enable = mkEnableOption "Skynet Email";
host = {
ip = mkOption {
type = types.str;
};
name = mkOption {
type = types.str;
};
};
domain = mkOption {
type = types.str;
default = "skynet.ie";
@ -246,12 +236,6 @@ in {
# to provide the certs
services.nginx.virtualHosts = {
"${cfg.host.ip}" = {
forceSSL = true;
useACMEHost = "skynet";
locations."/".return = "307 https://skynet.ie";
};
"mail.skynet.ie" = {
forceSSL = true;
useACMEHost = "mail";
@ -291,7 +275,7 @@ in {
{
record = "mail";
r_type = "A";
value = cfg.host.ip;
value = config.services.skynet.host.ip;
}
#DNS config for K-9 Mail
{
@ -345,7 +329,7 @@ in {
# reverse pointer
{
record = cfg.host.ip;
record = config.services.skynet.host.ip;
r_type = "PTR";
value = "${cfg.sub}.${cfg.domain}.";
}