40 lines
1.6 KiB
Nix
40 lines
1.6 KiB
Nix
# this folder is for derivation overlays
|
|
{inputs, ...}: {
|
|
nixpkgs.overlays = [
|
|
inputs.nix-vscode-extensions.overlays.default
|
|
# Add noita_entangled_worlds from upstream flake to pkgs
|
|
(final: prev: {
|
|
noita_entangled_worlds = inputs.noita-entangled-worlds.packages.${prev.stdenv.hostPlatform.system}.noita-proxy;
|
|
})
|
|
# Workaround: some extensions in nix-vscode-extensions have invalid semver
|
|
# engine versions (e.g. 1.112.01907 with leading zeros) that cause
|
|
# forVSCodeVersion to throw. This tries the version-filtered set per site
|
|
# and falls back to unfiltered only for sites with bad semver data.
|
|
(final: prev: {
|
|
nix-vscode-extensions =
|
|
prev.nix-vscode-extensions
|
|
// {
|
|
forVSCodeVersion = vscodeVersion: let
|
|
filtered = prev.nix-vscode-extensions.forVSCodeVersion vscodeVersion;
|
|
unfiltered = prev.nix-vscode-extensions;
|
|
safeSite = site: let
|
|
# builtins.attrNames forces the filter to run on all extensions,
|
|
# which triggers semver parsing. If any extension has an invalid
|
|
# version, this catches the error and falls back to the unfiltered set.
|
|
tried = builtins.tryEval (
|
|
builtins.seq (builtins.length (builtins.attrNames filtered.${site})) filtered.${site}
|
|
);
|
|
in
|
|
if tried.success
|
|
then tried.value
|
|
else unfiltered.${site};
|
|
in
|
|
filtered
|
|
// {
|
|
open-vsx = safeSite "open-vsx";
|
|
vscode-marketplace = safeSite "vscode-marketplace";
|
|
};
|
|
};
|
|
})
|
|
];
|
|
}
|