Merge pull request #36 from NotAShelf/docs-rewrite

docs: improve documentation
This commit is contained in:
NotAShelf 2023-04-02 20:02:15 +03:00 committed by GitHub
commit 7b869ad21e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
36 changed files with 86 additions and 49 deletions

View File

@ -18,7 +18,10 @@ The following is an example of a barebones vim configuration with the default th
[source,nix]
----
{
inputs.neovim-flake.url = "github:jordanisaacs/neovim-flake";
inputs.neovim-flake = {
url = "github:notashelf/neovim-flake";
inputs.nixpkgs.follows = "nixpkgs";
};
outputs = {nixpkgs, neovim-flake, ...}: let
system = "x86_64-linux";
@ -27,7 +30,9 @@ The following is an example of a barebones vim configuration with the default th
# Add any custom options (and feel free to upstream them!)
# options = ...
config.vim.theme.enable = true;
config.vim = {
theme.enable = true;
};
};
customNeovim = neovim-flake.lib.neovimConfiguration {

View File

@ -19,7 +19,7 @@ Followed by importing the HM module.
[source,nix]
----
{
imports = [ neovim-flake.nixosModules.hm-module ];
imports = [ neovim-flake.homeManagerModules.default ];
}
----
@ -29,7 +29,9 @@ Then we should be able to use the given module. E.g.
----
{
programs.neovim-flake = {
enable = true;
# your settings need to go into the settings attrset
settings = {
vim.viAlias = false;
vim.vimAlias = true;

16
lib/assertions.nix Normal file
View File

@ -0,0 +1,16 @@
{
pkgs,
config,
lib,
...
}:
with lib; let
cfg = config.vim;
in {
assertions = mkMerge [
{
assertion = cfg.kommentary.enable;
message = "Kommentary has been deprecated in favor";
}
];
}

View File

@ -2,4 +2,9 @@
dag = import ./dag.nix {inherit lib;};
booleans = import ./booleans.nix {inherit lib;};
types = import ./types {inherit lib;};
imports = [
./assertions.nix
];
}

View File

@ -45,5 +45,15 @@ in {
config = mkIf cfg.enable {
home.packages = [set.neovim];
assertions = mkMerge [
mkIf
(config.programs.neovim-flake.enable)
{
assertion = !config.programs.neovim.enable;
message = "You cannot use neovim-flake together with vanilla neovim.";
}
];
};
}

View File

@ -10,7 +10,7 @@ with builtins; {
enable = mkOption {
type = types.bool;
default = false;
description = "enable autopairs";
description = "Enable autopairs";
};
type = mkOption {

View File

@ -6,6 +6,6 @@
with lib;
with builtins; {
options.vim.comments.comment-nvim = {
enable = mkEnableOption "comment-nvim";
enable = mkEnableOption "Enable comment-nvim";
};
}

View File

@ -8,7 +8,7 @@ with builtins; let
cfg = config.vim.comments.kommentary;
in {
options.vim.comments.kommentary = {
enable = mkEnableOption "kommentary";
enable = mkEnableOption "Enable kommentary";
};
config = mkIf cfg.enable {

View File

@ -10,7 +10,7 @@ with builtins; {
enable = mkOption {
type = types.bool;
default = false;
description = "enable autocomplete";
description = "Enable autocomplete via nvim-cmp";
};
type = mkOption {

View File

@ -6,6 +6,6 @@
with lib;
with builtins; {
options.vim.dashboard.alpha = {
enable = mkEnableOption "alpha";
enable = mkEnableOption "Enable alpha.nvim";
};
}

View File

@ -13,8 +13,7 @@ in {
];
vim.luaConfigRC.dashboard-nvim = nvim.dag.entryAnywhere ''
require("dashboard").setup{
}
require("dashboard").setup{}
'';
};
}

View File

@ -6,6 +6,6 @@
with lib;
with builtins; {
options.vim.dashboard.dashboard-nvim = {
enable = mkEnableOption "dashboard-nvim";
enable = mkEnableOption "Enable dashboard.nvim";
};
}

View File

@ -6,7 +6,7 @@
with builtins;
with lib; {
options.vim.dashboard.startify = {
enable = mkEnableOption "Enable startify";
enable = mkEnableOption "Enable vim-startify";
bookmarks = mkOption {
default = [];

View File

@ -7,7 +7,7 @@ with lib;
with builtins; {
options.vim.lsp = {
lightbulb = {
enable = mkEnableOption "lightbulb for code actions. Requires emoji font";
enable = mkEnableOption "Lightbulb for code actions. Requires an emoji font";
};
};
}

View File

@ -9,7 +9,7 @@ with builtins; let
cfg = config.vim.lsp;
in {
options.vim.lsp = {
enable = mkEnableOption "neovim lsp support";
enable = mkEnableOption "Enable neovim lsp support. Requires language specific LSPs to be anabled to take effect";
formatOnSave = mkEnableOption "Format on save";
nix = {
enable = mkEnableOption "Nix LSP";
@ -45,7 +45,7 @@ in {
},
},
'';
description = "options to pass to rust analyzer";
description = "Options to pass to rust analyzer";
};
};
python = mkEnableOption "Python LSP";

View File

@ -7,7 +7,7 @@ with lib;
with builtins; {
options.vim.lsp = {
nvimCodeActionMenu = {
enable = mkEnableOption "nvim code action menu";
enable = mkEnableOption "Enable nvim code action menu";
};
};
}

View File

@ -7,7 +7,7 @@ with lib;
with builtins; {
options.vim.lsp = {
trouble = {
enable = mkEnableOption "trouble diagnostics viewer";
enable = mkEnableOption "Enable trouble diagnostics viewer";
};
};
}

View File

@ -8,7 +8,7 @@ with builtins; let
cfg = config.vim.markdown;
in {
options.vim.markdown = {
enable = mkEnableOption "markdown tools and plugins";
enable = mkEnableOption "Enable markdown tools and plugins";
};
config = mkIf (cfg.enable) {

View File

@ -6,6 +6,6 @@
with lib;
with builtins; {
options.vim.minimap.codewindow = {
enable = mkEnableOption "Enable minimap-vim plugin";
enable = mkEnableOption "Enable codewindow plugin for minimap view";
};
}

View File

@ -6,6 +6,6 @@
with lib;
with builtins; {
options.vim.minimap.minimap-vim = {
enable = mkEnableOption "Enable minimap-vim plugin";
enable = mkEnableOption "Enable minimap-vim plugin for minimap view";
};
}

View File

@ -6,7 +6,7 @@
with lib;
with builtins; {
options.vim.notes.orgmode = {
enable = mkEnableOption "Neovim plugin for Emac Orgmode. Get the best of both worlds.";
enable = mkEnableOption "Enable nvim-orgmode: Neovim plugin for Emac Orgmode. Get the best of both worlds";
orgAgendaFiles = mkOption {
type = types.str;
default = "{'~/Dropbox/org/*', '~/my-orgs/**/*'}";

View File

@ -6,7 +6,7 @@
with lib;
with builtins; {
options.vim.notes.todo-comments = {
enable = mkEnableOption "todo-comments";
enable = mkEnableOption "Enable todo-comments";
patterns = {
highlight = mkOption {

View File

@ -6,7 +6,7 @@
with lib;
with builtins; {
options.vim.presence.presence-nvim = {
enable = mkEnableOption "Enable presence.nvim plugin";
enable = mkEnableOption "Enable presence.nvim plugin for discord rich presence";
image_text = mkOption {
type = types.str;

View File

@ -10,7 +10,7 @@ in {
options.vim.statusline.lualine = {
enable = mkOption {
type = types.bool;
description = "Enable lualine";
description = "Enable lualine statusline";
default = true;
};

View File

@ -6,6 +6,6 @@
with lib;
with builtins; {
options.vim.tabline.nvimBufferline = {
enable = mkEnableOption "nvim-bufferline-lua";
enable = mkEnableOption "Enable nvim-bufferline-lua as a bufferline";
};
}

View File

@ -12,7 +12,7 @@ in {
options.vim.theme = {
enable = mkOption {
type = types.bool;
description = "Enable Theme";
description = "Enable theming";
};
name = mkOption {

View File

@ -6,7 +6,7 @@
with lib;
with builtins; {
options.vim.tidal = {
enable = mkEnableOption "tidal tools and plugins";
enable = mkEnableOption "Enable tidalcycles tools and plugins";
flash = mkOption {
description = ''When sending a paragraph or a single line, vim-tidal will "flash" the selection for some milliseconds'';

View File

@ -10,19 +10,19 @@ with builtins; {
enable = mkOption {
default = false;
type = types.bool;
description = "enable tree-sitter [nvim-treesitter]";
description = "Enable tree-sitter [nvim-treesitter]";
};
fold = mkOption {
default = false;
type = types.bool;
description = "enable fold with tree-sitter";
description = "Enable fold with tree-sitter";
};
autotagHtml = mkOption {
default = false;
type = types.bool;
description = "enable autoclose and rename html tag [nvim-ts-autotag]";
description = "Enable autoclose and rename html tag [nvim-ts-autotag]";
};
grammars = mkOption {

View File

@ -6,6 +6,6 @@
with lib;
with builtins; {
options.vim.ui.noice = {
enable = mkEnableOption "noice-nvim";
enable = mkEnableOption "Enable noice-nvim UI modifications";
};
}

View File

@ -6,6 +6,6 @@
with lib;
with builtins; {
options.vim.binds.cheatsheet = {
enable = mkEnableOption "Searchable cheatsheet for nvim using telescope";
enable = mkEnableOption "Enable cheatsheet-nvim: searchable cheatsheet for nvim using telescope";
};
}

View File

@ -6,6 +6,6 @@
with lib;
with builtins; {
options.vim.binds.whichKey = {
enable = mkEnableOption "which-key menu";
enable = mkEnableOption "Enable which-key keybind menu";
};
}

View File

@ -6,6 +6,6 @@
with lib;
with builtins; {
options.vim.utility.colorizer = {
enable = mkEnableOption "ccc color picker for neovim";
enable = mkEnableOption "Enable ccc color picker for neovim";
};
}

View File

@ -6,6 +6,6 @@
with lib;
with builtins; {
options.vim.utility.icon-picker = {
enable = mkEnableOption "Nerdfonts icon picker for nvim";
enable = mkEnableOption "Enable nerdfonts icon picker for nvim";
};
}

View File

@ -6,6 +6,6 @@
with lib;
with builtins; {
options.vim.telescope = {
enable = mkEnableOption "enable telescope";
enable = mkEnableOption "Enable multi-purpose telescope utility";
};
}

View File

@ -6,6 +6,6 @@
with lib;
with builtins; {
options.vim.utility.venn-nvim = {
enable = mkEnableOption "draw ASCII diagrams in Neovim";
enable = mkEnableOption "Enable venn.nvim: draw ASCII diagrams in Neovim";
};
}

View File

@ -8,56 +8,56 @@ with builtins; {
options.vim.visuals = {
enable = mkOption {
type = types.bool;
description = "visual enhancements";
description = "Enable visual enhancements";
default = false;
};
nvimWebDevicons.enable = mkOption {
type = types.bool;
description = "enable dev icons. required for certain plugins [nvim-web-devicons]";
description = "Enable dev icons. required for certain plugins [nvim-web-devicons]";
default = false;
};
lspkind.enable = mkOption {
type = types.bool;
description = "enable vscode-like pictograms for lsp [lspkind]";
description = "Enable vscode-like pictograms for lsp [lspkind]";
default = false;
};
scrollBar.enable = mkOption {
type = types.bool;
description = "enable scrollbar [scrollbar.nvim]";
description = "Enable scrollbar [scrollbar.nvim]";
default = false;
};
smoothScroll.enable = mkOption {
type = types.bool;
description = "enable smooth scrolling [cinnamon-nvim]";
description = "Enable smooth scrolling [cinnamon-nvim]";
default = false;
};
cellularAutomaton.enable = mkOption {
type = types.bool;
description = "enable cellular automaton [cellular-automaton]";
description = "Enable cellular automaton [cellular-automaton]";
default = false;
};
fidget-nvim = {
enable = mkOption {
type = types.bool;
description = "enable nvim LSP UI element [fidget-nvim]";
description = "Enable nvim LSP UI element [fidget-nvim]";
default = false;
};
align = {
bottom = mkOption {
type = types.bool;
description = "align to bottom";
description = "Align to bottom";
default = true;
};
right = mkOption {
type = types.bool;
description = "align to right";
description = "Align to right";
default = true;
};
};
@ -66,20 +66,20 @@ with builtins; {
cursorWordline = {
enable = mkOption {
type = types.bool;
description = "enable word and delayed line highlight [nvim-cursorline]";
description = "Enable word and delayed line highlight [nvim-cursorline]";
default = false;
};
lineTimeout = mkOption {
type = types.int;
description = "time in milliseconds for cursorline to appear";
description = "Time in milliseconds for cursorline to appear";
};
};
indentBlankline = {
enable = mkOption {
type = types.bool;
description = "enable indentation guides [indent-blankline]";
description = "Enable indentation guides [indent-blankline]";
default = false;
};