From bd11afec4ff257b076c3c54c2a99c76910bd51fb Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Tue, 24 Nov 2020 11:03:58 -0800 Subject: [PATCH] vscode-extensions: fix aliases --- pkgs/misc/vscode-extensions/default.nix | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/pkgs/misc/vscode-extensions/default.nix b/pkgs/misc/vscode-extensions/default.nix index 0228ee9a1e98..bc00f82f19b7 100644 --- a/pkgs/misc/vscode-extensions/default.nix +++ b/pkgs/misc/vscode-extensions/default.nix @@ -10,7 +10,7 @@ let # So an extension's attribute name should be of the form: # "${mktplcRef.publisher}.${mktplcRef.name}". # - self = stdenv.lib.mapAttrs (_n: stdenv.lib.recurseIntoAttrs) + baseExtensions = self: stdenv.lib.mapAttrs (_n: stdenv.lib.recurseIntoAttrs) { alanz.vscode-hie-server = buildVscodeMarketplaceExtension { @@ -245,11 +245,19 @@ let llvm-org.lldb-vscode = llvmPackages_8.lldb; WakaTime.vscode-wakatime = callPackage ./wakatime {}; - } // lib.optionalAttrs (config.allowAliases or true) ( - with self; { + }; + + aliases = self: super: { # aliases - ms-vscode.Go = golang.Go; - } - ); + ms-vscode = lib.recursiveUpdate super.ms-vscode { inherit (super.golang) Go; }; + }; + + # TODO: add overrides overlay, so that we can have a generated.nix + # then apply extension specific modifcations to packages. + + # overlays will be applied left to right, overrides should come after aliases. + overlays = lib.optionals (config.allowAliases or true) [ aliases ]; + + toFix = lib.foldl' (lib.flip lib.extends) baseExtensions overlays; in -self + lib.fix toFix