From 9bd54f586e162749c4c12a454b101987cb16de5c Mon Sep 17 00:00:00 2001 From: adisbladis Date: Wed, 4 Aug 2021 09:13:46 -0500 Subject: [PATCH] emacs.pkgs: Propagate overriden scope to emacs package in set This is the true fix for https://github.com/NixOS/nixpkgs/issues/130020. --- pkgs/top-level/all-packages.nix | 4 ++-- pkgs/top-level/emacs-packages.nix | 16 +++++++++++++--- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 05e18dd0b915..f5912a2e7009 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -23951,8 +23951,8 @@ in }; emacsPackagesFor = emacs: import ./emacs-packages.nix { - inherit (lib) makeScope makeOverridable; - inherit emacs; + inherit (lib) makeScope makeOverridable dontRecurseIntoAttrs; + emacs' = emacs; pkgs' = pkgs; # default pkgs used for bootstrapping the emacs package set }; diff --git a/pkgs/top-level/emacs-packages.nix b/pkgs/top-level/emacs-packages.nix index 3fa2d2ea5dca..9b4d700a3553 100644 --- a/pkgs/top-level/emacs-packages.nix +++ b/pkgs/top-level/emacs-packages.nix @@ -21,7 +21,12 @@ (package-initialize) */ -{ pkgs', makeScope, makeOverridable, emacs }: +{ pkgs' +, emacs' +, makeScope +, makeOverridable +, dontRecurseIntoAttrs +}: let @@ -71,7 +76,12 @@ in makeScope pkgs'.newScope (self: makeOverridable ({ // manualPackages // { inherit manualPackages; } // { - inherit emacs; + # Propagate overriden scope + emacs = emacs'.overrideAttrs(old: { + passthru = old.passthru // { + pkgs = dontRecurseIntoAttrs self; + }; + }); trivialBuild = pkgs.callPackage ../build-support/emacs/trivial.nix { inherit (self) emacs; @@ -84,7 +94,7 @@ in makeScope pkgs'.newScope (self: makeOverridable ({ emacsWithPackages = emacsWithPackages { inherit pkgs lib; } self; withPackages = emacsWithPackages { inherit pkgs lib; } self; - }// { + } // { # Package specific priority overrides goes here