summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlan Pearce2023-06-28 09:14:19 +0200
committerAlan Pearce2023-06-28 18:34:23 +0200
commit4d02c68db272b0585ea3db2aa358ded296dbe7e9 (patch)
treec23e41d10834ee4b35d022d412fec9825352f061
parentb20f4ef30f9f0affd761f92e5759e673c69fba6a (diff)
downloadnixfiles-4d02c68db272b0585ea3db2aa358ded296dbe7e9.tar.lz
nixfiles-4d02c68db272b0585ea3db2aa358ded296dbe7e9.tar.zst
nixfiles-4d02c68db272b0585ea3db2aa358ded296dbe7e9.zip
Emacs: use commercial-emacs (currently without tree-sitter)
-rw-r--r--flake.lock13
-rw-r--r--user/emacs/init.el4
-rw-r--r--user/packages/commercial-emacs/default.nix21
-rw-r--r--user/settings/darwin.nix2
-rw-r--r--user/settings/emacs.nix8
5 files changed, 33 insertions, 15 deletions
diff --git a/flake.lock b/flake.lock
index 6ea4e7df..96454d12 100644
--- a/flake.lock
+++ b/flake.lock
@@ -30,12 +30,13 @@
         "nixpkgs-stable": "nixpkgs-stable"
       },
       "locked": {
-        "lastModified": 1687688657,
-        "narHash": "sha256-dFSu1p5h2DLOg4Fzjxvqq7ed4213G/Loeh5lAs2AIAA=",
-        "owner": "nix-community",
-        "repo": "emacs-overlay",
-        "rev": "8e81caaf00418200812761c4d0a8c45d9a599180",
-        "type": "github"
+        "lastModified": 1687957583,
+        "narHash": "sha256-2/8aD9KaEXshIlPKzxlQhNCFxi5PBmQ01O9BRlo/Z/0=",
+        "ref": "refs/heads/commercial-emacs",
+        "rev": "426089576c9fee91c1049307130ea45219db9017",
+        "revCount": 10243,
+        "type": "git",
+        "url": "file:///home/alan/projects/github.com/nix-community/emacs-overlay"
       },
       "original": {
         "owner": "nix-community",
diff --git a/user/emacs/init.el b/user/emacs/init.el
index 958aa138..554dcf08 100644
--- a/user/emacs/init.el
+++ b/user/emacs/init.el
@@ -31,10 +31,6 @@
 (defun quiet (original-function &rest args)
   (quietly (apply original-function args)))
 
-(use-package benchmark-init
-  :config (progn
-            (add-hook 'after-init-hook #'benchmark-init/deactivate 99)))
-
 ;;; Customize
 
 (setq custom-file (expand-file-name "custom.el" user-emacs-directory))
diff --git a/user/packages/commercial-emacs/default.nix b/user/packages/commercial-emacs/default.nix
new file mode 100644
index 00000000..7c0c99b7
--- /dev/null
+++ b/user/packages/commercial-emacs/default.nix
@@ -0,0 +1,21 @@
+{ lib
+, fetchFromGitHub
+
+, emacs
+
+, withTreeSitter ? true
+}:
+(emacs.override {
+  inherit withTreeSitter;
+  nativeComp = false;
+}).overrideAttrs
+  (old: rec {
+    pname = "commercial-emacs";
+    src = fetchFromGitHub {
+      owner = pname;
+      repo = pname;
+      rev = "50771bb6107e32048187ab93f224cd307c733a33";
+      sha256 = "03r4aqiljqg5g07jlbjp5sld0vg122gpb5ah4mpq2hl239qgxc3b";
+    };
+    patches = [ ];
+  })
diff --git a/user/settings/darwin.nix b/user/settings/darwin.nix
index 699caa40..64c989e8 100644
--- a/user/settings/darwin.nix
+++ b/user/settings/darwin.nix
@@ -43,7 +43,7 @@
     darwin.trash
   ];
 
-  programs.emacs.package = pkgs.emacs;
+  programs.emacs.package = pkgs.commercial-emacs;
 
   home.file.".hushlogin".text = "";
 
diff --git a/user/settings/emacs.nix b/user/settings/emacs.nix
index b44409ec..ea042814 100644
--- a/user/settings/emacs.nix
+++ b/user/settings/emacs.nix
@@ -47,7 +47,7 @@ in
 
   programs.emacs = {
     enable = true;
-    package = lib.mkDefault (pkgs.emacs.override { withGTK3 = true; });
+    package = lib.mkDefault (pkgs.commercial-emacs);
     overrides = self: super: (
       {
         consult-ghq = super.consult-ghq.overrideAttrs
@@ -97,7 +97,6 @@ in
         ace-link
         apheleia
         avy
-        benchmark-init
         capf-autosuggest
         clojure-mode
         company
@@ -182,8 +181,9 @@ in
     extraConfig = ''
       (with-eval-after-load 'editorconfig
         (setq editorconfig-exec-path "${pkgs.editorconfig-core-c}/bin/editorconfig"))
-      (setq native-compile-target-directory "${nativeCompileDirectory}")
-      (add-to-list 'native-comp-eln-load-path "${nativeCompileDirectory}" :append)
+      (when (featurep 'native-compile)
+        (setq native-compile-target-directory "${nativeCompileDirectory}")
+        (add-to-list 'native-comp-eln-load-path "${nativeCompileDirectory}" :append))
     '' + lib.optionalString stdenv.isDarwin ''
       (with-eval-after-load 'files
         (setq insert-directory-program "${pkgs.coreutils-prefixed}/bin/gls"))