nur-packages/pkgs/build-support/jetbrains/plugin.nix
xeals 7959b877d9
jetbrains: rework following the Emacs builder
This commit moves a lot of the heavy lifting out of callPackage and back
into regular import, following conventions from upstream Nixpkgs. It
allows for a clearer and less magic definition of new packages,
particularly by downstream, as well, by exposing the *Build package
callers in the attribute set.
2020-10-18 17:47:48 +11:00

34 lines
554 B
Nix

{ lib
, stdenv
, fetchzip
, jetbrainsPlatforms
}:
{ pluginId
, pname
, version
, versionId
, sha256
, filename ? "${pname}-${version}.zip"
}:
stdenv.mkDerivation {
inherit pname version;
src = fetchzip {
inherit sha256;
url = "https://plugins.jetbrains.com/files/${toString pluginId}/${toString versionId}/${filename}";
};
passthru = { inherit jetbrainsPlatforms; };
installPhase = ''
mkdir $out
cp -r * $out/
'';
meta = {
homepage = "https://plugins.jetbrains.com/plugin/${pluginId}-${lib.toLower pname}";
};
}