From d39af81e7051d774418247a3091f77ad1df09556 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charlotte=20=F0=9F=A6=9D=20Delenk?= Date: Fri, 29 Jul 2022 08:06:26 +0100 Subject: [PATCH] add support for vscode-server --- config/programs/vscode/default.nix | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/config/programs/vscode/default.nix b/config/programs/vscode/default.nix index 8c0d0391..ac208162 100644 --- a/config/programs/vscode/default.nix +++ b/config/programs/vscode/default.nix @@ -1,4 +1,4 @@ -{pkgs, ...}: { +{ pkgs, lib, ... }: { programs.vscode = { enable = true; mutableExtensionsDir = true; @@ -54,7 +54,7 @@ "C_Cpp.errorSquiggles" = "Disabled"; "clang-tidy.executable" = "${pkgs.llvmPackages_latest.clang-unwrapped}/bin/clang-tidy"; "cmake.cmakePath" = "${pkgs.cmake}/bin/cmake"; - "github.copilot.enable" = {"*" = true;}; + "github.copilot.enable" = { "*" = true; }; "crates.listPreReleases" = true; "css.format.spaceAroundSelectorSeparator" = true; "less.format.spaceAroundSelectorSeparator" = true; @@ -70,4 +70,20 @@ "redhat.telemetry.enabled" = false; # FUCK OFF }; }; + home.activation.vscode-server = lib.hm.dag.entryAfter [ "write-boundary" ] '' + if test -f ~/.vscode-server; then + if test -f "~/.vscode/extensions"; then + if ! test -L "~/.vscode-server/extensions"; then + $DRY_RUN_CMD ln -s $VERBOSE_ARG ~/.vscode/extensions ~/.vscode-server/ + fi + fi + if test -f "~/vscode-server/bin"; then + for f (~/.vscode-server/bin/*/node); do + if ! test -L $f; then + $DRY_RUN_CMD ln -sf $VERBOSE_ARG ${pkgs.nodejs}/bin/node $f + fi + done + fi + fi + ''; }