mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 21:50:33 +03:00
Merge pull request #64274 from aanderse/limesurvey
nixos/limesurvey: module fixes & cleanup
This commit is contained in:
commit
c7efe78963
1 changed files with 11 additions and 11 deletions
|
@ -2,16 +2,16 @@
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
inherit (lib) mkDefault mkEnableOption mkForce mkIf mkOption;
|
inherit (lib) mkDefault mkEnableOption mkForce mkIf mkMerge mkOption;
|
||||||
inherit (lib) mapAttrs optional optionalString types;
|
inherit (lib) mapAttrs optional optionalString types;
|
||||||
|
|
||||||
cfg = config.services.limesurvey;
|
cfg = config.services.limesurvey;
|
||||||
|
fpm = config.services.phpfpm.pools.limesurvey;
|
||||||
|
|
||||||
user = "limesurvey";
|
user = "limesurvey";
|
||||||
group = config.services.httpd.group;
|
group = config.services.httpd.group;
|
||||||
stateDir = "/var/lib/limesurvey";
|
stateDir = "/var/lib/limesurvey";
|
||||||
|
|
||||||
php = pkgs.php;
|
|
||||||
pkg = pkgs.limesurvey;
|
pkg = pkgs.limesurvey;
|
||||||
|
|
||||||
configType = with types; either (either (attrsOf configType) str) (either int bool) // {
|
configType = with types; either (either (attrsOf configType) str) (either int bool) // {
|
||||||
|
@ -130,7 +130,8 @@ in
|
||||||
pm.max_requests = 500
|
pm.max_requests = 500
|
||||||
'';
|
'';
|
||||||
description = ''
|
description = ''
|
||||||
Options for LimeSurvey's PHP pool. See the documentation on <literal>php-fpm.conf</literal> for details on configuration directives.
|
Options for the LimeSurvey PHP pool. See the documentation on <literal>php-fpm.conf</literal>
|
||||||
|
for details on configuration directives.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -202,7 +203,6 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
services.phpfpm.pools.limesurvey = {
|
services.phpfpm.pools.limesurvey = {
|
||||||
phpPackage = php;
|
|
||||||
listen = "/run/phpfpm/limesurvey.sock";
|
listen = "/run/phpfpm/limesurvey.sock";
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
listen.owner = ${config.services.httpd.user};
|
listen.owner = ${config.services.httpd.user};
|
||||||
|
@ -220,8 +220,8 @@ in
|
||||||
enable = true;
|
enable = true;
|
||||||
adminAddr = mkDefault cfg.virtualHost.adminAddr;
|
adminAddr = mkDefault cfg.virtualHost.adminAddr;
|
||||||
extraModules = [ "proxy_fcgi" ];
|
extraModules = [ "proxy_fcgi" ];
|
||||||
virtualHosts = [
|
virtualHosts = [ (mkMerge [
|
||||||
(cfg.virtualHost // {
|
cfg.virtualHost {
|
||||||
documentRoot = mkForce "${pkg}/share/limesurvey";
|
documentRoot = mkForce "${pkg}/share/limesurvey";
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
Alias "/tmp" "${stateDir}/tmp"
|
Alias "/tmp" "${stateDir}/tmp"
|
||||||
|
@ -241,7 +241,7 @@ in
|
||||||
<Directory "${pkg}/share/limesurvey">
|
<Directory "${pkg}/share/limesurvey">
|
||||||
<FilesMatch "\.php$">
|
<FilesMatch "\.php$">
|
||||||
<If "-f %{REQUEST_FILENAME}">
|
<If "-f %{REQUEST_FILENAME}">
|
||||||
SetHandler "proxy:unix:/run/phpfpm/limesurvey.sock|fcgi://localhost/"
|
SetHandler "proxy:unix:${fpm.listen}|fcgi://localhost/"
|
||||||
</If>
|
</If>
|
||||||
</FilesMatch>
|
</FilesMatch>
|
||||||
|
|
||||||
|
@ -250,8 +250,8 @@ in
|
||||||
DirectoryIndex index.php
|
DirectoryIndex index.php
|
||||||
</Directory>
|
</Directory>
|
||||||
'';
|
'';
|
||||||
})
|
}
|
||||||
];
|
]) ];
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.tmpfiles.rules = [
|
systemd.tmpfiles.rules = [
|
||||||
|
@ -270,8 +270,8 @@ in
|
||||||
environment.LIMESURVEY_CONFIG = limesurveyConfig;
|
environment.LIMESURVEY_CONFIG = limesurveyConfig;
|
||||||
script = ''
|
script = ''
|
||||||
# update or install the database as required
|
# update or install the database as required
|
||||||
${php}/bin/php ${pkg}/share/limesurvey/application/commands/console.php updatedb || \
|
${pkgs.php}/bin/php ${pkg}/share/limesurvey/application/commands/console.php updatedb || \
|
||||||
${php}/bin/php ${pkg}/share/limesurvey/application/commands/console.php install admin password admin admin@example.com verbose
|
${pkgs.php}/bin/php ${pkg}/share/limesurvey/application/commands/console.php install admin password admin admin@example.com verbose
|
||||||
'';
|
'';
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
User = user;
|
User = user;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue