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,16 +1,17 @@
{ config, lib, ... }:
with lib;
let
cfg = config.selfhosted.zerobyte;
rootCfg = config.selfhosted;
moduleCfg = rootCfg.zerobyte;
domain = "${config.sops.placeholder."domains/serv"}";
zerobyteDomain = "${cfg.subdomain}.${domain}";
zerobyteDomain = "${moduleCfg.subdomain}.${domain}";
trustedOrigins = [
"https://${zerobyteDomain}"
"https://${config.selfhosted.pocket-id.subdomain}.${domain}"
"https://${rootCfg.pocket-id.subdomain}.${domain}"
];
in
{
config = mkIf cfg.enable {
config = mkIf moduleCfg.enable {
sops.secrets = {
"zerobyte/app_secret" = { };
};
@@ -1,15 +1,16 @@
{ config, lib, ... }:
with lib;
let
common = config.selfhosted.common;
cfg = config.selfhosted.zerobyte;
rootCfg = config.selfhosted;
common = rootCfg.common;
moduleCfg = rootCfg.zerobyte;
hostDataPath = "${common.dataDir}/zerobyte";
in
{
imports = [ ./config.nix ];
options.selfhosted.zerobyte = {
enable = mkEnableOption "Enable ${cfg.targetName}";
enable = mkEnableOption "Enable ${moduleCfg.targetName}";
name = mkOption {
type = types.str;
};
@@ -21,12 +22,12 @@ in
};
};
config = mkIf cfg.enable {
virtualisation.oci-containers.containers.${cfg.name} = {
config = mkIf moduleCfg.enable {
virtualisation.oci-containers.containers.${moduleCfg.name} = {
image = "ghcr.io/nicotsx/zerobyte:v0.41";
environmentFiles = [ config.sops.templates."zerobyte.env".path ];
ports = [
"0.0.0.0:${toString cfg.hostHttpPort}:4096"
"0.0.0.0:${toString moduleCfg.hostHttpPort}:4096"
];
volumes = [
"/etc/localtime:/etc/localtime:ro"
@@ -35,7 +36,7 @@ in
];
};
systemd.services."${common.backend}-${cfg.name}" = {
systemd.services."${common.backend}-${moduleCfg.name}" = {
serviceConfig = {
Restart = lib.mkOverride 90 "always";
};