···103103104104This provides a fairly full Emacs start file. It will load in addition to the user's personal config. You can always disable it by passing `-q` to the Emacs command.
105105106106-Sometimes `emacs.pkgs.withPackages` is not enough, as this package set has some priorities imposed on packages (with the lowest priority assigned to Melpa Unstable, and the highest for packages manually defined in `pkgs/top-level/emacs-packages.nix`). But you can't control these priorities when some package is installed as a dependency. You can override it on a per-package-basis, providing all the required dependencies manually, but it's tedious and there is always a possibility that an unwanted dependency will sneak in through some other package. To completely override such a package, you can use `overrideScope'`.
106106+Sometimes `emacs.pkgs.withPackages` is not enough, as this package set has some priorities imposed on packages (with the lowest priority assigned to Melpa Unstable, and the highest for packages manually defined in `pkgs/top-level/emacs-packages.nix`). But you can't control these priorities when some package is installed as a dependency. You can override it on a per-package-basis, providing all the required dependencies manually, but it's tedious and there is always a possibility that an unwanted dependency will sneak in through some other package. To completely override such a package, you can use `overrideScope`.
107107108108```nix
109109overrides = self: super: rec {
110110 haskell-mode = self.melpaPackages.haskell-mode;
111111 ...
112112};
113113-((emacsPackagesFor emacs).overrideScope' overrides).withPackages
113113+((emacsPackagesFor emacs).overrideScope overrides).withPackages
114114 (p: with p; [
115115 # here both these package will use haskell-mode of our own choice
116116 ghc-mod
···269269 let self = f self // {
270270 newScope = scope: newScope (self // scope);
271271 callPackage = self.newScope {};
272272- overrideScope = g: lib.warn
273273- "`overrideScope` (from `lib.makeScope`) is deprecated. Do `overrideScope' (self: super: { … })` instead of `overrideScope (super: self: { … })`. All other overrides have the parameters in that order, including other definitions of `overrideScope`. This was the only definition violating the pattern."
274274- (makeScope newScope (lib.fixedPoints.extends (lib.flip g) f));
275275- overrideScope' = g: makeScope newScope (lib.fixedPoints.extends g f);
272272+ overrideScope = g: makeScope newScope (lib.fixedPoints.extends g f);
273273+ # Remove after 24.11 is released.
274274+ overrideScope' = g: lib.warnIf (lib.isInOldestRelease 2311)
275275+ "`overrideScope'` (from `lib.makeScope`) has been renamed to `overrideScope`."
276276+ (makeScope newScope (lib.fixedPoints.extends g f));
276277 packages = f;
277278 };
278279 in self;
+1-1
pkgs/build-support/emacs/wrapper.nix
···2121`emacs.pkgs.emacs.pkgs.withPackages`,
2222```
2323let customEmacsPackages =
2424- emacs.pkgs.overrideScope' (self: super: {
2424+ emacs.pkgs.overrideScope (self: super: {
2525 # use a custom version of emacs
2626 emacs = ...;
2727 # use the unstable MELPA version of magit
+1-1
pkgs/development/compilers/rust/default.nix
···4848 # Like `buildRustPackages`, but may also contain prebuilt binaries to
4949 # break cycle. Just like `bootstrapTools` for nixpkgs as a whole,
5050 # nothing in the final package set should refer to this.
5151- bootstrapRustPackages = self.buildRustPackages.overrideScope' (_: _:
5151+ bootstrapRustPackages = self.buildRustPackages.overrideScope (_: _:
5252 lib.optionalAttrs (stdenv.buildPlatform == stdenv.hostPlatform)
5353 (selectRustPackage buildPackages).packages.prebuilt);
5454 bootRustPlatform = makeRustPlatform bootstrapRustPackages;