Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{
2 stdenvNoCC,
3 lib,
4 vscode-utils,
5 ruff,
6 vscode-extension-update-script,
7}:
8
9vscode-utils.buildVscodeMarketplaceExtension {
10 mktplcRef =
11 let
12 sources = {
13 "x86_64-linux" = {
14 arch = "linux-x64";
15 hash = "sha256-+EiBEYZpJYjUMvVcNgs5pdXr1g8FB1ha2bKy29OPcSM=";
16 };
17 "x86_64-darwin" = {
18 arch = "darwin-x64";
19 hash = "sha256-ijy/ZVhVU1/ZrS1Fu3vuiThcjLuKSqf3lrgl8is54Co=";
20 };
21 "aarch64-linux" = {
22 arch = "linux-arm64";
23 hash = "sha256-mpUV/xN98Xi3B7ujotXK9T6xEfZWsQuWtvuPyufxfoY=";
24 };
25 "aarch64-darwin" = {
26 arch = "darwin-arm64";
27 hash = "sha256-YaNMN7887v3tFccoPBz7hVhpGbGtbys7e5D5GCBIe20=";
28 };
29 };
30 in
31 {
32 name = "ruff";
33 publisher = "charliermarsh";
34 version = "2025.24.0";
35 }
36 // sources.${stdenvNoCC.hostPlatform.system}
37 or (throw "Unsupported system ${stdenvNoCC.hostPlatform.system}");
38
39 postInstall = ''
40 test -x "$out/$installPrefix/bundled/libs/bin/ruff" || {
41 echo "Replacing the bundled ruff binary failed, because 'bundled/libs/bin/ruff' is missing."
42 echo "Update the package to the match the new path/behavior."
43 exit 1
44 }
45 ln -sf ${lib.getExe ruff} "$out/$installPrefix/bundled/libs/bin/ruff"
46 '';
47
48 passthru.updateScript = vscode-extension-update-script { };
49
50 meta = {
51 license = lib.licenses.mit;
52 changelog = "https://marketplace.visualstudio.com/items/charliermarsh.ruff/changelog";
53 description = "Visual Studio Code extension with support for the Ruff linter";
54 downloadPage = "https://marketplace.visualstudio.com/items?itemName=charliermarsh.ruff";
55 homepage = "https://github.com/astral-sh/ruff-vscode";
56 platforms = [
57 "aarch64-linux"
58 "aarch64-darwin"
59 "x86_64-linux"
60 "x86_64-darwin"
61 ];
62 maintainers = [ lib.maintainers.azd325 ];
63 };
64}