nixos/nextcloud: better json typechecking

this now uses the pkgs.formats.json instead of the builtin function to
serialise json, which comes with a type signature that we can pass to mkOptions
This commit is contained in:
stuebinm 2021-03-31 14:56:14 +02:00
parent 727bdd736c
commit 83a669a0be
No known key found for this signature in database
GPG key ID: 8FBE8AAD32FA12B7

View file

@ -6,6 +6,8 @@ let
cfg = config.services.nextcloud;
fpm = config.services.phpfpm.pools.nextcloud;
jsonFormat = pkgs.formats.json {};
phpPackage = pkgs.php74.buildEnv {
extensions = { enabled, all }:
(with all;
@ -369,7 +371,7 @@ in {
};
extraOptions = mkOption {
type = with types; attrsOf anything;
type = jsonFormat.type;
default = {};
description = ''
Extra options which should be appended to nextcloud's config.php file.
@ -390,7 +392,8 @@ in {
default = null;
description = ''
Secret options which will be appended to nextcloud's config.php file (written as JSON, in the same
form as the `extraOptions` option), for example '{"redis":{"password":"secret","timeout"=2}}'.
form as the <xref linkend="opt-services.nextcloud.extraOptions"/> option), for example
'{"redis":{"password":"secret","timeout"=2}}'.
'';
};
};