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

34 lines
554 B
Nix
Raw Permalink Normal View History

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