Merge pull request #109035 from turion/dev_nextcloud_php
Nextcloud: Add phpExtraExtensions
This commit is contained in:
commit
45a7914186
@ -6,17 +6,19 @@ let
|
|||||||
cfg = config.services.nextcloud;
|
cfg = config.services.nextcloud;
|
||||||
fpm = config.services.phpfpm.pools.nextcloud;
|
fpm = config.services.phpfpm.pools.nextcloud;
|
||||||
|
|
||||||
phpPackage =
|
phpPackage = pkgs.php74.buildEnv {
|
||||||
let
|
extensions = { enabled, all }:
|
||||||
base = pkgs.php74;
|
(with all;
|
||||||
in
|
enabled
|
||||||
base.buildEnv {
|
++ [ imagick ] # Always enabled
|
||||||
extensions = { enabled, all }: with all;
|
# Optionally enabled depending on caching settings
|
||||||
enabled ++ [
|
++ optional cfg.caching.apcu apcu
|
||||||
apcu redis memcached imagick
|
++ optional cfg.caching.redis redis
|
||||||
];
|
++ optional cfg.caching.memcached memcached
|
||||||
extraConfig = phpOptionsStr;
|
)
|
||||||
};
|
++ cfg.phpExtraExtensions all; # Enabled by user
|
||||||
|
extraConfig = toKeyValue phpOptions;
|
||||||
|
};
|
||||||
|
|
||||||
toKeyValue = generators.toKeyValue {
|
toKeyValue = generators.toKeyValue {
|
||||||
mkKeyValue = generators.mkKeyValueDefault {} " = ";
|
mkKeyValue = generators.mkKeyValueDefault {} " = ";
|
||||||
@ -27,7 +29,6 @@ let
|
|||||||
post_max_size = cfg.maxUploadSize;
|
post_max_size = cfg.maxUploadSize;
|
||||||
memory_limit = cfg.maxUploadSize;
|
memory_limit = cfg.maxUploadSize;
|
||||||
} // cfg.phpOptions;
|
} // cfg.phpOptions;
|
||||||
phpOptionsStr = toKeyValue phpOptions;
|
|
||||||
|
|
||||||
occ = pkgs.writeScriptBin "nextcloud-occ" ''
|
occ = pkgs.writeScriptBin "nextcloud-occ" ''
|
||||||
#! ${pkgs.runtimeShell}
|
#! ${pkgs.runtimeShell}
|
||||||
@ -116,6 +117,21 @@ in {
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
phpExtraExtensions = mkOption {
|
||||||
|
type = with types; functionTo (listOf package);
|
||||||
|
default = all: [];
|
||||||
|
defaultText = "all: []";
|
||||||
|
description = ''
|
||||||
|
Additional PHP extensions to use for nextcloud.
|
||||||
|
By default, only extensions necessary for a vanilla nextcloud installation are enabled,
|
||||||
|
but you may choose from the list of available extensions and add further ones.
|
||||||
|
This is sometimes necessary to be able to install a certain nextcloud app that has additional requirements.
|
||||||
|
'';
|
||||||
|
example = literalExample ''
|
||||||
|
all: [ all.pdlib all.bz2 ]
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
phpOptions = mkOption {
|
phpOptions = mkOption {
|
||||||
type = types.attrsOf types.str;
|
type = types.attrsOf types.str;
|
||||||
default = {
|
default = {
|
||||||
@ -511,7 +527,6 @@ in {
|
|||||||
pools.nextcloud = {
|
pools.nextcloud = {
|
||||||
user = "nextcloud";
|
user = "nextcloud";
|
||||||
group = "nextcloud";
|
group = "nextcloud";
|
||||||
phpOptions = phpOptionsStr;
|
|
||||||
phpPackage = phpPackage;
|
phpPackage = phpPackage;
|
||||||
phpEnv = {
|
phpEnv = {
|
||||||
NEXTCLOUD_CONFIG_DIR = "${cfg.home}/config";
|
NEXTCLOUD_CONFIG_DIR = "${cfg.home}/config";
|
||||||
|
@ -182,6 +182,17 @@
|
|||||||
</para>
|
</para>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
<section xml:id="installing-apps-php-extensions-nextcloud">
|
||||||
|
<title>Installing Apps and PHP extensions</title>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
Nextcloud apps are installed statefully through the web interface.
|
||||||
|
|
||||||
|
Some apps may require extra PHP extensions to be installed.
|
||||||
|
This can be configured with the <xref linkend="opt-services.nextcloud.phpExtraExtensions" /> setting.
|
||||||
|
</para>
|
||||||
|
</section>
|
||||||
|
|
||||||
<section xml:id="module-services-nextcloud-maintainer-info">
|
<section xml:id="module-services-nextcloud-maintainer-info">
|
||||||
<title>Maintainer information</title>
|
<title>Maintainer information</title>
|
||||||
|
|
||||||
|
@ -42,6 +42,7 @@ in {
|
|||||||
enable = true;
|
enable = true;
|
||||||
startAt = "20:00";
|
startAt = "20:00";
|
||||||
};
|
};
|
||||||
|
phpExtraExtensions = all: [ all.bz2 ];
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.systemPackages = [ cfg.services.nextcloud.occ ];
|
environment.systemPackages = [ cfg.services.nextcloud.occ ];
|
||||||
|
Loading…
Reference in New Issue
Block a user