diff --git a/pkgs/applications/editors/emacs/elisp-packages/elpa-packages.nix b/pkgs/applications/editors/emacs/elisp-packages/elpa-packages.nix index 59ad28052fae..adf7d75ed5fc 100644 --- a/pkgs/applications/editors/emacs/elisp-packages/elpa-packages.nix +++ b/pkgs/applications/editors/emacs/elisp-packages/elpa-packages.nix @@ -41,7 +41,10 @@ self: let }: let imported = import generated { - inherit (self) callPackage; + callPackage = pkgs: args: self.callPackage pkgs (args // { + # Use custom elpa url fetcher with fallback/uncompress + fetchurl = buildPackages.callPackage ./fetchelpa.nix { }; + }); }; super = removeAttrs imported [ "dash" ]; diff --git a/pkgs/applications/editors/emacs/elisp-packages/nongnu-packages.nix b/pkgs/applications/editors/emacs/elisp-packages/nongnu-packages.nix index c3459448c281..66ca61499d96 100644 --- a/pkgs/applications/editors/emacs/elisp-packages/nongnu-packages.nix +++ b/pkgs/applications/editors/emacs/elisp-packages/nongnu-packages.nix @@ -10,7 +10,7 @@ To update the list of packages from nongnu (ELPA), */ -{ lib }: +{ lib, buildPackages }: self: let @@ -19,7 +19,10 @@ self: let }: let imported = import generated { - inherit (self) callPackage; + callPackage = pkgs: args: self.callPackage pkgs (args // { + # Use custom elpa url fetcher with fallback/uncompress + fetchurl = buildPackages.callPackage ./fetchelpa.nix { }; + }); }; super = imported; diff --git a/pkgs/top-level/emacs-packages.nix b/pkgs/top-level/emacs-packages.nix index 9b4d700a3553..30b834cc1116 100644 --- a/pkgs/top-level/emacs-packages.nix +++ b/pkgs/top-level/emacs-packages.nix @@ -35,7 +35,8 @@ let inherit lib; }; - mkNongnuPackages = { lib }: import ../applications/editors/emacs/elisp-packages/nongnu-packages.nix { + mkNongnuPackages = { pkgs, lib }: import ../applications/editors/emacs/elisp-packages/nongnu-packages.nix { + inherit (pkgs) buildPackages; inherit lib; }; @@ -62,7 +63,7 @@ in makeScope pkgs'.newScope (self: makeOverridable ({ pkgs ? pkgs' , lib ? pkgs.lib , elpaPackages ? mkElpaPackages { inherit pkgs lib; } self - , nongnuPackages ? mkNongnuPackages { inherit lib; } self + , nongnuPackages ? mkNongnuPackages { inherit pkgs lib; } self , melpaStablePackages ? melpaGeneric { inherit pkgs lib; } "stable" self , melpaPackages ? melpaGeneric { inherit pkgs lib; } "unstable" self , orgPackages ? mkOrgPackages { inherit lib; } self