From ae74f7ae134193dc7f132fe1c6f5c1c27ed17bf3 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 3 May 2024 00:19:18 +0200 Subject: tabnine: update module and configuration --- user/modules/tabnine.nix | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'user/modules') 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)) ''; }; } -- cgit 1.4.1