nur-packages/pkgs/build-support/jetbrains/plugin.nix

34 lines
554 B
Nix
Raw Normal View History

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