From 6ac5ee96c6d0770943115137dce2d0b64baed97d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charlotte=20=F0=9F=A6=9D=20Delenk?= Date: Sat, 23 Jul 2022 20:01:04 +0100 Subject: [PATCH] add more extensions --- config/programs/vscode/default.nix | 6 +- packages/rust-analyzer.nix | 91 ------------------------------ 2 files changed, 4 insertions(+), 93 deletions(-) delete mode 100644 packages/rust-analyzer.nix diff --git a/config/programs/vscode/default.nix b/config/programs/vscode/default.nix index d9c8873b..d4802922 100644 --- a/config/programs/vscode/default.nix +++ b/config/programs/vscode/default.nix @@ -3,8 +3,10 @@ enable = true; mutableExtensionsDir = false; extensions = - [ - (pkgs.callPackage ../../../packages/rust-analyzer.nix {}) + with pkgs.vscode-extensions; [ + rust-lang.rust-analyzer + xaver.clang-format + github.vscode-pull-request-github ] ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace (import ./extensions.nix).extensions; userSettings = { diff --git a/packages/rust-analyzer.nix b/packages/rust-analyzer.nix deleted file mode 100644 index 55483932..00000000 --- a/packages/rust-analyzer.nix +++ /dev/null @@ -1,91 +0,0 @@ -{ - lib, - fetchFromGitHub, - vscode-utils, - jq, - rust-analyzer, - nodePackages, - moreutils, - esbuild, - pkg-config, - libsecret, - stdenv, - darwin, - setDefaultServerPath ? true, -}: let - pname = "rust-analyzer"; - publisher = "matklad"; - - # Use the plugin version as in vscode marketplace, updated by update script. - inherit (vsix) version; - - releaseTag = "2022-05-02"; - - src = fetchFromGitHub { - owner = "rust-analyzer"; - repo = "rust-analyzer"; - rev = releaseTag; - sha256 = "sha256-5kAbd/tTc9vkr27ar44hnpXdS0vQg0OLJUMlp0FBjqA="; - }; - - build-deps = nodePackages."rust-analyzer-build-deps-../../applications/editors/vscode/extensions/rust-analyzer/build-deps"; - # FIXME: Making a new derivation to link `node_modules` and run `npm run package` - # will cause a build failure. - vsix = build-deps.override { - src = "${src}/editors/code"; - outputs = ["vsix" "out"]; - - inherit releaseTag; - - nativeBuildInputs = - [ - jq - moreutils - esbuild - # Required by `keytar`, which is a dependency of `vsce`. - pkg-config - libsecret - ] - ++ lib.optionals stdenv.isDarwin [ - darwin.apple_sdk.frameworks.AppKit - darwin.apple_sdk.frameworks.Security - ]; - - # Follows https://github.com/rust-analyzer/rust-analyzer/blob/41949748a6123fd6061eb984a47f4fe780525e63/xtask/src/dist.rs#L39-L65 - postInstall = '' - jq ' - .version = $ENV.version | - .releaseTag = $ENV.releaseTag | - .enableProposedApi = false | - walk(del(.["$generated-start"]?) | del(.["$generated-end"]?)) - ' package.json | sponge package.json - - mkdir -p $vsix - # vsce ask for continue due to missing LICENSE.md - # Should be removed after https://github.com/rust-analyzer/rust-analyzer/commit/acd5c1f19bf7246107aaae7b6fe3f676a516c6d2 - echo y | npx vsce package -o $vsix/${pname}.zip - ''; - }; -in - vscode-utils.buildVscodeExtension { - inherit version vsix; - name = "${pname}-${version}"; - src = "${vsix}/${pname}.zip"; - vscodeExtUniqueId = "${publisher}.${pname}"; - - nativeBuildInputs = lib.optionals setDefaultServerPath [jq moreutils]; - - preInstall = lib.optionalString setDefaultServerPath '' - jq '.contributes.configuration.properties."rust-analyzer.server.path".default = $s' \ - --arg s "${rust-analyzer}/bin/rust-analyzer" \ - package.json | sponge package.json - ''; - - meta = with lib; { - description = "An alternative rust language server to the RLS"; - homepage = "https://github.com/rust-analyzer/rust-analyzer"; - license = with licenses; [mit asl20]; - maintainers = with maintainers; []; - platforms = platforms.all; - }; - }