mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2025-01-08 06:49:49 +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,
|
config,
|
||||||
lib,
|
|
||||||
pkgs,
|
pkgs,
|
||||||
|
lib,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.modules) mkIf;
|
inherit (lib.modules) mkIf;
|
||||||
|
inherit (lib.meta) getExe;
|
||||||
|
|
||||||
cfg = config.vim.utility.vim-wakatime;
|
cfg = config.vim.utility.vim-wakatime;
|
||||||
in {
|
in {
|
||||||
config = mkIf cfg.enable {
|
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) ''
|
# Wakatime configuration is stored as vim globals.
|
||||||
vim.g.wakatime_CLIPath = "${cfg.cli-package}"
|
globals = {
|
||||||
'';
|
"wakatime_CLIPath" = mkIf (cfg.cli-package != null) "${getExe cfg.cli-package}";
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
_: {
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./config.nix
|
./config.nix
|
||||||
./vim-wakatime.nix
|
./vim-wakatime.nix
|
||||||
|
|
|
@ -1,18 +1,24 @@
|
||||||
{
|
{
|
||||||
lib,
|
|
||||||
pkgs,
|
pkgs,
|
||||||
|
lib,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.options) mkEnableOption mkOption;
|
inherit (lib.options) mkEnableOption mkOption;
|
||||||
inherit (lib.types) nullOr package;
|
inherit (lib.types) nullOr package;
|
||||||
in {
|
in {
|
||||||
options.vim.utility.vim-wakatime = {
|
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 {
|
cli-package = mkOption {
|
||||||
type = nullOr package;
|
type = nullOr package;
|
||||||
default = pkgs.wakatime;
|
default = pkgs.wakatime-cli;
|
||||||
description = "The package that should be used for wakatime-cli. Set as null to use the default path in `$XDG_DATA_HOME`";
|
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