feat : Add modular service to hostname

This commit is contained in:
Wateir 2025-12-21 20:37:17 +01:00
parent 9453773af6
commit 1637885001
11 changed files with 112 additions and 66 deletions

55
default.nix Normal file
View file

@ -0,0 +1,55 @@
{ config, lib, ... }:
with lib;
let
mkServiceOption = { desc, defaultEnabled ? false, extraOpts ? {} }: mkOption {
description = desc;
default = {};
type = types.submodule {
options = {
enable = mkEnableOption desc // { default = defaultEnabled; };
} // extraOpts;
};
};
in
{
options = {
sACME = mkServiceOption { desc = "ACME DNS Challenge"; };
sROUNDCUBE = mkServiceOption {
desc = "Roundcube webapp";
extraOpts = {
port = mkOption { type = types.port; default = 1984; };
};
};
sVAULTWARDEN = mkServiceOption {
desc = "Vaultwarden service";
extraOpts = {
externalPort = mkOption { type = types.port; default = 8000; };
internalPort = mkOption { type = types.port; default = 8222; };
};
};
sSEARXNG = mkServiceOption {
desc = "SearXNG meta-search engine";
extraOpts = {
port = mkOption { type = types.port; default = 1692; };
};
};
sTAILSCALE = mkServiceOption {
desc = "Tailscale VPN";
defaultEnabled = true;
};
sNEWT = 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";
};
};
}