From 50c2e916260849f62dfdd68a7ddaee9b44f7f3a8 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Thu, 11 May 2023 16:21:52 +0300 Subject: [PATCH] feat: provide wakatime-cli package option --- modules/utility/wakatime/config.nix | 8 ++++++++ modules/utility/wakatime/vim-wakatime.nix | 12 +++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/modules/utility/wakatime/config.nix b/modules/utility/wakatime/config.nix index 9a9b7077..fb990747 100644 --- a/modules/utility/wakatime/config.nix +++ b/modules/utility/wakatime/config.nix @@ -12,5 +12,13 @@ in { vim.startPlugins = [ pkgs.vimPlugins.vim-wakatime ]; + + vim.configRC.vim-wakatime = nvim.dag.entryAnywhere '' + ${ + if cfg.cli-package == null + then "" + else ''let g:wakatime_CLIPath = "${cfg.cli-package}"'' + } + ''; }; } diff --git a/modules/utility/wakatime/vim-wakatime.nix b/modules/utility/wakatime/vim-wakatime.nix index 78655067..2df357eb 100644 --- a/modules/utility/wakatime/vim-wakatime.nix +++ b/modules/utility/wakatime/vim-wakatime.nix @@ -1,7 +1,17 @@ -{lib, ...}: +{ + lib, + pkgs, + ... +}: with lib; with builtins; { options.vim.utility.vim-wakatime = { enable = mkEnableOption "Enable vim-wakatime"; + + cli-package = mkOption { + type = with types; nullOr package; + default = pkgs.wakatime; + description = "The package that should be used for wakatime-cli. Set as null to use the default path in `$XDG_DATA_HOME`"; + }; }; }