Compare commits

...

2 commits

Author SHA1 Message Date
eb6e8b17b7
docs: clean up module installation chapters
Some checks are pending
Set up binary cache / cachix (default) (push) Waiting to run
Set up binary cache / cachix (maximal) (push) Waiting to run
Set up binary cache / cachix (nix) (push) Waiting to run
Validate flake & check documentation / Validate Flake Documentation (docs) (push) Waiting to run
Validate flake & check documentation / Validate Flake Documentation (docs-html) (push) Waiting to run
Validate flake & check documentation / Validate Flake Documentation (docs-json) (push) Waiting to run
Validate flake & check documentation / Validate Flake Documentation (docs-manpages) (push) Waiting to run
Validate flake & check documentation / Validate hyperlinks in documentation sources (push) Waiting to run
Validate flake & check formatting / Validate Flake (push) Waiting to run
Validate flake & check formatting / Formatting via Alejandra (push) Waiting to run
Build and deploy documentation / Check latest commit (push) Waiting to run
Build and deploy documentation / publish (push) Blocked by required conditions
Check for typos in the source tree / check-typos (push) Waiting to run
2025-01-04 15:35:55 +03:00
fcc6aa485c
utility/wakatime: move plugin options to vim.globals; cleanup 2025-01-04 15:29:11 +03:00
5 changed files with 29 additions and 17 deletions

View file

@ -44,12 +44,15 @@ Followed by importing the home-manager module somewhere in your configuration.
}; };
outputs = { nixpkgs, home-manager, nvf, ... }: let outputs = { nixpkgs, home-manager, nvf, ... }: let
system = "x86_64-linux"; in { system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
in {
# ↓ this is your home output in the flake schema, expected by home-manager # ↓ this is your home output in the flake schema, expected by home-manager
"your-username@your-hostname" = home-manager.lib.homeManagerConfiguration "your-username@your-hostname" = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [ modules = [
nvf.homeManagerModules.default # <- this imports the home-manager module that provides the options nvf.homeManagerModules.default # <- this imports the home-manager module that provides the options
./home.nix # <- your home entrypoint ./home.nix # <- your home entrypoint, `programs.nvf.*` may be defined here
]; ];
}; };
}; };

View file

@ -42,13 +42,12 @@ Followed by importing the NixOS module somewhere in your configuration.
nvf.url = "github:notashelf/nvf"; nvf.url = "github:notashelf/nvf";
}; };
outputs = { nixpkgs, nvf, ... }: let outputs = { nixpkgs, nvf, ... }: {
system = "x86_64-linux"; in {
# ↓ this is your host output in the flake schema # ↓ this is your host output in the flake schema
nixosConfigurations."yourUsername»" = nixpkgs.lib.nixosSystem { nixosConfigurations."your-hostname" = nixpkgs.lib.nixosSystem {
modules = [ modules = [
nvf.nixosModules.default # <- this imports the NixOS module that provides the options nvf.nixosModules.default # <- this imports the NixOS module that provides the options
./configuration.nix # <- your host entrypoint ./configuration.nix # <- your host entrypoint, `programs.nvf.*` may be defined here
]; ];
}; };
}; };

View file

@ -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}";
};
};
}; };
} }

View file

@ -1,4 +1,4 @@
_: { {
imports = [ imports = [
./config.nix ./config.nix
./vim-wakatime.nix ./vim-wakatime.nix

View file

@ -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`
'';
}; };
}; };
} }