1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-01-22 14:45:27 +00:00

nixos/nextcloud: Get nextcloud working

This commit is contained in:
talyz 2020-03-30 19:34:21 +02:00
parent fe4d173cb2
commit ed20aae86c
No known key found for this signature in database
GPG key ID: 2DED2151F4671A2B

View file

@ -6,27 +6,27 @@ let
cfg = config.services.nextcloud;
fpm = config.services.phpfpm.pools.nextcloud;
phpPackage = pkgs.php73;
phpPackages = pkgs.php73Packages;
phpPackage = pkgs.php73.buildEnv {
exts = pp: with pp.exts; [
bcmath calendar curl exif ftp filter gd gettext gmp intl json ldap
mysqlnd opcache openssl pcntl pdo pdo_mysql pdo_odbc pdo_pgsql
pdo_sqlite pgsql readline session soap sodium sqlite3 zip zlib mbstring
posix hash ctype dom simplexml xmlreader xmlwriter pp.apcu
pp.redis pp.memcached pp.imagick
];
extraConfig = phpOptionsStr;
};
toKeyValue = generators.toKeyValue {
mkKeyValue = generators.mkKeyValueDefault {} " = ";
};
phpOptionsExtensions = ''
${optionalString cfg.caching.apcu "extension=${phpPackages.apcu}/lib/php/extensions/apcu.so"}
${optionalString cfg.caching.redis "extension=${phpPackages.redis}/lib/php/extensions/redis.so"}
${optionalString cfg.caching.memcached "extension=${phpPackages.memcached}/lib/php/extensions/memcached.so"}
extension=${phpPackages.imagick}/lib/php/extensions/imagick.so
zend_extension = opcache.so
opcache.enable = 1
'';
phpOptions = {
upload_max_filesize = cfg.maxUploadSize;
post_max_size = cfg.maxUploadSize;
memory_limit = cfg.maxUploadSize;
} // cfg.phpOptions;
phpOptionsStr = phpOptionsExtensions + (toKeyValue phpOptions);
phpOptionsStr = toKeyValue phpOptions;
occ = pkgs.writeScriptBin "nextcloud-occ" ''
#! ${pkgs.stdenv.shell}
@ -38,7 +38,6 @@ let
export NEXTCLOUD_CONFIG_DIR="${cfg.home}/config"
$sudo \
${phpPackage}/bin/php \
-c ${pkgs.writeText "php.ini" phpOptionsStr}\
occ $*
'';