Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions doc/release-notes/rl-2605.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@

- All Log4Shell vulnerability scanners were removed, as they were all unmaintained upstream and are no longer relevant given that the vulnerability has been fixed upstream for several years.

- Plugins for the JetBrains IDEs have been removed from Nixpkgs.

- `jetbrains.plugins.addPlugins` no longer supports plugin names or ID strings.
You can still use `addPlugins` with plugin derivations, such as plugins packaged outside of Nixpkgs.

- `asio` (standalone version of `boost::asio`) has been updated from 1.24.0 to 1.36.0. Some breaking changes were introduced between these
two versions, and the one affected most was the removal of `asio::io_service` in favor of `asio::io_context` in 1.33.0. `asio_1_32_0` is
retained for packages that have not completed migration. `asio_1_10` has been removed as no packages depend on it anymore.
Expand Down
4 changes: 0 additions & 4 deletions pkgs/applications/editors/jetbrains/bin/update_bin.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,3 @@ def update_products(products):
# Commit the result
logging.info("#### Committing changes... ####")
subprocess.run(['git', 'commit', f'-m{commitMessage}', '--', f'{versions_file_path}'], check=True)

logging.info("#### Updating plugins ####")
plugin_script = current_path.joinpath("../plugins/update_plugins.py").resolve()
subprocess.call(plugin_script)
82 changes: 4 additions & 78 deletions pkgs/applications/editors/jetbrains/plugins/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,92 +8,18 @@
glib,
darwin,
}:

let
pluginsJson = builtins.fromJSON (builtins.readFile ./plugins.json);
specialPluginsInfo = callPackage ./specialPlugins.nix { };
fetchPluginSrc =
url: hash:
let
isJar = lib.hasSuffix ".jar" url;
fetcher = if isJar then fetchurl else fetchzip;
in
fetcher {
executable = isJar;
inherit url hash;
};
files = builtins.mapAttrs (key: value: fetchPluginSrc key value) pluginsJson.files;
ids = builtins.attrNames pluginsJson.plugins;

mkPlugin =
id: file:
if !specialPluginsInfo ? "${id}" then
files."${file}"
else
stdenv.mkDerivation (
{
name = "jetbrains-plugin-${id}";
installPhase = ''
runHook preInstall
mkdir -p $out && cp -r . $out
runHook postInstall
'';
src = files."${file}";
}
// specialPluginsInfo."${id}"
);

selectFile =
id: ide: build:
let
# Allow all PyCharm/IDEA plugins for PyCharm/IDEA Community
# - TODO: Remove this special case once PyCharm/IDEA Community is removed
communityCheck =
(id != "pycharm-community" || builtins.elem ide pluginsJson.plugins.pycharm.compatible)
|| (id != "idea-community" || builtins.elem ide pluginsJson.plugins.idea.compatible);
in
if !communityCheck && !builtins.elem ide pluginsJson.plugins."${id}".compatible then
throw "Plugin with id ${id} does not support IDE ${ide}"
else if !pluginsJson.plugins."${id}".builds ? "${build}" then
throw "Jetbrains IDEs with build ${build} are not in nixpkgs. Try update_plugins.py with --with-build?"
else if pluginsJson.plugins."${id}".builds."${build}" == null then
throw "Plugin with id ${id} does not support build ${build}"
else
pluginsJson.plugins."${id}".builds."${build}";

byId = builtins.listToAttrs (
map (id: {
name = id;
value = ide: build: mkPlugin id (selectFile id ide build);
}) ids
);

byName = builtins.listToAttrs (
map (id: {
name = pluginsJson.plugins."${id}".name;
value = byId."${id}";
}) ids
);
in
{
# Only use if you know what youre doing
raw = { inherit files byId byName; };

tests = callPackage ./tests.nix { };

addPlugins =
ide: unprocessedPlugins:
let
processPlugin =
plugin:
if lib.isDerivation plugin then
plugin
else if byId ? "${plugin}" then
byId."${plugin}" ide.pname ide.buildNumber
else if byName ? "${plugin}" then
byName."${plugin}" ide.pname ide.buildNumber
else
throw "Could not resolve plugin ${plugin}";
# We can remove this check and just asume plugins to be derivations starting with 26.11.
lib.throwIfNot (lib.isDerivation plugin)
"addPlugins no longer supports resolving plugins by name or id strings. Please supply a derivation instead"
plugin;

plugins = map processPlugin unprocessedPlugins;
in
Expand Down
Loading
Loading