nixpkgs/pkgs/build-support/fetchnextcloudapp/default.nix
Robbert Gurdeep Singh 18b18929d7
nixos/nextcloud: add settings to manage nextcloud apps
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.
2021-10-09 20:33:16 +02:00

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
'';
}