nur-packages/pkgs/build-support/jetbrains/plugin.nix
xeals 3c8d8f0347
jetbrains: move to auto-generated plugins
Some edge cases but appears to work on my machine (TM).

Still TODO is setting up the job to generate and commit updates.
2021-01-25 15:27:16 +11:00

42 lines
811 B
Nix

{ lib
, stdenv
, fetchzip
, jetbrainsPlatforms
}:
{ plugid
, pname
, version
, ...
}@args:
let
defaultMeta = {
broken = false;
} // lib.optionalAttrs ((args.src.meta.homepage or "") != "") {
homepage = args.src.meta.homepage;
} // lib.optionalAttrs ((args.src.meta.description or "") != "") {
description = args.src.meta.description;
} // lib.optionalAttrs ((args.src.meta.license or {}) != {}) {
license = args.src.meta.license;
};
in
stdenv.mkDerivation (args // {
passthru = { inherit jetbrainsPlatforms; };
dontUnpack = lib.any (lib.hasSuffix ".jar") args.src.urls;
installPhase = ''
mkdir $out
cp -r * $out/
'';
meta = {
inherit (args.meta) license description;
homepage = if (args.meta.homepage == "") then null else args.meta.homepage;
};
})