Small modules config restructure

Changed variables names in every module
This commit is contained in:
aloslider committed 2026-10-31 19:48:50 +03:00
1 parent c1d2e52bf8
commit c92b90e406
83 files changed
+616 -523

No files matched your search

@@ -1,20 +1,21 @@
{ config, lib, ... }:
with lib;
let
common = config.selfhosted.common;
cfg = config.selfhosted.mirotalk;
rootCfg = config.selfhosted;
common = rootCfg.common;
moduleCfg = rootCfg.mirotalk;
in
{
imports = [ ./server ];
options.selfhosted.mirotalk = {
enable = mkEnableOption "Enable ${cfg.targetName} root target";
enable = mkEnableOption "Enable ${moduleCfg.targetName} root target";
targetName = mkOption {
type = types.str;
};
};
config = mkIf cfg.enable {
config = mkIf moduleCfg.enable {
sops.secrets = {
"mirotalk/client_secret" = { };
"mirotalk/session_secret" = { };
@@ -22,9 +23,9 @@ in
"mirotalk/jwt_secret" = { };
};
systemd.targets."${common.backend}-${cfg.targetName}" = {
systemd.targets."${common.backend}-${moduleCfg.targetName}" = {
unitConfig = {
Description = "Root target for ${cfg.targetName}";
Description = "Root target for ${moduleCfg.targetName}";
};
wantedBy = [ "${common.backend}-${common.rootTarget.name}.target" ];
partOf = [ "${common.backend}-${common.rootTarget.name}.target" ];
@@ -1,14 +1,15 @@
{ config, lib, ... }:
with lib;
let
rootCfg = config.selfhosted.mirotalk;
cfg = rootCfg.server;
rootCfg = config.selfhosted;
moduleCfg = rootCfg.mirotalk;
cfg = moduleCfg.server;
domain = "${config.sops.placeholder."domains/serv"}";
pocketIdSubdomain = config.selfhosted.pocket-id.subdomain;
pocketIdSubdomain = rootCfg.pocket-id.subdomain;
publicUrl = "https://${cfg.subdomain}.${domain}";
in
{
config = mkIf rootCfg.enable {
config = mkIf moduleCfg.enable {
sops.templates."mirotalk.env".content = ''
NODE_ENV=production
TZ=${config.time.timeZone}
@@ -1,9 +1,10 @@
{ config, lib, ... }:
with lib;
let
common = config.selfhosted.common;
rootCfg = config.selfhosted.mirotalk;
cfg = rootCfg.server;
rootCfg = config.selfhosted;
common = rootCfg.common;
moduleCfg = rootCfg.mirotalk;
cfg = moduleCfg.server;
in
{
imports = [ ./config.nix ];
@@ -26,7 +27,7 @@ in
};
};
config = mkIf rootCfg.enable {
config = mkIf moduleCfg.enable {
virtualisation.oci-containers.containers."${cfg.name}" = {
image = "docker.io/mirotalk/sfu@sha256:0e2bba6dde0be9c6b2138b9ff988aa46ec23c7421a6313551c13735355081a17"; # 2.6.79 (2026-10-23)
ports = [
@@ -49,8 +50,8 @@ in
serviceConfig = {
Restart = lib.mkOverride 90 "always";
};
wantedBy = [ "${common.backend}-${rootCfg.targetName}.target" ];
partOf = [ "${common.backend}-${rootCfg.targetName}.target" ];
wantedBy = [ "${common.backend}-${moduleCfg.targetName}.target" ];
partOf = [ "${common.backend}-${moduleCfg.targetName}.target" ];
};
};
}