summary refs log tree commit diff stats
path: root/user
diff options
context:
space:
mode:
Diffstat (limited to 'user')
-rw-r--r--user/emacs/init.el4
-rw-r--r--user/modules/tabnine.nix6
-rw-r--r--user/settings/emacs.nix6
3 files changed, 7 insertions, 9 deletions
diff --git a/user/emacs/init.el b/user/emacs/init.el
index 870032ae..56a437bb 100644
--- a/user/emacs/init.el
+++ b/user/emacs/init.el
@@ -610,10 +610,8 @@ _C-k_: prev  _u_pper              _=_: upper/lower       _s_mart resolve
 
 (use-package tabnine-core
   :config (progn
-            (setq tabnine-binaries-folder "~/.local/tabnine")
             (with-demoted-errors "TabNine error: %s"
-              (when (tabnine--executable-path)
-                (global-tabnine-mode)))
+              (global-tabnine-mode))
 
             (define-key tabnine-completion-map (kbd "TAB") #'tabnine-accept-completion)
             (define-key tabnine-completion-map (kbd "<tab>") #'tabnine-accept-completion)
diff --git a/user/modules/tabnine.nix b/user/modules/tabnine.nix
index d9b5c6c6..b8ed3773 100644
--- a/user/modules/tabnine.nix
+++ b/user/modules/tabnine.nix
@@ -71,11 +71,5 @@ in
     programs.emacs.extraPackages = epkgs: [
       epkgs.tabnine
     ];
-    programs.emacs.extraConfig = ''
-      (defun my/override-tabnine-exe-path (&rest args)
-        "${pkgs.tabnine}/bin/TabNine")
-      (with-eval-after-load 'tabnine-core
-        (advice-add 'tabnine--executable-path :override #'my/override-tabnine-exe-path))
-    '';
   };
 }
diff --git a/user/settings/emacs.nix b/user/settings/emacs.nix
index db3a29fa..73a3b55a 100644
--- a/user/settings/emacs.nix
+++ b/user/settings/emacs.nix
@@ -185,6 +185,12 @@ in
       lsp-mode = self.melpaPackages.lsp-mode.overrideAttrs {
         LSP_USE_PLISTS = "true"; # must be set in early-init
       };
+      tabnine = self.melpaPackages.tabnine.overrideAttrs (attrs: {
+        postPatch = (attrs.postPatch or "") + ''
+          substituteInPlace tabnine-core.el \
+            --replace '(tabnine--executable-path)' '"${pkgs.tabnine}/bin/TabNine"'
+        '';
+      });
     };
     extraConfig = ''
       (with-eval-after-load 'editorconfig