nixpkgs/pkgs/applications/editors/vscode/extensions/ms-vsliveshare.vsliveshare/default.nix
V 710ddf0ba9 vscode-extensions.*: use hash attribute for SRI hashes
This is a purely syntactical change and should not result in the
recompilation of any packages.

Change-Id: I07adad25402eb0cc84307cab80b74225a11df81d
2024-04-05 23:38:06 +02:00

55 lines
1.8 KiB
Nix

# 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.5900";
hash = "sha256-syVW/aS2ppJjg4OZaenzGM3lczt+sLy7prwsYFTDl9s=";
};
}).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" ];
};
})