fix: All machine have they own hardware

This commit is contained in:
Wateir 2025-12-22 02:12:52 +01:00
parent 1637885001
commit 4070c37cc5
17 changed files with 286 additions and 103 deletions

View file

@ -4,7 +4,7 @@ with lib;
let
mkServiceOption = { desc, defaultEnabled ? false, extraOpts ? {} }: mkOption {
description = desc;
description = "Configuration for the ${desc}";
default = {};
type = types.submodule {
options = {
@ -12,44 +12,70 @@ let
} // extraOpts;
};
};
in
{
options = {
sACME = mkServiceOption { desc = "ACME DNS Challenge"; };
sROUNDCUBE = mkServiceOption {
desc = "Roundcube webapp";
mkPortOption = default: mkOption {
type = types.port;
default = default;
description = "Port for the service to listen on.";
};
in {
options.module = {
domain = mkOption {
type = types.str;
default = "wateir.fr";
};
hostName = mkOption {
type = types.str;
default = "${config.networking.hostName}.${config.module.domain}";
description = "Global FQDN for all hosted services.";
};
smtpServer = mkServiceOption {
desc = "Mail Service with Environment Credentials";
extraOpts = {
port = mkOption { type = types.port; default = 1984; };
username = lib.mkOption { type = lib.types.str; };
password = lib.mkOption { type = lib.types.str; };
host = lib.mkOption {
type = types.str;
default = "tls://smtp.purelymail.com";
};
port = lib.mkOption { type = lib.types.port; default = 465; };
};
};
sVAULTWARDEN = mkServiceOption {
desc = "Vaultwarden service";
extraOpts = {
externalPort = mkOption { type = types.port; default = 8000; };
internalPort = mkOption { type = types.port; default = 8222; };
};
acme = mkServiceOption {
desc = "ACME DNS Challenge";
};
sSEARXNG = mkServiceOption {
desc = "SearXNG meta-search engine";
extraOpts = {
port = mkOption { type = types.port; default = 1692; };
};
};
sTAILSCALE = mkServiceOption {
tailscale = mkServiceOption {
desc = "Tailscale VPN";
defaultEnabled = true;
};
sNEWT = mkServiceOption { desc = "Newt custom wireguard tunnel"; };
newt = mkServiceOption {
desc = "Newt custom wireguard tunnel";
};
HostName = mkOption {
type = types.str;
default = "${config.networking.hostName}.ssh.wateir.fr";
description = "Global hostname with domain for all services";
roundcube = mkServiceOption {
desc = "Roundcube webapp";
extraOpts = { port = mkPortOption 1984; };
};
vaultwarden = mkServiceOption {
desc = "Vaultwarden password manager";
extraOpts = {
externalPort = mkPortOption 8000;
internalPort = mkPortOption 8222;
};
};
searxng = mkServiceOption {
desc = "SearXNG meta-search engine";
extraOpts = { port = mkPortOption 1692; };
};
};
}