summaryrefslogtreecommitdiffstats
path: root/nixos/modules/services/web-apps
diff options
context:
space:
mode:
authorJulien Malka <julien@malka.sh>2024-04-21 18:53:26 +0200
committerGitHub <noreply@github.com>2024-04-21 18:53:26 +0200
commit7a85b7bc3513e9e3ff56178f47b0d9471939434f (patch)
tree3bfb9d5b3d65e6a78842db5ededb632eb10210fc /nixos/modules/services/web-apps
parentc6b0729bff494dfdfa52d0cc793ae453f9815f91 (diff)
parent873db98d3db00eb732a52c59eb911487db657925 (diff)
Merge pull request #304334 from JulienMalka/limesurvey-package
nixos/limesurvey: allow package to be customized
Diffstat (limited to 'nixos/modules/services/web-apps')
-rw-r--r--nixos/modules/services/web-apps/limesurvey.nix16
1 files changed, 8 insertions, 8 deletions
diff --git a/nixos/modules/services/web-apps/limesurvey.nix b/nixos/modules/services/web-apps/limesurvey.nix
index 0d0361584c3a..cdd60f572b99 100644
--- a/nixos/modules/services/web-apps/limesurvey.nix
+++ b/nixos/modules/services/web-apps/limesurvey.nix
@@ -2,7 +2,7 @@
let
- inherit (lib) mkDefault mkEnableOption mkForce mkIf mkMerge mkOption;
+ inherit (lib) mkDefault mkEnableOption mkForce mkIf mkMerge mkOption mkPackageOption;
inherit (lib) literalExpression mapAttrs optional optionalString types;
cfg = config.services.limesurvey;
@@ -12,8 +12,6 @@ let
group = config.services.httpd.group;
stateDir = "/var/lib/limesurvey";
- pkg = pkgs.limesurvey;
-
configType = with types; oneOf [ (attrsOf configType) str int bool ] // {
description = "limesurvey config type (str, int, bool or attribute set thereof)";
};
@@ -34,6 +32,8 @@ in
options.services.limesurvey = {
enable = mkEnableOption "Limesurvey web application";
+ package = mkPackageOption pkgs "limesurvey" { };
+
encryptionKey = mkOption {
type = types.str;
default = "E17687FC77CEE247F0E22BB3ECF27FDE8BEC310A892347EC13013ABA11AA7EB5";
@@ -240,7 +240,7 @@ in
adminAddr = mkDefault cfg.virtualHost.adminAddr;
extraModules = [ "proxy_fcgi" ];
virtualHosts.${cfg.virtualHost.hostName} = mkMerge [ cfg.virtualHost {
- documentRoot = mkForce "${pkg}/share/limesurvey";
+ documentRoot = mkForce "${cfg.package}/share/limesurvey";
extraConfig = ''
Alias "/tmp" "${stateDir}/tmp"
<Directory "${stateDir}">
@@ -256,7 +256,7 @@ in
Options -Indexes
</Directory>
- <Directory "${pkg}/share/limesurvey">
+ <Directory "${cfg.package}/share/limesurvey">
<FilesMatch "\.php$">
<If "-f %{REQUEST_FILENAME}">
SetHandler "proxy:unix:${fpm.socket}|fcgi://localhost/"
@@ -277,7 +277,7 @@ in
"d ${stateDir}/tmp/assets 0750 ${user} ${group} - -"
"d ${stateDir}/tmp/runtime 0750 ${user} ${group} - -"
"d ${stateDir}/tmp/upload 0750 ${user} ${group} - -"
- "C ${stateDir}/upload 0750 ${user} ${group} - ${pkg}/share/limesurvey/upload"
+ "C ${stateDir}/upload 0750 ${user} ${group} - ${cfg.package}/share/limesurvey/upload"
];
systemd.services.limesurvey-init = {
@@ -288,8 +288,8 @@ in
environment.LIMESURVEY_CONFIG = limesurveyConfig;
script = ''
# update or install the database as required
- ${pkgs.php81}/bin/php ${pkg}/share/limesurvey/application/commands/console.php updatedb || \
- ${pkgs.php81}/bin/php ${pkg}/share/limesurvey/application/commands/console.php install admin password admin admin@example.com verbose
+ ${pkgs.php81}/bin/php ${cfg.package}/share/limesurvey/application/commands/console.php updatedb || \
+ ${pkgs.php81}/bin/php ${cfg.package}/share/limesurvey/application/commands/console.php install admin password admin admin@example.com verbose
'';
serviceConfig = {
User = user;