about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/editors/vscode/extensions/ms-vsliveshare.vsliveshare/default.nix
blob: 209ee1d95a9aceeebff514519fdfa1add5714e8e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# Based on previous attempts:
#  -  <https://github.com/msteen/nixos-vsliveshare/blob/master/pkgs/vsliveshare/default.nix>
#  -  <https://github.com/NixOS/nixpkgs/issues/41189>
{ lib, gccStdenv, vscode-utils
, autoPatchelfHook, bash, makeWrapper
, curl, gcc, libsecret, libunwind, libX11, lttng-ust, util-linux
, desktop-file-utils, xsel
}:

let
  # https://docs.microsoft.com/en-us/visualstudio/liveshare/reference/linux#install-prerequisites-manually
  libs = [
    # Credential Storage
    libsecret

    # NodeJS
    libX11

    # https://github.com/flathub/com.visualstudio.code.oss/issues/11#issuecomment-392709170
    libunwind
    lttng-ust
    curl

    # General
    gcc.cc.lib
    util-linux # libuuid
  ];

in ((vscode-utils.override { stdenv = gccStdenv; }).buildVscodeMarketplaceExtension {
  mktplcRef = {
    name = "vsliveshare";
    publisher = "ms-vsliveshare";
    version = "1.0.5834";
    sha256 = "sha256-+KfivY8W1VtUxhdXuUKI5e1elo6Ert1Tsf4xVXsKB3Y=";
  };
}).overrideAttrs({ buildInputs ? [], ... }: {
  buildInputs = buildInputs ++ libs;

  # Using a patch file won't work, because the file changes too often, causing the patch to fail on most updates.
  # Rather than patching the calls to functions, we modify the functions to return what we want,
  # which is less likely to break in the future.
  postPatch = ''
    substituteInPlace extension.js \
      --replace "'xsel'" "'${xsel}/bin/xsel'"
  '';

  meta = {
    description = "Live Share lets you achieve greater confidence at speed by streamlining collaborative editing, debugging, and more in real-time during development";
    homepage = "https://aka.ms/vsls-docs";
    license = lib.licenses.unfree;
    maintainers = [ lib.maintainers.jraygauthier lib.maintainers.V ];
    platforms = [ "x86_64-linux" ];
  };
})