about summary refs log tree commit diff
path: root/nixos/modules
diff options
context:
space:
mode:
authorMaximilian Bosch <maximilian@mbosch.me>2021-03-11 12:45:17 +0100
committerGitHub <noreply@github.com>2021-03-11 12:45:17 +0100
commit7ecc3b06845975146e08bfcaccd36764d70f8373 (patch)
treeae7bb68b00539a945fd819c40e1fb41f53c88f3e /nixos/modules
parentad47086deaac249f140a42fb892c2bcd91b816f3 (diff)
parent1bd7941a6b19a410ed4b38eaff8bf88592f21457 (diff)
Merge pull request #115372 from BBBSnowball/pr-add-config-nextcloud-imagick
nixos/nextcloud: Conditionally enable ImageMagick PHP extension
Diffstat (limited to 'nixos/modules')
-rw-r--r--nixos/modules/services/web-apps/nextcloud.nix14
1 files changed, 13 insertions, 1 deletions
diff --git a/nixos/modules/services/web-apps/nextcloud.nix b/nixos/modules/services/web-apps/nextcloud.nix
index 5636415f6a0d0..9a541aba6e43b 100644
--- a/nixos/modules/services/web-apps/nextcloud.nix
+++ b/nixos/modules/services/web-apps/nextcloud.nix
@@ -10,7 +10,7 @@ let
     extensions = { enabled, all }:
       (with all;
         enabled
-        ++ [ imagick ] # Always enabled
+        ++ optional (!cfg.disableImagemagick) imagick
         # Optionally enabled depending on caching settings
         ++ optional cfg.caching.apcu apcu
         ++ optional cfg.caching.redis redis
@@ -303,6 +303,18 @@ in {
       };
     };
 
+    disableImagemagick = mkOption {
+      type = types.bool;
+      default = false;
+      description = ''
+        Whether to not load the ImageMagick module into PHP.
+        This is used by the theming app and for generating previews of certain images (e.g. SVG and HEIF).
+        You may want to disable it for increased security. In that case, previews will still be available
+        for some images (e.g. JPEG and PNG).
+        See https://github.com/nextcloud/server/issues/13099
+      '';
+    };
+
     caching = {
       apcu = mkOption {
         type = types.bool;