|
6 | 6 | ... |
7 | 7 | }: |
8 | 8 | { |
| 9 | + name ? |
| 10 | + if appName == null || appVersion == null then null else "nextcloud-app-${appName}-${appVersion}", |
9 | 11 | url, |
10 | 12 | hash ? "", |
11 | 13 | sha256 ? "", |
|
15 | 17 | license, |
16 | 18 | patches ? [ ], |
17 | 19 | description ? null, |
| 20 | + longDescription ? description, |
18 | 21 | homepage ? null, |
19 | 22 | maintainers ? [ ], |
20 | 23 | teams ? [ ], |
21 | 24 | unpack ? false, # whether to use fetchzip rather than fetchurl |
22 | 25 | }: |
23 | | -applyPatches ( |
24 | | - { |
25 | | - inherit patches; |
26 | | - src = (if unpack then fetchzip else fetchurl) { |
27 | | - inherit |
28 | | - url |
29 | | - hash |
30 | | - sha256 |
31 | | - sha512 |
32 | | - ; |
33 | | - meta = { |
34 | | - license = lib.licenses.${license}; |
35 | | - longDescription = description; |
36 | | - inherit homepage maintainers teams; |
37 | | - } |
38 | | - // lib.optionalAttrs (description != null) { |
39 | | - longDescription = description; |
40 | | - } |
41 | | - // lib.optionalAttrs (homepage != null) { |
42 | | - inherit homepage; |
43 | | - }; |
| 26 | +applyPatches { |
| 27 | + ${if name == null then null else "name"} = name; |
| 28 | + inherit patches; |
| 29 | + |
| 30 | + src = (if unpack then fetchzip else fetchurl) { |
| 31 | + inherit url; |
| 32 | + ${if hash == "" then null else "hash"} = hash; |
| 33 | + ${if sha256 == "" then null else "sha256"} = sha256; |
| 34 | + ${if sha512 == "" then null else "sha512"} = sha512; |
| 35 | + |
| 36 | + meta = { |
| 37 | + license = lib.licenses.${license}; |
| 38 | + ${if description == null then null else "description"} = description; |
| 39 | + ${if longDescription == null then null else "longDescription"} = longDescription; |
| 40 | + ${if homepage == null then null else "homepage"} = homepage; |
| 41 | + inherit maintainers teams; |
44 | 42 | }; |
45 | | - prePatch = '' |
46 | | - if [ ! -f ./appinfo/info.xml ]; then |
47 | | - echo "appinfo/info.xml doesn't exist in $out, aborting!" |
48 | | - exit 1 |
49 | | - fi |
50 | | - ''; |
51 | | - } |
52 | | - // lib.optionalAttrs (appName != null && appVersion != null) { |
53 | | - name = "nextcloud-app-${appName}-${appVersion}"; |
54 | | - } |
55 | | -) |
| 43 | + }; |
| 44 | + prePatch = '' |
| 45 | + if [ ! -f ./appinfo/info.xml ]; then |
| 46 | + echo "appinfo/info.xml doesn't exist in $out, aborting!" |
| 47 | + exit 1 |
| 48 | + fi |
| 49 | + ''; |
| 50 | +} |
0 commit comments