From 679b95b2a507c075fb0440da69f4de58bd863002 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20M=C3=B6ller?= Date: Tue, 25 Feb 2025 09:20:04 +0100 Subject: [PATCH] vscode-extensions.charliermarsh.ruff: replace the bundled ruff binary The extension ships with a precompiled binary by default, which is not compatible with NixOS. --- .../vscode/extensions/charliermarsh.ruff/default.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkgs/applications/editors/vscode/extensions/charliermarsh.ruff/default.nix b/pkgs/applications/editors/vscode/extensions/charliermarsh.ruff/default.nix index d54b702e5175..b7a97cc87c54 100644 --- a/pkgs/applications/editors/vscode/extensions/charliermarsh.ruff/default.nix +++ b/pkgs/applications/editors/vscode/extensions/charliermarsh.ruff/default.nix @@ -2,6 +2,7 @@ stdenvNoCC, lib, vscode-utils, + ruff, }: vscode-utils.buildVscodeMarketplaceExtension { @@ -33,6 +34,15 @@ vscode-utils.buildVscodeMarketplaceExtension { } // sources.${stdenvNoCC.system} or (throw "Unsupported system ${stdenvNoCC.system}"); + postInstall = '' + test -x "$out/$installPrefix/bundled/libs/bin/ruff" || { + echo "Replacing the bundled ruff binary failed, because 'bundled/libs/bin/ruff' is missing." + echo "Update the package to the match the new path/behavior." + exit 1 + } + ln -sf ${lib.getExe ruff} "$out/$installPrefix/bundled/libs/bin/ruff" + ''; + meta = { license = lib.licenses.mit; changelog = "https://marketplace.visualstudio.com/items/charliermarsh.ruff/changelog";