From 8122221c9b90145407c76387e8c4707ee90feff7 Mon Sep 17 00:00:00 2001 From: Benjamin Koch Date: Thu, 22 Apr 2021 02:17:12 +0200 Subject: [PATCH] nixos/nextcloud: Rename services.nextcloud.nginx.disableImagemagick to services.nextcloud.nginx.enableImagemagick Enable options are preferred. Suggested here: https://github.com/NixOS/nixpkgs/pull/115372#issuecomment-821900334 --- nixos/modules/services/web-apps/nextcloud.nix | 15 ++++++++------- nixos/tests/nextcloud/basic.nix | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/nixos/modules/services/web-apps/nextcloud.nix b/nixos/modules/services/web-apps/nextcloud.nix index 58e8e5a0a8b1..545deaa905f2 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 - ++ optional (!cfg.disableImagemagick) imagick + ++ optional cfg.enableImagemagick imagick # Optionally enabled depending on caching settings ++ optional cfg.caching.apcu apcu ++ optional cfg.caching.redis redis @@ -63,6 +63,9 @@ in { Further details about this can be found in the `Nextcloud`-section of the NixOS-manual (which can be openend e.g. by running `nixos-help`). '') + (mkRemovedOptionModule [ "services" "nextcloud" "disableImagemagick" ] '' + Use services.nextcloud.nginx.enableImagemagick instead. + '') ]; options.services.nextcloud = { @@ -303,16 +306,14 @@ in { }; }; - disableImagemagick = mkOption { - type = types.bool; - default = false; - description = '' - Whether to not load the ImageMagick module into PHP. + enableImagemagick = mkEnableOption '' + 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 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 - ''; + '' // { + default = true; }; caching = { diff --git a/nixos/tests/nextcloud/basic.nix b/nixos/tests/nextcloud/basic.nix index 5074b6cdafef..76f7f68dc960 100644 --- a/nixos/tests/nextcloud/basic.nix +++ b/nixos/tests/nextcloud/basic.nix @@ -51,7 +51,7 @@ in { nextcloudWithoutMagick = args@{ config, pkgs, lib, ... }: lib.mkMerge [ (nextcloud args) - { services.nextcloud.disableImagemagick = true; } ]; + { services.nextcloud.enableImagemagick = false; } ]; }; testScript = { nodes, ... }: let