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.
This commit is contained in:
33
pkgs/build-support/jetbrains/plugin.nix
Normal file
33
pkgs/build-support/jetbrains/plugin.nix
Normal file
@ -0,0 +1,33 @@
|
||||
{ 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}";
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user