mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-25 15:11:35 +00:00
1ee008fcb5
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`.
38 lines
595 B
Nix
38 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
|
|
'';
|
|
}
|