at 18.09-beta 1.7 kB view raw
1{ lib, vscode-utils 2 3, pythonUseFixed ? false, python # When `true`, the python default setting will be fixed to specified. 4 # Use version from `PATH` for default setting otherwise. 5 # Defaults to `false` as we expect it to be project specific most of the time. 6, ctagsUseFixed ? true, ctags # When `true`, the ctags default setting will be fixed to specified. 7 # Use version from `PATH` for default setting otherwise. 8 # Defaults to `true` as usually not defined on a per projet basis. 9}: 10 11assert pythonUseFixed -> null != python; 12assert ctagsUseFixed -> null != ctags; 13 14let 15 pythonDefaultsTo = if pythonUseFixed then "${python}/bin/python" else "python"; 16 ctagsDefaultsTo = if ctagsUseFixed then "${ctags}/bin/ctags" else "ctags"; 17in 18 19vscode-utils.buildVscodeMarketplaceExtension { 20 mktplcRef = { 21 name = "python"; 22 publisher = "ms-python"; 23 version = "2018.7.0"; 24 sha256 = "0ab6ce722b23274a8f70d156f55d02123dd3b686397b11d4eec0831ec69dbec5"; 25 }; 26 27 postPatch = '' 28 # Patch `packages.json` so that nix's *python* is used as default value for `python.pythonPath`. 29 substituteInPlace "./package.json" \ 30 --replace "\"default\": \"python\"" "\"default\": \"${pythonDefaultsTo}\"" 31 32 # Patch `packages.json` so that nix's *ctags* is used as default value for `python.workspaceSymbols.ctagsPath`. 33 substituteInPlace "./package.json" \ 34 --replace "\"default\": \"ctags\"" "\"default\": \"${ctagsDefaultsTo}\"" 35 ''; 36 37 meta = with lib; { 38 license = licenses.mit; 39 maintainers = [ maintainers.jraygauthier ]; 40 }; 41}