Skip to content

Commit

Permalink
fix(flake): apply overrides to the argument of buildVscodeMarketplace…
Browse files Browse the repository at this point in the history
…Extension
  • Loading branch information
deemp committed Aug 23, 2024
1 parent 2c1f15a commit 2621149
Showing 1 changed file with 11 additions and 18 deletions.
29 changes: 11 additions & 18 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -138,40 +138,33 @@
url,
...
}:
let
override =
(
let
overrides = (import ./overrides.nix { inherit pkgs; });
in
overrides.publisher or { }
).name or (x: x);
in
{
inherit name;
value = utils.buildVscodeMarketplaceExtension {
value = utils.buildVscodeMarketplaceExtension (override {
vsix = prev.fetchurl {
inherit url sha256;
name = "${name}-${version}.zip";
};
mktplcRef = {
inherit name version publisher;
};
};
});
}
))
# append extra extensions fetched from elsewhere to overwrite site extensions
(builtins.groupBy ({ value, ... }: value.vscodeExtPublisher))
# platform-specific extensions will overwrite universal extensions
# due to the sorting order of platforms in the Haskell script
(builtins.mapAttrs (_: builtins.foldl' (k: { name, value }: k // { ${name} = value; }) { }))
(lib.pipe (import ./overrides.nix { inherit pkgs; }) [
(lib.mapAttrsToList (
publisher:
lib.mapAttrsToList (
extension: update: {
path = [
publisher
extension
];
update = x: x.overrideAttrs update;
}
)
))
lib.flatten
lib.updateManyAttrsByPath
])
];
mkSet =
attrs@{
Expand Down

0 comments on commit 2621149

Please sign in to comment.