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

38 lines
634 B
Nix

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