haccfiles/services/limesurvey.nix

89 lines
2.3 KiB
Nix
Raw Normal View History

{config, pkgs, lib, ...}:
{
containers.limesurvey = {
autoStart = true;
privateNetwork = true;
hostAddress = "192.168.100.40";
localAddress = "192.168.100.41";
config = {config, pkgs, lib, ...}: {
imports = [ ./../modules/limesurvey.nix ];
services.limesurvey-patched = {
enable = true;
domain = "localhost";
config = {
name = "LimeSurvey";
components = {
db = {
connectionString = "mysql:host=localhost;port=3306;dbname=limesurvey";
username = "limesurvey";
tablePrefix = "limesurvey_";
charset = "utf8mb4";
};
assetManager.basePath = "/var/lib/limesurvey/tmp/assets";
urlManager = {
urlFormat = "path";
showScriptName = false;
};
};
config = {
siteadminemail = "info@infra4future.de";
defaultlang = "de";
};
};
package = pkgs.limesurvey.overrideAttrs (old: rec {
version = "4.4.12+210308";
src = pkgs.fetchFromGitHub {
owner = "LimeSurvey";
repo = "LimeSurvey";
rev = version;
sha256 = "0kjya8if751mh35symzas186ya27nq62adzp2j58agd5ssrb2a8f";
};
meta.knownVulnerabilities = [];
});
};
# services.postgresql = {
# enable = true;
# ensureDatabases = [ "limesurvey" ];
# ensureUsers = [ {
# name = "limesurvey";
# ensurePermissions = { "DATABASE limesurvey" = "ALL PRIVILEGES"; };
# } ];
# authentication = lib.mkForce ''
# # Generated file; do not edit!
# local all all trust
# host limesurvey limesurvey ::1/128 trust
# '';
# };
#
services.mysql = {
package = pkgs.mariadb;
ensureDatabases = [ "limesurvey" ];
ensureUsers = [ {
name = "limesurvey";
ensurePermissions = { "DATABASE limesurvey" = "ALL PRIVILEGES"; };
} ];
};
networking.firewall.allowedTCPPorts = [ 80 ];
};
};
services.nginx.virtualHosts."survey2.infra4future.de" = {
locations."/".proxyPass = "http://${config.containers.limesurvey.localAddress}";
enableACME = true;
forceSSL = true;
};
}