]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - nixops/modules/websites/tools/cloud/nextcloud.nix
Move nextcloud configuration to var dir
[perso/Immae/Config/Nix.git] / nixops / modules / websites / tools / cloud / nextcloud.nix
index 1e770b8b5b7c8a5efe2aa98bf9cfc92950f770e2..0185b0f0c29f843e3b42e80d2d7fadb9a65c05d2 100644 (file)
@@ -146,7 +146,6 @@ let
         'overwrite.cli.url' => 'https://cloud.immae.eu',
         'ldapIgnoreNamingRules' => false,
         'ldapProviderFactory' => '\\OCA\\User_LDAP\\LDAPProviderFactory',
-        'config_is_read_only' => true,
       );
       '';
     config = stdenv.mkDerivation rec {
@@ -172,7 +171,7 @@ let
         mkdir -p $out/
         cp -R . $out/
         rm -r $out/config
-        ln -sf ${config} $out/config
+        ln -sf ../../../../../${varDir}/config $out/config
         ${builtins.concatStringsSep "\n" (
           lib.attrsets.mapAttrsToList (name: value: "ln -sf ${value} $out/apps/${name}") apps
         )}
@@ -191,6 +190,11 @@ let
       text = ''
         install -m 0755 -o ${apache.user} -g ${apache.group} -d ${varDir}
         install -m 0750 -o ${apache.user} -g ${apache.group} -d ${varDir}/phpSessions
+        if [ ! -e ${varDir}/config ]; then
+          cp -a ${config} ${varDir}/config
+          chown -R ${apache.user}:${apache.group} ${varDir}/config
+          chmod -R u+w ${varDir}/config
+        fi
       '';
     };
     apache = {