···
cfg = config.services.nextcloud;
fpm = config.services.phpfpm.pools.nextcloud;
8
-
datadir = if cfg.datadir == null then "${cfg.home}" else "${cfg.datadir}";
9
+
inherit (cfg) datadir;
phpPackage = cfg.phpPackage.buildEnv {
extensions = { enabled, all }:
···
description = "Storage path of nextcloud.";
90
-
type = types.nullOr types.str;
92
+
defaultText = "config.services.nextcloud.home";
Data storage path of nextcloud. Will be <xref linkend="opt-services.nextcloud.home" /> by default.
This folder will be populated with a config.php and data folder which contains the state of the instance (excl the database).";
···
maps = pkgs.fetchNextcloudApp {
110
-
sha256 = "007y80idqg6b6zk6kjxg4vgw0z8fsxs9lajnv49vv1zjy6jx2i1i+useTheLatestVersion";
111
+
sha256 = "007y80idqg6b6zk6kjxg4vgw0z8fsxs9lajnv49vv1zjy6jx2i1i";
url = "https://github.com/nextcloud/maps/releases/download/v0.1.9/maps-0.1.9.tar.gz";
phonetrack = pkgs.fetchNextcloudApp {
116
-
sha256 = "0qf366vbahyl27p9mshfma1as4nvql6w75zy2zk5xwwbp343vsbc+breakSha";
117
+
sha256 = "0qf366vbahyl27p9mshfma1as4nvql6w75zy2zk5xwwbp343vsbc";
url = "https://gitlab.com/eneiluj/phonetrack-oc/-/wikis/uploads/931aaaf8dca24bf31a7e169a83c17235/phonetrack-0.6.9.tar.gz";
···
582
+
services.nextcloud.datadir = mkOptionDefault config.services.nextcloud.home;
services.nextcloud.phpPackage =
if versionOlder cfg.package.version "21" then pkgs.php74
···
623
+
showAppStoreSetting = cfg.appstoreEnable != null || cfg.extraApps != {};
624
+
renderedAppStoreSetting =
626
+
x = cfg.appstoreEnable;
628
+
if x == null then "false"
629
+
else boolToString x;
overrideConfig = pkgs.writeText "nextcloud-config.php" ''
${optionalString requiresReadSecretFunction ''
···
[ 'path' => '${cfg.home}/apps', 'url' => '/apps', 'writable' => false ],
[ 'path' => '${cfg.home}/store-apps', 'url' => '/store-apps', 'writable' => true ],
642
-
${if (cfg.appstoreEnable != null)
643
-
then '''appstoreenabled' => ${lib.boolToString cfg.appstoreEnable},''
644
-
else (if (cfg.extraApps != { })
645
-
then '''appstoreenabled' => false,''
653
+
${optionalString (showAppStoreSetting) "'appstoreenabled' => ${renderedAppStoreSetting},"}
'datadirectory' => '${datadir}/data',
'skeletondirectory' => '${cfg.skeletonDirectory}',
${optionalString cfg.caching.apcu "'memcache.local' => '\\OC\\Memcache\\APCu',"}
···
ln -sf ${cfg.package}/apps ${cfg.home}/
732
-
rm -rf ${cfg.home}/nix-apps
734
-
#Install extra apps
735
-
ln -sfT ${pkgs.linkFarm "nix-apps" (lib.mapAttrsToList (name: target: {name=name; path=target;}) cfg.extraApps)} ${cfg.home}/nix-apps
740
+
# Install extra apps
742
+
${pkgs.linkFarm "nix-apps"
743
+
(mapAttrsToList (name: path: { inherit name path; }) cfg.extraApps)} \
744
+
${cfg.home}/nix-apps
# create nextcloud directories.
# if the directories exist already with wrong permissions, we fix that
···
${optionalString (cfg.extraAppsEnable && cfg.extraApps != { }) ''
# Try to enable apps (don't fail when one of them cannot be enabled , eg. due to incompatible version)
760
-
${occ}/bin/nextcloud-occ app:enable ${builtins.concatStringsSep " " ( lib.mapAttrsToList (name: target: "${name}") cfg.extraApps)}
769
+
${occ}/bin/nextcloud-occ app:enable ${concatStringsSep " " (attrNames cfg.extraApps)}
${occSetTrustedDomainsCmd}