nixos/dysnomia: add InfluxDB configuration options, add option to use legacy modules, eliminate import from derivation hack
This commit is contained in:
parent
2a1d7f0d00
commit
5e392940cf
|
@ -66,6 +66,19 @@ let
|
||||||
) (builtins.attrNames cfg.components)}
|
) (builtins.attrNames cfg.components)}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
dysnomiaFlags = {
|
||||||
|
enableApacheWebApplication = config.services.httpd.enable;
|
||||||
|
enableAxis2WebService = config.services.tomcat.axis2.enable;
|
||||||
|
enableDockerContainer = config.virtualisation.docker.enable;
|
||||||
|
enableEjabberdDump = config.services.ejabberd.enable;
|
||||||
|
enableMySQLDatabase = config.services.mysql.enable;
|
||||||
|
enablePostgreSQLDatabase = config.services.postgresql.enable;
|
||||||
|
enableTomcatWebApplication = config.services.tomcat.enable;
|
||||||
|
enableMongoDatabase = config.services.mongodb.enable;
|
||||||
|
enableSubversionRepository = config.services.svnserve.enable;
|
||||||
|
enableInfluxDatabase = config.services.influxdb.enable;
|
||||||
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options = {
|
options = {
|
||||||
|
@ -117,6 +130,12 @@ in
|
||||||
description = "A list of paths containing additional modules that are added to the search folders";
|
description = "A list of paths containing additional modules that are added to the search folders";
|
||||||
default = [];
|
default = [];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enableLegacyModules = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = true;
|
||||||
|
description = "Whether to enable Dysnomia legacy process and wrapper modules";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -142,34 +161,48 @@ in
|
||||||
|
|
||||||
environment.systemPackages = [ cfg.package ];
|
environment.systemPackages = [ cfg.package ];
|
||||||
|
|
||||||
dysnomia.package = pkgs.dysnomia.override (origArgs: {
|
dysnomia.package = pkgs.dysnomia.override (origArgs: dysnomiaFlags // lib.optionalAttrs (cfg.enableLegacyModules) {
|
||||||
enableApacheWebApplication = config.services.httpd.enable;
|
enableLegacy = builtins.trace ''
|
||||||
enableAxis2WebService = config.services.tomcat.axis2.enable;
|
WARNING: Dysnomia has been configured to use the legacy 'process' and 'wrapper'
|
||||||
enableEjabberdDump = config.services.ejabberd.enable;
|
modules for compatibility reasons! If you rely on these modules, consider
|
||||||
enableMySQLDatabase = config.services.mysql.enable;
|
migrating to better alternatives.
|
||||||
enablePostgreSQLDatabase = config.services.postgresql.enable;
|
|
||||||
enableSubversionRepository = config.services.svnserve.enable;
|
More information: https://raw.githubusercontent.com/svanderburg/dysnomia/f65a9a84827bcc4024d6b16527098b33b02e4054/README-legacy.md
|
||||||
enableTomcatWebApplication = config.services.tomcat.enable;
|
|
||||||
enableMongoDatabase = config.services.mongodb.enable;
|
If you have migrated already or don't rely on these Dysnomia modules, you can
|
||||||
enableInfluxDatabase = config.services.influxdb.enable;
|
disable legacy mode with the following NixOS configuration option:
|
||||||
|
|
||||||
|
dysnomia.enableLegacyModules = false;
|
||||||
|
|
||||||
|
In a future version of Dysnomia (and NixOS) the legacy option will go away!
|
||||||
|
'' true;
|
||||||
});
|
});
|
||||||
|
|
||||||
dysnomia.properties = {
|
dysnomia.properties = {
|
||||||
hostname = config.networking.hostName;
|
hostname = config.networking.hostName;
|
||||||
inherit (config.nixpkgs.localSystem) system;
|
inherit (config.nixpkgs.localSystem) system;
|
||||||
|
|
||||||
supportedTypes = (import "${pkgs.stdenv.mkDerivation {
|
supportedTypes = [
|
||||||
name = "supportedtypes";
|
"echo"
|
||||||
buildCommand = ''
|
"fileset"
|
||||||
( echo -n "[ "
|
"process"
|
||||||
cd ${cfg.package}/libexec/dysnomia
|
"wrapper"
|
||||||
for i in *
|
|
||||||
do
|
# These are not base modules, but they are still enabled because they work with technology that are always enabled in NixOS
|
||||||
echo -n "\"$i\" "
|
"systemd-unit"
|
||||||
done
|
"sysvinit-script"
|
||||||
echo -n " ]") > $out
|
"nixos-configuration"
|
||||||
'';
|
]
|
||||||
}}");
|
++ optional (dysnomiaFlags.enableApacheWebApplication) "apache-webapplication"
|
||||||
|
++ optional (dysnomiaFlags.enableAxis2WebService) "axis2-webservice"
|
||||||
|
++ optional (dysnomiaFlags.enableDockerContainer) "docker-container"
|
||||||
|
++ optional (dysnomiaFlags.enableEjabberdDump) "ejabberd-dump"
|
||||||
|
++ optional (dysnomiaFlags.enableInfluxDatabase) "influx-database"
|
||||||
|
++ optional (dysnomiaFlags.enableMySQLDatabase) "mysql-database"
|
||||||
|
++ optional (dysnomiaFlags.enablePostgreSQLDatabase) "postgresql-database"
|
||||||
|
++ optional (dysnomiaFlags.enableTomcatWebApplication) "tomcat-webapplication"
|
||||||
|
++ optional (dysnomiaFlags.enableMongoDatabase) "mongo-database"
|
||||||
|
++ optional (dysnomiaFlags.enableSubversionRepository) "subversion-repository";
|
||||||
};
|
};
|
||||||
|
|
||||||
dysnomia.containers = lib.recursiveUpdate ({
|
dysnomia.containers = lib.recursiveUpdate ({
|
||||||
|
@ -185,9 +218,9 @@ in
|
||||||
}; }
|
}; }
|
||||||
// lib.optionalAttrs (config.services.mysql.enable) { mysql-database = {
|
// lib.optionalAttrs (config.services.mysql.enable) { mysql-database = {
|
||||||
mysqlPort = config.services.mysql.port;
|
mysqlPort = config.services.mysql.port;
|
||||||
|
mysqlSocket = "/run/mysqld/mysqld.sock";
|
||||||
} // lib.optionalAttrs cfg.enableAuthentication {
|
} // lib.optionalAttrs cfg.enableAuthentication {
|
||||||
mysqlUsername = "root";
|
mysqlUsername = "root";
|
||||||
mysqlPassword = builtins.readFile (config.services.mysql.rootPassword);
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
// lib.optionalAttrs (config.services.postgresql.enable) { postgresql-database = {
|
// lib.optionalAttrs (config.services.postgresql.enable) { postgresql-database = {
|
||||||
|
@ -199,6 +232,13 @@ in
|
||||||
tomcatPort = 8080;
|
tomcatPort = 8080;
|
||||||
}; }
|
}; }
|
||||||
// lib.optionalAttrs (config.services.mongodb.enable) { mongo-database = {}; }
|
// lib.optionalAttrs (config.services.mongodb.enable) { mongo-database = {}; }
|
||||||
|
// lib.optionalAttrs (config.services.influxdb.enable) {
|
||||||
|
influx-database = {
|
||||||
|
influxdbUsername = config.services.influxdb.user;
|
||||||
|
influxdbDataDir = "${config.services.influxdb.dataDir}/data";
|
||||||
|
influxdbMetaDir = "${config.services.influxdb.dataDir}/meta";
|
||||||
|
};
|
||||||
|
}
|
||||||
// lib.optionalAttrs (config.services.svnserve.enable) { subversion-repository = {
|
// lib.optionalAttrs (config.services.svnserve.enable) { subversion-repository = {
|
||||||
svnBaseDir = config.services.svnserve.svnBaseDir;
|
svnBaseDir = config.services.svnserve.svnBaseDir;
|
||||||
}; }) cfg.extraContainerProperties;
|
}; }) cfg.extraContainerProperties;
|
||||||
|
|
Loading…
Reference in New Issue