emacs: enable native-comp

This commit is contained in:
Lin Jian 2022-06-08 02:41:06 +08:00
parent 3524da2f0a
commit 51bd7cf0d0
No known key found for this signature in database
GPG Key ID: A6698D36434F75A5
5 changed files with 35 additions and 6 deletions

View File

@ -70,6 +70,34 @@
with any supported NixOS release.
</para>
</listitem>
<listitem>
<para>
<literal>emacs</literal> enables native compilation which
means:
</para>
<itemizedlist spacing="compact">
<listitem>
<para>
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;
</para>
</listitem>
<listitem>
<para>
emacs packages from somewhere else, e.g.
<literal>package-install</literal>, will do asynchronously
deferred native compilation. If you do not want this,
maybe to avoid CPU consumption for compilation, you can
use
<literal>(setq native-comp-deferred-compilation nil)</literal>
to disable it while still enjoy the benefit of native
compilation for packages from nixpkgs.
</para>
</listitem>
</itemizedlist>
</listitem>
<listitem>
<para>
<literal>nixos-generate-config</literal> now generates

View File

@ -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.

View File

@ -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

View File

@ -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

View File

@ -26720,7 +26720,6 @@ with pkgs;
em = callPackage ../applications/editors/em { };
emacs = emacs28;
emacsNativeComp = emacs28NativeComp;
emacs-nox = emacs28-nox;
emacs28 = callPackage ../applications/editors/emacs/28.nix {
@ -26735,10 +26734,6 @@ with pkgs;
inherit (darwin) sigtool;
};
emacs28NativeComp = emacs28.override {
nativeComp = true;
};
emacs28-nox = lowPrio (emacs28.override {
withX = false;
withNS = false;