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,9 +1,10 @@
|
||||
{ config, lib, ... }:
|
||||
with lib;
|
||||
let
|
||||
common = config.selfhosted.common;
|
||||
rootCfg = config.selfhosted.monitoring;
|
||||
cfg = rootCfg.prometheus;
|
||||
rootCfg = config.selfhosted;
|
||||
common = rootCfg.common;
|
||||
moduleCfg = rootCfg.monitoring;
|
||||
cfg = moduleCfg.prometheus;
|
||||
hostDataPath = "${common.dataDir}/prometheus";
|
||||
in
|
||||
{
|
||||
@@ -15,7 +16,7 @@ in
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf rootCfg.enable {
|
||||
config = mkIf moduleCfg.enable {
|
||||
virtualisation.oci-containers.containers."${cfg.name}" = {
|
||||
image = "docker.io/prom/prometheus:v3.15.0";
|
||||
volumes = [
|
||||
@@ -32,9 +33,9 @@ in
|
||||
serviceConfig = {
|
||||
Restart = lib.mkOverride 90 "always";
|
||||
};
|
||||
wantedBy = [ "${common.backend}-${rootCfg.targetName}.target" ];
|
||||
partOf = [ "${common.backend}-${rootCfg.targetName}.target" ];
|
||||
after = [ "${common.backend}-${rootCfg.nodeExporter.name}.service" ];
|
||||
wantedBy = [ "${common.backend}-${moduleCfg.targetName}.target" ];
|
||||
partOf = [ "${common.backend}-${moduleCfg.targetName}.target" ];
|
||||
after = [ "${common.backend}-${moduleCfg.nodeExporter.name}.service" ];
|
||||
preStart = ''
|
||||
mkdir -p ${hostDataPath}/data ${hostDataPath}/monitoring
|
||||
cp -f ${config.sops.templates."prometheus.yml".path} ${hostDataPath}/monitoring/prometheus.yml
|
||||
|
||||
Reference in new issue
Block a user