Loading pkgs/applications/editors/vscode/extensions/vscode-utils.nix +53 −53 Original line number Diff line number Diff line Loading @@ -9,10 +9,15 @@ jq, }: let buildVscodeExtension = a@{ buildVscodeExtension = lib.extendMkDerivation { constructDrv = stdenv.mkDerivation; excludeDrvArgNames = [ "vscodeExtUniqueId" ]; extendDrvArgs = finalAttrs: { pname ? null, # Only optional for backward compatibility. src, # Same as "Unique Identifier" on the extension's web page. # For the moment, only serve as unique extension dir. vscodeExtPublisher, Loading @@ -32,15 +37,8 @@ let passthru ? { }, ... }: stdenv.mkDerivation ( (removeAttrs a [ "vscodeExtUniqueId" "pname" ]) // (lib.optionalAttrs (pname != null) { { pname = "vscode-extension-${pname}"; }) // { passthru = passthru // { inherit vscodeExtPublisher vscodeExtName vscodeExtUniqueId; Loading @@ -57,12 +55,12 @@ let # If other directories are present but `sourceRoot` is unset, the unpacker phase fails. sourceRoot = "extension"; # This cannot be removed, it is used by some extensions. installPrefix = "share/vscode/extensions/${vscodeExtUniqueId}"; nativeBuildInputs = [ unzip ] ++ nativeBuildInputs; installPhase = '' runHook preInstall mkdir -p "$out/$installPrefix" Loading @@ -70,14 +68,21 @@ let runHook postInstall ''; } ); }; }; fetchVsixFromVscodeMarketplace = mktplcExtRef: fetchurl (import ./mktplcExtRefToFetchArgs.nix mktplcExtRef); buildVscodeMarketplaceExtension = a@{ buildVscodeMarketplaceExtension = lib.extendMkDerivation { constructDrv = buildVscodeExtension; excludeDrvArgNames = [ "mktplcRef" "vsix" ]; extendDrvArgs = finalAttrs: { name ? "", src ? null, vsix ? null, Loading @@ -86,20 +91,15 @@ let }: assert "" == name; assert null == src; buildVscodeExtension ( (removeAttrs a [ "mktplcRef" "vsix" ]) // { { inherit (mktplcRef) version; pname = "${mktplcRef.publisher}-${mktplcRef.name}"; version = mktplcRef.version; src = if (vsix != null) then vsix else fetchVsixFromVscodeMarketplace mktplcRef; vscodeExtPublisher = mktplcRef.publisher; vscodeExtName = mktplcRef.name; vscodeExtUniqueId = "${mktplcRef.publisher}.${mktplcRef.name}"; } ); }; }; mktplcRefAttrList = [ "name" Loading Loading
pkgs/applications/editors/vscode/extensions/vscode-utils.nix +53 −53 Original line number Diff line number Diff line Loading @@ -9,10 +9,15 @@ jq, }: let buildVscodeExtension = a@{ buildVscodeExtension = lib.extendMkDerivation { constructDrv = stdenv.mkDerivation; excludeDrvArgNames = [ "vscodeExtUniqueId" ]; extendDrvArgs = finalAttrs: { pname ? null, # Only optional for backward compatibility. src, # Same as "Unique Identifier" on the extension's web page. # For the moment, only serve as unique extension dir. vscodeExtPublisher, Loading @@ -32,15 +37,8 @@ let passthru ? { }, ... }: stdenv.mkDerivation ( (removeAttrs a [ "vscodeExtUniqueId" "pname" ]) // (lib.optionalAttrs (pname != null) { { pname = "vscode-extension-${pname}"; }) // { passthru = passthru // { inherit vscodeExtPublisher vscodeExtName vscodeExtUniqueId; Loading @@ -57,12 +55,12 @@ let # If other directories are present but `sourceRoot` is unset, the unpacker phase fails. sourceRoot = "extension"; # This cannot be removed, it is used by some extensions. installPrefix = "share/vscode/extensions/${vscodeExtUniqueId}"; nativeBuildInputs = [ unzip ] ++ nativeBuildInputs; installPhase = '' runHook preInstall mkdir -p "$out/$installPrefix" Loading @@ -70,14 +68,21 @@ let runHook postInstall ''; } ); }; }; fetchVsixFromVscodeMarketplace = mktplcExtRef: fetchurl (import ./mktplcExtRefToFetchArgs.nix mktplcExtRef); buildVscodeMarketplaceExtension = a@{ buildVscodeMarketplaceExtension = lib.extendMkDerivation { constructDrv = buildVscodeExtension; excludeDrvArgNames = [ "mktplcRef" "vsix" ]; extendDrvArgs = finalAttrs: { name ? "", src ? null, vsix ? null, Loading @@ -86,20 +91,15 @@ let }: assert "" == name; assert null == src; buildVscodeExtension ( (removeAttrs a [ "mktplcRef" "vsix" ]) // { { inherit (mktplcRef) version; pname = "${mktplcRef.publisher}-${mktplcRef.name}"; version = mktplcRef.version; src = if (vsix != null) then vsix else fetchVsixFromVscodeMarketplace mktplcRef; vscodeExtPublisher = mktplcRef.publisher; vscodeExtName = mktplcRef.name; vscodeExtUniqueId = "${mktplcRef.publisher}.${mktplcRef.name}"; } ); }; }; mktplcRefAttrList = [ "name" Loading