nixpkgs/pkgs/servers/web-apps/moodle/moodle-utils.nix

33 lines
495 B
Nix
Raw Normal View History

2020-06-18 10:34:31 +00:00
{ stdenv, unzip, ... }:
let
buildMoodlePlugin = a@{
name,
src,
pluginType,
configuraPhase ? ":",
buildPhase ? ":",
buildInputs ? [ ],
...
}:
stdenv.mkDerivation (a // {
name = name;
inherit pluginType;
inherit configuraPhase buildPhase;
buildInputs = [ unzip ] ++ buildInputs;
installPhase = ''
runHook preInstall
mkdir -p "$out"
mv * $out/
runHook postInstall
'';
});
in {
inherit buildMoodlePlugin;
}