anchor.diff:        cp ${owncloudConfig} ${config.dataDir}/config/config.php
         mkdir -p ${config.dataDir}/storage
         mkdir -p ${config.dataDir}/apps
  -      cp -r ${pkgs.owncloud}/apps/* ${config.dataDir}/apps/
  +      cp -r ${config.package}/apps/* ${config.dataDir}/apps/
         chmod -R ug+rw ${config.dataDir}
         chmod -R o-rwx ${config.dataDir}
         chown -R wwwrun:wwwrun ${config.dataDir}
  
positive.code:       ${pkgs.sudo}/bin/sudo -u postgres ${pkgs.postgresql}/bin/psql -h "/tmp" -U postgres -d ${config.dbName} -Atw -c "$QUERY" || true
      fi
  
      if [ -e ${pkgs.owncloud}/config/ca-bundle.crt ]; then
        cp -f ${pkgs.owncloud}/config/ca-bundle.crt ${config.dataDir}/config/
      fi
  
      ${php}/bin/php ${pkgs.owncloud}/occ upgrade >> ${config.dataDir}/upgrade.log || true
  
      chown wwwrun:wwwrun ${config.dataDir}/owncloud.log || true
  
  
negative.code:     { name = "OC_CONFIG_PATH"; value = "${config.dataDir}/config/"; }
    ];
  
    documentRoot = if config.urlPrefix == "" then config.package else null;
  
    enablePHP = true;
  
    options = {
  
      package = mkOption {
        type = types.package;
        default = pkgs.owncloud70;
        example = literalExample "pkgs.owncloud70";
        description = ''
            PostgreSQL package to use.
        '';
      };
  
      urlPrefix = mkOption {
        default = "";
  