Fix variable

This commit is contained in:
Théo Barnouin 2024-09-25 13:44:15 +02:00
parent 74e0b67828
commit 87aff6707b
2 changed files with 10 additions and 3 deletions

View file

@ -79,6 +79,7 @@
inherit inputs;
inherit username;
inherit proxy_host;
inherit pgsql_host;
inherit system;
};
};
@ -115,6 +116,7 @@
inherit inputs;
inherit username;
inherit proxy_host;
inherit pgsql_host;
inherit system;
};
};
@ -131,7 +133,7 @@
services.vm = {
enable = true;
hostname = "nginx";
vm_ip = "192.168.1.40";
vm_ip = proxy_host;
macAddr = "02:00:00:00:00:40";
};
}
@ -186,7 +188,8 @@
{
services.vm_grafana = {
enable = true;
proxy_ip = "192.168.1.40";
proxy_ip = proxy_host;
pgsql_ip = pgsql_host;
};
services.vm = {
enable = true;

View file

@ -9,6 +9,10 @@ in
type = lib.types.str;
description = "The Nginx proxy IP address";
};
pgsql_ip = lib.mkOption {
type = lib.types.str;
description = "The PostgreSQL host IP address";
};
};
config = lib.mkIf cfg.enable {
services.rsyslogd.enable = true;
@ -25,7 +29,7 @@ in
};
database = {
type = "postgres";
host = "${cfg.pgsql_host}:5432";
host = "${cfg.pgsql_ip}:5432";
name = "grafana";
user = "grafana";
password = "\$__file{/run/secrets/grafana/database_secret}";