6 buildShellExtension = callPackage ./buildGnomeExtension.nix { };
8 # Index of all scraped extensions (with supported versions)
9 extensionsIndex = lib.importJSON ./extensions.json;
11 # A list of UUIDs that have the same pname and we need to rename them
12 extensionRenames = import ./extensionRenames.nix;
14 # Take all extensions from the index that match the gnome version, build them and put them into a list of derivations
15 produceExtensionsList = shell-version:
16 lib.trivial.pipe extensionsIndex [
17 # Does a given extension match our current shell version?
19 (extension: (builtins.hasAttr shell-version extension."shell_version_map"))
21 # Take in an `extension` object from the JSON and transform it into the correct args to call `buildShellExtension`
24 inherit (extension) uuid name description link pname;
25 inherit (extension.shell_version_map.${shell-version}) version sha256 metadata;
29 (map buildShellExtension)
32 # Map the list of extensions to an attrset based on the UUID as key
33 mapUuidNames = extensions:
34 lib.trivial.pipe extensions [
35 (map (extension: lib.nameValuePair extension.extensionUuid extension))
37 (attrs: attrs // { __attrsFailEvaluation = true; })
40 # Map the list of extensions to an attrset based on the pname as key, which is more human readable than the UUID
41 # We also take care of conflict renaming in here
42 mapReadableNames = extensionsList: lib.trivial.pipe extensionsList [
43 # Filter out all extensions that map to null
44 (lib.filter (extension:
46 (builtins.hasAttr extension.extensionUuid extensionRenames)
47 && ((builtins.getAttr extension.extensionUuid extensionRenames) == null)
50 # Map all extensions to their pname, with potential overwrites
52 lib.nameValuePair (extensionRenames.${extension.extensionUuid} or extension.extensionPortalSlug) extension
58 # Remember to import all these in all-packages.nix
59 gnome38Extensions = mapUuidNames (produceExtensionsList "38");
60 gnome40Extensions = mapUuidNames (produceExtensionsList "40");
61 gnome41Extensions = mapUuidNames (produceExtensionsList "41");
62 gnome42Extensions = mapUuidNames (produceExtensionsList "42");
63 gnome43Extensions = mapUuidNames (produceExtensionsList "43");
64 gnome44Extensions = mapUuidNames (produceExtensionsList "44");
65 gnome45Extensions = mapUuidNames (produceExtensionsList "45");
66 gnome46Extensions = mapUuidNames (produceExtensionsList "46");
68 # Keep the last three versions in here
69 gnomeExtensions = lib.trivial.pipe (gnome44Extensions // gnome45Extensions // gnome46Extensions) [
70 (v: builtins.removeAttrs v [ "__attrsFailEvaluation" ])
71 # Apply some custom patches for automatically packaged extensions
72 (callPackage ./extensionOverrides.nix {})
73 # Add all manually packaged extensions
74 (extensions: extensions // (import ./manuallyPackaged.nix { inherit callPackage; }))
75 # Map the extension UUIDs to readable names
79 (extensions: extensions // lib.optionalAttrs config.allowAliases {
80 unite-shell = gnomeExtensions.unite; # added 2021-01-19
81 arc-menu = gnomeExtensions.arcmenu; # added 2021-02-14
82 disable-unredirect = gnomeExtensions.disable-unredirect-fullscreen-windows; # added 2021-11-20
84 icon-hider = throw "gnomeExtensions.icon-hider was removed on 2024-03-15. The extension has not received any updates since 2020/3.34.";
85 nohotcorner = throw "gnomeExtensions.nohotcorner removed since 2019-10-09: Since 3.34, it is a part of GNOME Shell configurable through GNOME Tweaks.";
86 mediaplayer = throw "gnomeExtensions.mediaplayer deprecated since 2019-09-23: retired upstream https://github.com/JasonLG1979/gnome-shell-extensions-mediaplayer/blob/master/README.md";
87 remove-dropdown-arrows = throw "gnomeExtensions.remove-dropdown-arrows removed since 2021-05-25: The extensions has not seen an update sine GNOME 3.34. Furthermore, the functionality it provides is obsolete as of GNOME 40.";
89 # Export buildShellExtension function
90 (extensions: extensions // { inherit buildShellExtension; })
91 # Make the set "public"