From 97ca1859514f012a6cace30eab3e1c80871129c3 Mon Sep 17 00:00:00 2001 From: Aleksandr Lebedev Date: Fri, 25 Jul 2025 22:01:40 +0200 Subject: [PATCH] Zhu --- flake.lock | 6 +++--- package.nix | 7 ++++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/flake.lock b/flake.lock index 9c729f1..ba995e0 100644 --- a/flake.lock +++ b/flake.lock @@ -10,11 +10,11 @@ ] }, "locked": { - "lastModified": 1753376867, - "narHash": "sha256-FAPCW/szK3qvCUD+ThOX4sFyqz/MSadJ4SltA8lNamc=", + "lastModified": 1753460825, + "narHash": "sha256-MNu9l5nukxFpT5LzsT7Q83BqmO36EByn6/o/xA7hu7I=", "owner": "nix-community", "repo": "emacs-overlay", - "rev": "b8df6094952273f3b7e5e7c99b96ed1bf9830034", + "rev": "07c08ea0037b2fd7e0b5416361586d4552ac8255", "type": "github" }, "original": { diff --git a/package.nix b/package.nix index a5e0c47..78cccfb 100644 --- a/package.nix +++ b/package.nix @@ -1,6 +1,7 @@ { pkgs, withLsps ? false, + native ? false, ... }: let preTangledFile = pkgs.writeText "config.org" '' @@ -32,7 +33,11 @@ # }; defaultInitFile = true; # Package is optional, defaults to pkgs.emacs - package = pkgs.emacs30-pgtk; + package = if native then pkgs.emacs30-pgtk.overrideAttrs ( + oldAttrs: { + NIX_CFLAGS_COMPILE = builtins.toString oldAttrs.NIX_CFLAGS_COMPILE or "" + "-march=native -O3"; + } + ) else pkgs.emacs30-pgtk; # By default emacsWithPackagesFromUsePackage will only pull in # packages with `:ensure`, `:ensure t` or `:ensure `.