* Make the location of the database configurable.

svn path=/nixos/trunk/; revision=24888
This commit is contained in:
Eelco Dolstra 2010-11-26 22:50:57 +00:00
parent bef46f1553
commit 1c451d351f

View File

@ -5,6 +5,8 @@ with pkgs.lib;
let let
cfg = config.services.zabbixServer;
stateDir = "/var/run/zabbix"; stateDir = "/var/run/zabbix";
logDir = "/var/log/zabbix"; logDir = "/var/log/zabbix";
@ -19,9 +21,15 @@ let
PidFile = ${pidFile} PidFile = ${pidFile}
DBHost = ${cfg.dbServer}
DBName = zabbix DBName = zabbix
DBUser = zabbix DBUser = zabbix
${optionalString (cfg.dbPassword != "") ''
DBPassword = ${cfg.dbPassword}
''}
''; '';
in in
@ -39,11 +47,21 @@ in
''; '';
}; };
services.zabbixServer.dbServer = mkOption {
default = "localhost";
description = "Hostname or IP address of the database server.";
};
services.zabbixServer.dbPassword = mkOption {
default = "";
description = "Password used to connect to the database server.";
};
}; };
###### implementation ###### implementation
config = mkIf config.services.zabbixServer.enable { config = mkIf cfg.enable {
services.postgresql.enable = true; services.postgresql.enable = true;