mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2025-01-07 01:59:48 +01:00
utility/wakatime: move plugin options to vim.globals
; cleanup
This commit is contained in:
parent
e614860a12
commit
fcc6aa485c
3 changed files with 20 additions and 10 deletions
|
@ -1,18 +1,22 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.meta) getExe;
|
||||
|
||||
cfg = config.vim.utility.vim-wakatime;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
vim.startPlugins = [pkgs.vimPlugins.vim-wakatime];
|
||||
vim = {
|
||||
startPlugins = [pkgs.vimPlugins.vim-wakatime];
|
||||
|
||||
vim.pluginRC.vim-wakatime = mkIf (cfg.cli-package != null) ''
|
||||
vim.g.wakatime_CLIPath = "${cfg.cli-package}"
|
||||
'';
|
||||
# Wakatime configuration is stored as vim globals.
|
||||
globals = {
|
||||
"wakatime_CLIPath" = mkIf (cfg.cli-package != null) "${getExe cfg.cli-package}";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
_: {
|
||||
{
|
||||
imports = [
|
||||
./config.nix
|
||||
./vim-wakatime.nix
|
||||
|
|
|
@ -1,18 +1,24 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.options) mkEnableOption mkOption;
|
||||
inherit (lib.types) nullOr package;
|
||||
in {
|
||||
options.vim.utility.vim-wakatime = {
|
||||
enable = mkEnableOption "vim-wakatime: live code statistics";
|
||||
enable = mkEnableOption ''
|
||||
automatic time tracking and metrics generated from your programming activity [vim-wakatime]
|
||||
'';
|
||||
|
||||
cli-package = mkOption {
|
||||
type = 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`";
|
||||
default = pkgs.wakatime-cli;
|
||||
example = null;
|
||||
description = ''
|
||||
The package that should be used for wakatime-cli.
|
||||
Set as null to use the default path in {env}`$XDG_DATA_HOME`
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue