The `name` & `version` attributes only existed in a previous form of the API before it was switched over to using `fetchzip` & `applyPatches`[1]. The attributes existed to be able to throw an evaluation error with upgrade instructions when this was used. However, this was before 22.11, so this shouldn't be in use anymore (and if somebody is doing a migration from a very old NixOS, this is still documented in the 22.11 release-notes[2]). Anyways, this simplifies the code a little bit and also having both `appName`/`appVersion` and `name`/`version` in there is quite confusing. But still, I figured it's less confusing to not re-use attributes that were deprecated in the past, hence the alternative naming. [1]3ca9b9a8ad
[2]d41b381310
36 lines
861 B
Nix
36 lines
861 B
Nix
{ stdenv, fetchzip, applyPatches, lib, ... }:
|
|
{ url
|
|
, sha256
|
|
, appName ? null
|
|
, appVersion ? null
|
|
, license
|
|
, patches ? [ ]
|
|
, description ? null
|
|
, homepage ? null
|
|
}:
|
|
applyPatches ({
|
|
inherit patches;
|
|
src = fetchzip {
|
|
inherit url sha256;
|
|
postFetch = ''
|
|
pushd $out &>/dev/null
|
|
if [ ! -f ./appinfo/info.xml ]; then
|
|
echo "appinfo/info.xml doesn't exist in $out, aborting!"
|
|
exit 1
|
|
fi
|
|
popd &>/dev/null
|
|
'';
|
|
meta = {
|
|
license = lib.licenses.${license};
|
|
longDescription = description;
|
|
inherit homepage;
|
|
} // lib.optionalAttrs (description != null) {
|
|
longDescription = description;
|
|
} // lib.optionalAttrs (homepage != null) {
|
|
inherit homepage;
|
|
};
|
|
};
|
|
} // lib.optionalAttrs (appName != null && appVersion != null) {
|
|
name = "nextcloud-app-${appName}-${appVersion}";
|
|
})
|