nixpkgs/pkgs/build-support/fetchnextcloudapp/default.nix
Maximilian Bosch 1ee008fcb5
nixos/nextcloud: fixup #119638
A few minor changes to get #119638 - nextcloud: add option to set
datadir and extensions - ready:

* `cfg.datadir` now gets `cfg.home` as default to make the type
  non-nullable.
* Enhanced the `basic` test to check the behavior with a custom datadir
  that's not `/var/lib/nextcloud`.
* Fix hashes for apps in option example.
* Simplify if/else for `appstoreenable` in override config.
* Simplify a few `mapAttrsToList`-expressions in
  `nextcloud-setup.service`.
2021-10-09 22:45:31 +02:00

37 lines
595 B
Nix

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