nixpkgs/pkgs/build-support/fetchnextcloudapp/default.nix
ajs124 0ce971e5d2 fetchnextcloudapp: name -> pname
this way name and the storepath contain the version, which can be useful
sometimes
2022-07-26 10:58:06 +02:00

33 lines
522 B
Nix

{ stdenv, fetchurl, ... }:
{ name
, url
, version
, sha256
, patches ? [ ]
}:
stdenv.mkDerivation {
pname = "nc-app-${name}";
inherit version patches;
src = fetchurl {
inherit url sha256;
};
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
'';
}