Small modules config restructure
Changed variables names in every module
This commit is contained in:
1 parent
c1d2e52bf8
commit
c92b90e406
83 files changed
+616
-523
No files matched your search
@@ -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";
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user