diff options
Diffstat (limited to 'pkgs/webapps/nextcloud/default.nix')
-rw-r--r-- | pkgs/webapps/nextcloud/default.nix | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/pkgs/webapps/nextcloud/default.nix b/pkgs/webapps/nextcloud/default.nix deleted file mode 100644 index 5017fd2..0000000 --- a/pkgs/webapps/nextcloud/default.nix +++ /dev/null | |||
@@ -1,69 +0,0 @@ | |||
1 | { varDir ? "/var/lib/nextcloud", nextcloudVersion ? 18, otherConfig ? {}, lib, stdenv, callPackage, fetchzip, fetchurl }: | ||
2 | let | ||
3 | appNames = [ | ||
4 | "apporder" "audioplayer" "bookmarks" "calendar" "carnet" "circles" | ||
5 | "contacts" "cookbook" "deck" "extract" "files_markdown" | ||
6 | "files_readmemd" "flowupload" "gpxedit" "gpxpod" "impersonate" | ||
7 | "keeweb" "maps" "metadata" "music" "notes" "ocsms" "passman" "polls" | ||
8 | "spreed" "social" "tasks" | ||
9 | ]; | ||
10 | allApps = lib.attrsets.genAttrs appNames | ||
11 | (name: callPackage (./apps + "/${name}.nix") { inherit buildApp nextcloudVersion; }); | ||
12 | buildApp = { appName, version, url, sha256, zip ? false, otherConfig ? {}, installPhase ? "mkdir -p $out && cp -R . $out/" }: | ||
13 | stdenv.mkDerivation rec { | ||
14 | name = "nextcloud-app-${appName}-${version}"; | ||
15 | inherit version; | ||
16 | phases = "unpackPhase installPhase"; | ||
17 | inherit installPhase; | ||
18 | src = (if zip then fetchzip else fetchurl) { inherit url sha256; }; | ||
19 | passthru = { | ||
20 | inherit appName otherConfig; | ||
21 | }; | ||
22 | }; | ||
23 | toPassthru = pkg: apps: otherConfig: { | ||
24 | inherit apps otherConfig allApps buildApp varDir; | ||
25 | withApps = withApps pkg; | ||
26 | }; | ||
27 | withApps = pkg: toApps: | ||
28 | let | ||
29 | apps = toApps allApps; | ||
30 | toInstallApp = n: '' | ||
31 | ln -sf ${n} $out/apps/${n.appName} | ||
32 | ''; | ||
33 | zipped = lib.attrsets.zipAttrs ([pkg.otherConfig or {}] ++ map (v: v.otherConfig) apps); | ||
34 | appConfigs = with lib.attrsets; with lib.lists; { | ||
35 | mimetypealiases = foldr (h: prev: prev // h) {} (zipped.mimetypealiases or []); | ||
36 | mimetypemapping = mapAttrs (_: v: unique (flatten v)) (zipAttrs (zipped.mimetypemapping or [])); | ||
37 | }; | ||
38 | newNextcloud = pkg.overrideAttrs(old: { | ||
39 | installPhase = old.installPhase + "\n" + builtins.concatStringsSep "\n" (map toInstallApp apps); | ||
40 | passthru = toPassthru newNextcloud (pkg.apps ++ apps) appConfigs; | ||
41 | }); | ||
42 | in newNextcloud; | ||
43 | package = stdenv.mkDerivation rec { | ||
44 | name = "nextcloud-${version}"; | ||
45 | version = "${builtins.toString nextcloudVersion}.0.4"; | ||
46 | |||
47 | src = fetchurl { | ||
48 | url = "https://download.nextcloud.com/server/releases/${name}.tar.bz2"; | ||
49 | sha256 = "0aa3f4xbkzacfw0h9aic0ywk5mqlwka83qaszizj8lmk68kf3n7s"; | ||
50 | }; | ||
51 | |||
52 | installPhase = '' | ||
53 | mkdir -p $out/ | ||
54 | cp -R . $out/ | ||
55 | rm -r $out/config | ||
56 | '' + lib.optionalString (varDir != null) '' | ||
57 | ln -sf ${varDir}/config $out/config | ||
58 | ''; | ||
59 | |||
60 | passthru = toPassthru package [] otherConfig; | ||
61 | meta = { | ||
62 | description = "Sharing solution for files, calendars, contacts and more"; | ||
63 | homepage = https://nextcloud.com; | ||
64 | maintainers = with lib.maintainers; [ schneefux bachp globin fpletz ]; | ||
65 | license = lib.licenses.agpl3Plus; | ||
66 | platforms = with lib.platforms; unix; | ||
67 | }; | ||
68 | }; | ||
69 | in package | ||