summary refs log tree commit diff stats
path: root/user/modules/tabnine.nix
diff options
context:
space:
mode:
Diffstat (limited to 'user/modules/tabnine.nix')
-rw-r--r--user/modules/tabnine.nix11
1 files changed, 6 insertions, 5 deletions
diff --git a/user/modules/tabnine.nix b/user/modules/tabnine.nix
index a702cf29..3eee4834 100644
--- a/user/modules/tabnine.nix
+++ b/user/modules/tabnine.nix
@@ -5,6 +5,7 @@
 }:
 with lib; let
   inherit (pkgs) stdenv;
+  tomlFormat = pkgs.formats.toml { };
   cfg = config.programs.tabnine;
   lspConfigFile = config:
     pkgs.runCommand "TabNine.toml"
@@ -52,7 +53,7 @@ in
     };
 
     lspConfig = mkOption {
-      type = types.attrs;
+      type = tomlFormat.type;
       default = { };
       description = ''
         LSP Server configuration written to
@@ -64,7 +65,7 @@ in
 
   config = mkIf cfg.enable {
     home.file."${cfg.configDir}/TabNine.toml" = {
-      source = lspConfigFile cfg.lspConfig;
+      source = (tomlFormat.generate "TabNine.toml" cfg.lspConfig);
     };
     home.file."${cfg.configDir}/tabnine_config.json" = {
       source = pkgs.writeText "tabnine_config.json" (builtins.toJSON cfg.config);
@@ -84,10 +85,10 @@ in
       epkgs.tabnine
     ];
     programs.emacs.extraConfig = ''
+      (defun my/override-tabnine-exe-path (&rest args)
+        "${pkgs.tabnine}/bin/TabNine")
       (with-eval-after-load 'tabnine
-        (advice-add 'tabnine--executable-path :around
-          (lambda (original-function &rest args)
-            "${pkgs.tabnine}/bin/TabNine")))
+        (advice-add 'tabnine--executable-path :override #'my/override-tabnine-exe-path))
     '';
   };
 }