diff --git a/nixos/doc/manual/from_md/release-notes/rl-2211.section.xml b/nixos/doc/manual/from_md/release-notes/rl-2211.section.xml
index e8cd84783e4c..0f4c6b73e55f 100644
--- a/nixos/doc/manual/from_md/release-notes/rl-2211.section.xml
+++ b/nixos/doc/manual/from_md/release-notes/rl-2211.section.xml
@@ -70,6 +70,34 @@
with any supported NixOS release.
+
+
+ emacs enables native compilation which
+ means:
+
+
+
+
+ emacs packages from nixpkgs, builtin or not, will do
+ native compilation ahead of time so you can enjoy the
+ benefit of native compilation without compiling them on
+ you machine;
+
+
+
+
+ emacs packages from somewhere else, e.g.
+ package-install, will do asynchronously
+ deferred native compilation. If you do not want this,
+ maybe to avoid CPU consumption for compilation, you can
+ use
+ (setq native-comp-deferred-compilation nil)
+ to disable it while still enjoy the benefit of native
+ compilation for packages from nixpkgs.
+
+
+
+
nixos-generate-config now generates
diff --git a/nixos/doc/manual/release-notes/rl-2211.section.md b/nixos/doc/manual/release-notes/rl-2211.section.md
index 8d9d2679c8f4..05611ddce508 100644
--- a/nixos/doc/manual/release-notes/rl-2211.section.md
+++ b/nixos/doc/manual/release-notes/rl-2211.section.md
@@ -35,6 +35,10 @@ In addition to numerous new and upgraded packages, this release has the followin
for a transition period so that in time the ecosystem can switch without
breaking compatibility with any supported NixOS release.
+- `emacs` enables native compilation which means:
+ - emacs packages from nixpkgs, builtin or not, will do native compilation ahead of time so you can enjoy the benefit of native compilation without compiling them on you machine;
+ - emacs packages from somewhere else, e.g. `package-install`, will do asynchronously deferred native compilation. If you do not want this, maybe to avoid CPU consumption for compilation, you can use `(setq native-comp-deferred-compilation nil)` to disable it while still enjoy the benefit of native compilation for packages from nixpkgs.
+
- `nixos-generate-config` now generates configurations that can be built in pure
mode. This is achieved by setting the new `nixpkgs.hostPlatform` option.
diff --git a/pkgs/applications/editors/emacs/generic.nix b/pkgs/applications/editors/emacs/generic.nix
index b1c8a8d6cc9b..1f49c3c23af0 100644
--- a/pkgs/applications/editors/emacs/generic.nix
+++ b/pkgs/applications/editors/emacs/generic.nix
@@ -26,7 +26,7 @@
, withWebP ? false
, srcRepo ? true, autoreconfHook ? null, texinfo ? null
, siteStart ? ./site-start.el
-, nativeComp ? false
+, nativeComp ? true
, withAthena ? false
, withToolkitScrollBars ? true
, withPgtk ? false
diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix
index ca228b77f493..020b7c9ac2a1 100644
--- a/pkgs/top-level/aliases.nix
+++ b/pkgs/top-level/aliases.nix
@@ -380,8 +380,10 @@ mapAliases ({
electrum-dash = throw "electrum-dash has been removed from nixpkgs as the project is abandoned"; # Added 2022-01-01
# Emacs
+ emacs28NativeComp = emacs28; # Added 2022-06-08
emacs28Packages = emacs28.pkgs; # Added 2021-10-04
emacs28WithPackages = emacs28.pkgs.withPackages; # Added 2021-10-04
+ emacsNativeComp = emacs28NativeComp; # Added 2022-06-08
emacsPackages = emacs.pkgs; # Added 2020-12-18
emacsPackagesGen = throw "'emacsPackagesGen' has been renamed to/replaced by 'emacsPackagesFor'"; # Converted to throw 2022-02-22
emacsPackagesNg = emacs.pkgs; # Added 2019-08-07
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index cd11b82c1b9f..660444d1ac85 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -26876,7 +26876,6 @@ with pkgs;
em = callPackage ../applications/editors/em { };
emacs = emacs28;
- emacsNativeComp = emacs28NativeComp;
emacs-nox = emacs28-nox;
emacs28 = callPackage ../applications/editors/emacs/28.nix {
@@ -26891,10 +26890,6 @@ with pkgs;
inherit (darwin) sigtool;
};
- emacs28NativeComp = emacs28.override {
- nativeComp = true;
- };
-
emacs28-nox = lowPrio (emacs28.override {
withX = false;
withNS = false;