diff options
author | éclairevoyant <848000+eclairevoyant@users.noreply.github.com> | 2024-05-01 05:53:48 -0400 |
---|---|---|
committer | éclairevoyant <848000+eclairevoyant@users.noreply.github.com> | 2024-05-01 06:00:27 -0400 |
commit | 7bf9febfa6271012b1ef86647a3a06f06875fdcf (patch) | |
tree | db16e41265cf798e17fbeefc5a50f2818f36b04d /pkgs/applications/editors/vscode/extensions/ms-python.python | |
parent | c10b1bb002e7414ecf7c9d9e5f7ebaeaeae32c92 (diff) |
vscode-extensions.*: format with nixfmt (RFC 166)
Diffstat (limited to 'pkgs/applications/editors/vscode/extensions/ms-python.python')
-rw-r--r-- | pkgs/applications/editors/vscode/extensions/ms-python.python/default.nix | 82 |
1 files changed, 47 insertions, 35 deletions
diff --git a/pkgs/applications/editors/vscode/extensions/ms-python.python/default.nix b/pkgs/applications/editors/vscode/extensions/ms-python.python/default.nix index 25091b95efc4b..67a96652b6ed6 100644 --- a/pkgs/applications/editors/vscode/extensions/ms-python.python/default.nix +++ b/pkgs/applications/editors/vscode/extensions/ms-python.python/default.nix @@ -1,19 +1,20 @@ -{ lib -, vscode-utils -, icu -, python3 +{ + lib, + vscode-utils, + icu, + python3, # When `true`, the python default setting will be fixed to specified. # Use version from `PATH` for default setting otherwise. # Defaults to `false` as we expect it to be project specific most of the time. -, pythonUseFixed ? false + pythonUseFixed ? false, # For updateScript -, writeScript -, bash -, curl -, coreutils -, gnused -, jq -, nix + writeScript, + bash, + curl, + coreutils, + gnused, + jq, + nix, }: vscode-utils.buildVscodeMarketplaceExtension rec { @@ -33,33 +34,37 @@ vscode-utils.buildVscodeMarketplaceExtension rec { jedi-language-server ]; - postPatch = '' - # remove bundled python deps and use libs from nixpkgs - rm -r pythonFiles/lib - mkdir -p pythonFiles/lib/python/ - ln -s ${python3.pkgs.debugpy}/lib/*/site-packages/debugpy pythonFiles/lib/python/ - buildPythonPath "$propagatedBuildInputs" - for i in pythonFiles/*.py; do - patchPythonScript "$i" - done - '' + lib.optionalString pythonUseFixed '' - # Patch `packages.json` so that nix's *python* is used as default value for `python.pythonPath`. - substituteInPlace "./package.json" \ - --replace "\"default\": \"python\"" "\"default\": \"${python3.interpreter}\"" - ''; + postPatch = + '' + # remove bundled python deps and use libs from nixpkgs + rm -r pythonFiles/lib + mkdir -p pythonFiles/lib/python/ + ln -s ${python3.pkgs.debugpy}/lib/*/site-packages/debugpy pythonFiles/lib/python/ + buildPythonPath "$propagatedBuildInputs" + for i in pythonFiles/*.py; do + patchPythonScript "$i" + done + '' + + lib.optionalString pythonUseFixed '' + # Patch `packages.json` so that nix's *python* is used as default value for `python.pythonPath`. + substituteInPlace "./package.json" \ + --replace "\"default\": \"python\"" "\"default\": \"${python3.interpreter}\"" + ''; passthru.updateScript = writeScript "update" '' #! ${bash}/bin/bash set -eu -o pipefail - export PATH=${lib.makeBinPath [ - curl - coreutils - gnused - jq - nix - ]} + export PATH=${ + lib.makeBinPath [ + curl + coreutils + gnused + jq + nix + ] + } api=$(curl -s 'https://marketplace.visualstudio.com/_apis/public/gallery/extensionquery' \ -H 'accept: application/json;api-version=3.0-preview.1' \ @@ -82,7 +87,14 @@ vscode-utils.buildVscodeMarketplaceExtension rec { homepage = "https://github.com/Microsoft/vscode-python"; changelog = "https://github.com/microsoft/vscode-python/releases"; license = lib.licenses.mit; - platforms = [ "x86_64-linux" "aarch64-darwin" "x86_64-darwin" ]; - maintainers = [ lib.maintainers.jraygauthier lib.maintainers.jfchevrette ]; + platforms = [ + "x86_64-linux" + "aarch64-darwin" + "x86_64-darwin" + ]; + maintainers = [ + lib.maintainers.jraygauthier + lib.maintainers.jfchevrette + ]; }; } |