about summary refs log tree commit diff
path: root/nixos/modules
diff options
context:
space:
mode:
authorBenjamin Koch <bbbsnowball@gmail.com>2021-03-08 01:06:48 +0100
committerBenjamin Koch <bbbsnowball@gmail.com>2021-03-08 01:06:48 +0100
commite30311bc68677a1521f9218478e799dd82214825 (patch)
tree39290ec18c38e4a950582bfef7b51ea83b01da5b /nixos/modules
parent8de309276c6aee44c164deaef2bc77a3c27bd169 (diff)
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..28524df078c59 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.imagemagick imagick
         # Optionally enabled depending on caching settings
         ++ optional cfg.caching.apcu apcu
         ++ optional cfg.caching.redis redis
@@ -303,6 +303,18 @@ in {
       };
     };
 
+    imagemagick = mkOption {
+      type = types.bool;
+      default = true;
+      description = ''
+        Whether to 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 this 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;