1 { varDir ? "/var/lib/nextcloud", lib, stdenv, fetchurl }:
3 buildApp = { appName, version, url, sha256, installPhase ? "mkdir -p $out && cp -R . $out/" }:
4 stdenv.mkDerivation rec {
5 name = "nextcloud-app-${appName}-${version}";
7 phases = "unpackPhase installPhase";
9 src = fetchurl { inherit url sha256; };
10 passthru.appName = appName;
12 withApps = apps: package.overrideAttrs(old: {
13 name = "${old.name}-with-apps";
15 installPhase = old.installPhase + (
16 builtins.concatStringsSep "\n" (
17 map (value: "ln -sf ${value} $out/apps/${value.appName}") apps
20 passthru.withApps = moreApps: old.withApps (moreApps ++ apps);
23 package = stdenv.mkDerivation rec {
24 name = "nextcloud-${version}";
28 url = "https://download.nextcloud.com/server/releases/${name}.tar.bz2";
29 sha256 = "0xwg7p31y1pkjk1pzygh9shpqxnfkafrab52j7in7xblq53v0zgq";
36 ln -sf ${varDir}/config $out/config
41 inherit buildApp withApps varDir;
44 description = "Sharing solution for files, calendars, contacts and more";
45 homepage = https://nextcloud.com;
46 maintainers = with lib.maintainers; [ schneefux bachp globin fpletz ];
47 license = lib.licenses.agpl3Plus;
48 platforms = with lib.platforms; unix;