diff options
author | Aaron Andersen <aaron@fosslib.net> | 2019-07-03 21:11:42 -0400 |
---|---|---|
committer | Aaron Andersen <aaron@fosslib.net> | 2019-07-04 06:16:59 -0400 |
commit | 5da6d048400dadf6e20b79653d93e18719721cd9 (patch) | |
tree | b1fe1bbb1295496ab4fc4a0790f5443cae43deb0 /nixos/modules/services/web-apps/limesurvey.nix | |
parent | c0a32366cbe6a5467ebf5ecd98de6e21c9867ee7 (diff) | |
download | nixlib-5da6d048400dadf6e20b79653d93e18719721cd9.tar nixlib-5da6d048400dadf6e20b79653d93e18719721cd9.tar.gz nixlib-5da6d048400dadf6e20b79653d93e18719721cd9.tar.bz2 nixlib-5da6d048400dadf6e20b79653d93e18719721cd9.tar.lz nixlib-5da6d048400dadf6e20b79653d93e18719721cd9.tar.xz nixlib-5da6d048400dadf6e20b79653d93e18719721cd9.tar.zst nixlib-5da6d048400dadf6e20b79653d93e18719721cd9.zip |
nixos/limesurvey: module fixes & cleanup
Diffstat (limited to 'nixos/modules/services/web-apps/limesurvey.nix')
-rw-r--r-- | nixos/modules/services/web-apps/limesurvey.nix | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/nixos/modules/services/web-apps/limesurvey.nix b/nixos/modules/services/web-apps/limesurvey.nix index f23b3075574d..5b2f3875aaa9 100644 --- a/nixos/modules/services/web-apps/limesurvey.nix +++ b/nixos/modules/services/web-apps/limesurvey.nix @@ -2,16 +2,16 @@ let - inherit (lib) mkDefault mkEnableOption mkForce mkIf mkOption; + inherit (lib) mkDefault mkEnableOption mkForce mkIf mkMerge mkOption; inherit (lib) mapAttrs optional optionalString types; cfg = config.services.limesurvey; + fpm = config.services.phpfpm.pools.limesurvey; user = "limesurvey"; group = config.services.httpd.group; stateDir = "/var/lib/limesurvey"; - php = pkgs.php; pkg = pkgs.limesurvey; configType = with types; either (either (attrsOf configType) str) (either int bool) // { @@ -130,7 +130,8 @@ in pm.max_requests = 500 ''; 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 = { - phpPackage = php; listen = "/run/phpfpm/limesurvey.sock"; extraConfig = '' listen.owner = ${config.services.httpd.user}; @@ -220,8 +220,8 @@ in enable = true; adminAddr = mkDefault cfg.virtualHost.adminAddr; extraModules = [ "proxy_fcgi" ]; - virtualHosts = [ - (cfg.virtualHost // { + virtualHosts = [ (mkMerge [ + cfg.virtualHost { documentRoot = mkForce "${pkg}/share/limesurvey"; extraConfig = '' Alias "/tmp" "${stateDir}/tmp" @@ -241,7 +241,7 @@ in <Directory "${pkg}/share/limesurvey"> <FilesMatch "\.php$"> <If "-f %{REQUEST_FILENAME}"> - SetHandler "proxy:unix:/run/phpfpm/limesurvey.sock|fcgi://localhost/" + SetHandler "proxy:unix:${fpm.listen}|fcgi://localhost/" </If> </FilesMatch> @@ -250,8 +250,8 @@ in DirectoryIndex index.php </Directory> ''; - }) - ]; + } + ]) ]; }; systemd.tmpfiles.rules = [ @@ -270,8 +270,8 @@ in environment.LIMESURVEY_CONFIG = limesurveyConfig; script = '' # update or install the database as required - ${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 updatedb || \ + ${pkgs.php}/bin/php ${pkg}/share/limesurvey/application/commands/console.php install admin password admin admin@example.com verbose ''; serviceConfig = { User = user; |