18b18929d7
Note the appstoreEnable which will prevent nextcloud form updating nix-managed apps. This is needed because nextcloud will store an other version of the app in /var/lib/nextcloud/store-apps and it will no longer be manageable.
39 lines
607 B
Nix
39 lines
607 B
Nix
{ stdenv, gnutar, findutils, fetchurl, ... }:
|
|
{ name
|
|
, url
|
|
, version
|
|
, sha256
|
|
, patches ? [ ]
|
|
}:
|
|
stdenv.mkDerivation {
|
|
name = "nc-app-${name}";
|
|
inherit version patches;
|
|
|
|
src = fetchurl {
|
|
url = url;
|
|
sha256 = sha256;
|
|
};
|
|
|
|
nativeBuildInputs = [
|
|
gnutar
|
|
findutils
|
|
];
|
|
|
|
unpackPhase = ''
|
|
tar -xzpf $src
|
|
'';
|
|
|
|
installPhase = ''
|
|
approot="$(dirname $(dirname $(find -path '*/appinfo/info.xml' | head -n 1)))"
|
|
|
|
if [ -d "$approot" ];
|
|
then
|
|
mv "$approot/" $out
|
|
chmod -R a-w $out
|
|
else
|
|
echo "Could not find appinfo/info.xml"
|
|
exit 1;
|
|
fi
|
|
'';
|
|
}
|