Merge pull request #178 from NotAShelf/assert-assertions

This commit is contained in:
NotAShelf 2023-11-16 12:03:58 +03:00 committed by GitHub
commit a535f87cc8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
144 changed files with 682 additions and 626 deletions

View file

@ -805,11 +805,11 @@
"rust-overlay": "rust-overlay" "rust-overlay": "rust-overlay"
}, },
"locked": { "locked": {
"lastModified": 1689759503, "lastModified": 1699423608,
"narHash": "sha256-wFrcae6V58hIlDW+7NDoUXzXBmsU7W/k3V1KIePcwRA=", "narHash": "sha256-WEVUgivm5DCziwZqiXRPeoD3FQTXW38ExKrZjvMveqE=",
"owner": "oxalica", "owner": "oxalica",
"repo": "nil", "repo": "nil",
"rev": "59bcad0b13b5d77668c0c125fef71d7b41406d7a", "rev": "5607d429016d6f9a72843b07127fad23ea9d661f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1583,11 +1583,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1688783586, "lastModified": 1696817516,
"narHash": "sha256-HHaM2hk2azslv1kH8zmQxXo2e7i5cKgzNIuK4yftzB0=", "narHash": "sha256-Xt9OY4Wnk9/vuUfA0OHFtmSlaen5GyiS9msgwOz3okI=",
"owner": "oxalica", "owner": "oxalica",
"repo": "rust-overlay", "repo": "rust-overlay",
"rev": "7a29283cc242c2486fc67f60b431ef708046d176", "rev": "c0df7f2a856b5ff27a3ce314f6d7aacf5fda546f",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -38,12 +38,19 @@
}; };
perSystem = { perSystem = {
self',
config, config,
pkgs, pkgs,
... ...
}: { }: {
devShells.default = pkgs.mkShell {nativeBuildInputs = [config.packages.nix];};
formatter = pkgs.alejandra; formatter = pkgs.alejandra;
devShells = {
default = self'.devShells.lsp;
nvim-nix = pkgs.mkShell {nativeBuildInputs = [config.packages.nix];};
lsp = pkgs.mkShell {
nativeBuildInputs = with pkgs; [nil statix deadnix];
};
};
}; };
}; };

View file

@ -4,4 +4,5 @@
types = import ./types {inherit lib;}; types = import ./types {inherit lib;};
languages = import ./languages.nix {inherit lib;}; languages = import ./languages.nix {inherit lib;};
lua = import ./lua.nix {inherit lib;}; lua = import ./lua.nix {inherit lib;};
vim = import ./vim.nix {inherit lib;};
} }

View file

@ -1,11 +1,8 @@
# Helpers for converting values to lua # Helpers for converting values to lua
{lib}: rec { {lib}: let
# yes? no. inherit (lib) mapAttrsToList filterAttrs concatStringsSep concatMapStringsSep stringToCharacters boolToString;
yesNo = value: inherit (builtins) hasAttr head;
if value in rec {
then "yes"
else "no";
# Convert a null value to lua's nil # Convert a null value to lua's nil
nullString = value: nullString = value:
if value == null if value == null
@ -46,4 +43,44 @@
+ " }"; + " }";
# Convert a list of lua expressions to a lua table. The difference to listToLuaTable is that the elements here are expected to be lua expressions already, whereas listToLuaTable converts from nix types to lua first # Convert a list of lua expressions to a lua table. The difference to listToLuaTable is that the elements here are expected to be lua expressions already, whereas listToLuaTable converts from nix types to lua first
luaTable = items: ''{${builtins.concatStringsSep "," items}}''; luaTable = items: ''{${builtins.concatStringsSep "," items}}'';
toLuaObject = args:
if builtins.isAttrs args
then
if hasAttr "__raw" args
then args.__raw
else if hasAttr "__empty" args
then "{ }"
else
"{"
+ (concatStringsSep ","
(mapAttrsToList
(n: v:
if head (stringToCharacters n) == "@"
then toLuaObject v
else "[${toLuaObject n}] = " + (toLuaObject v))
(filterAttrs
(
_: v:
(v != null) && (toLuaObject v != "{}")
)
args)))
+ "}"
else if builtins.isList args
then "{" + concatMapStringsSep "," toLuaObject args + "}"
else if builtins.isString args
then
# This should be enough!
builtins.toJSON args
else if builtins.isPath args
then builtins.toJSON (toString args)
else if builtins.isBool args
then "${boolToString args}"
else if builtins.isFloat args
then "${toString args}"
else if builtins.isInt args
then "${toString args}"
else if (args != null)
then "nil"
else "";
} }

26
lib/vim.nix Normal file
View file

@ -0,0 +1,26 @@
{lib}: let
inherit (builtins) isInt isBool toJSON;
in rec {
# yes? no.
yesNo = value:
if value
then "yes"
else "no";
# convert a boolean to a vim compliant boolean string
mkVimBool = val:
if val
then "1"
else "0";
# convert a literal value to a vim compliant value
valToVim = val:
if (isInt val)
then (builtins.toString val)
else
(
if (isBool val)
then (mkVimBool val)
else (toJSON val)
);
}

View file

@ -1,27 +0,0 @@
{
config,
lib,
...
}:
with lib; let
cfg = config.vim;
in {
config = {
assertions = mkMerge [
{
assertion = cfg.kommentary.enable;
message = "Kommentary has been deprecated in favor of comments-nvim";
}
{
assertion = cfg.utility.colorizer.enable;
message = "config.utility.colorizer has been renamed to config.utility.ccc";
}
mkIf
(config.programs.neovim-flake.enable)
{
assertion = !config.programs.neovim.enable;
message = "You cannot use `programs.neovim-flake.enable` with `programs.neovim.enable`";
}
];
};
}

View file

@ -3,9 +3,10 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (builtins) toJSON;
with builtins; let inherit (lib) mkIf nvim mkLuaBinding mkMerge;
cfg = config.vim.assistant.copilot; cfg = config.vim.assistant.copilot;
wrapPanelBinding = luaFunction: key: '' wrapPanelBinding = luaFunction: key: ''
@ -13,7 +14,7 @@ with builtins; let
local s, _ = pcall(${luaFunction}) local s, _ = pcall(${luaFunction})
if not s then if not s then
local termcode = vim.api.nvim_replace_termcodes(${builtins.toJSON key}, true, false, true) local termcode = vim.api.nvim_replace_termcodes(${toJSON key}, true, false, true)
vim.fn.feedkeys(termcode, 'n') vim.fn.feedkeys(termcode, 'n')
end end

View file

@ -3,9 +3,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) mkEnableOption mkOption types;
with builtins; let
cfg = config.vim.assistant.copilot; cfg = config.vim.assistant.copilot;
in { in {
options.vim.assistant.copilot = { options.vim.assistant.copilot = {

View file

@ -2,9 +2,10 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (builtins) toJSON;
with builtins; let inherit (lib) mkIf mkMerge mkExprBinding boolToString nvim;
cfg = config.vim.assistant.tabnine; cfg = config.vim.assistant.tabnine;
in { in {
config = mkIf cfg.enable { config = mkIf cfg.enable {
@ -17,7 +18,7 @@ in {
local completion = require("tabnine.completion") local completion = require("tabnine.completion")
if not state.completions_cache then if not state.completions_cache then
return "${builtins.toJSON cfg.mappings.accept}" return "${toJSON cfg.mappings.accept}"
end end
vim.schedule(completion.accept) vim.schedule(completion.accept)
@ -29,7 +30,7 @@ in {
local completion = require("tabnine.completion") local completion = require("tabnine.completion")
if not state.completions_cache then if not state.completions_cache then
return "${builtins.toJSON cfg.mappings.dismiss}" return "${toJSON cfg.mappings.dismiss}"
end end
vim.schedule(function() vim.schedule(function()

View file

@ -1,6 +1,6 @@
{lib, ...}: {lib, ...}: let
with lib; inherit (lib) mkEnableOption mkOption types mkMappingOption;
with builtins; { in {
options.vim.assistant.tabnine = { options.vim.assistant.tabnine = {
enable = mkEnableOption "Tabnine assistant"; enable = mkEnableOption "Tabnine assistant";

View file

@ -2,9 +2,9 @@
lib, lib,
config, config,
... ...
}: }: let
with lib; inherit (lib) mkIf nvim optionalString boolToString;
with builtins; let
cfg = config.vim.autopairs; cfg = config.vim.autopairs;
in { in {
config = config =

View file

@ -1,6 +1,6 @@
{lib, ...}: {lib, ...}: let
with lib; inherit (lib) mkEnableOption mkOption types;
with builtins; { in {
options.vim = { options.vim = {
autopairs = { autopairs = {
enable = mkEnableOption "autopairs" // {default = false;}; enable = mkEnableOption "autopairs" // {default = false;};

View file

@ -2,9 +2,10 @@
lib, lib,
config, config,
... ...
}: }: let
with lib; inherit (builtins) concatStringsSep;
with builtins; let inherit (lib) optionalString mkIf nvim;
cfg = config.vim; cfg = config.vim;
in { in {
config = { config = {
@ -57,8 +58,8 @@ in {
}; };
vim.configRC.basic = nvim.dag.entryAfter ["globalsScript"] '' vim.configRC.basic = nvim.dag.entryAfter ["globalsScript"] ''
" Debug mode settings
${optionalString cfg.debugMode.enable '' ${optionalString cfg.debugMode.enable ''
" Debug mode settings
set verbose=${toString cfg.debugMode.level} set verbose=${toString cfg.debugMode.level}
set verbosefile=${cfg.debugMode.logFile} set verbosefile=${cfg.debugMode.logFile}
''} ''}
@ -141,7 +142,7 @@ in {
''} ''}
${optionalString cfg.spellChecking.enable '' ${optionalString cfg.spellChecking.enable ''
set spell set spell
set spelllang=${builtins.concatStringsSep "," cfg.spellChecking.languages}${optionalString cfg.spellChecking.enableProgrammingWordList ",programming"} set spelllang=${concatStringsSep "," cfg.spellChecking.languages}${optionalString cfg.spellChecking.enableProgrammingWordList ",programming"}
''} ''}
${optionalString (cfg.leaderKey != null) '' ${optionalString (cfg.leaderKey != null) ''
let mapleader = "${toString cfg.leaderKey}" let mapleader = "${toString cfg.leaderKey}"

View file

@ -2,9 +2,10 @@
pkgs, pkgs,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) mkEnableOption mkOption;
with builtins; { inherit (lib.types) types;
in {
options.vim = { options.vim = {
package = mkOption { package = mkOption {
type = types.package; type = types.package;

View file

@ -1,6 +1,6 @@
{lib, ...}: {lib, ...}: let
with lib; inherit (lib) mkEnableOption mkMappingOption;
with builtins; { in {
options.vim.comments.comment-nvim = { options.vim.comments.comment-nvim = {
enable = mkEnableOption "smart and powerful comment plugin for neovim comment-nvim"; enable = mkEnableOption "smart and powerful comment plugin for neovim comment-nvim";

View file

@ -2,9 +2,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) mkIf mkMerge mkExprBinding mkBinding nvim;
with builtins; let
cfg = config.vim.comments.comment-nvim; cfg = config.vim.comments.comment-nvim;
self = import ./comment-nvim.nix { self = import ./comment-nvim.nix {
inherit lib; inherit lib;

View file

@ -2,9 +2,11 @@
lib, lib,
config, config,
... ...
}: }: let
with lib; inherit (builtins) toJSON;
with builtins; let inherit (lib) addDescriptionsToMappings concatMapStringsSep attrNames concatStringsSep mapAttrsToList mkIf mkSetLuaBinding mkMerge optionalString;
inherit (lib.nvim) dag;
cfg = config.vim.autocomplete; cfg = config.vim.autocomplete;
lspkindEnabled = config.vim.lsp.enable && config.vim.lsp.lspkind.enable; lspkindEnabled = config.vim.lsp.enable && config.vim.lsp.lspkind.enable;
@ -31,8 +33,8 @@ with builtins; let
dagPlacement = dagPlacement =
if lspkindEnabled if lspkindEnabled
then nvim.dag.entryAfter ["lspkind"] then dag.entryAfter ["lspkind"]
else nvim.dag.entryAnywhere; else dag.entryAnywhere;
in { in {
config = mkIf cfg.enable { config = mkIf cfg.enable {
vim.startPlugins = [ vim.startPlugins = [
@ -59,7 +61,7 @@ in {
(mkSetLuaBinding mappings.confirm '' (mkSetLuaBinding mappings.confirm ''
function() function()
if not require('cmp').confirm({ select = true }) then if not require('cmp').confirm({ select = true }) then
local termcode = vim.api.nvim_replace_termcodes(${builtins.toJSON mappings.confirm.value}, true, false, true) local termcode = vim.api.nvim_replace_termcodes(${toJSON mappings.confirm.value}, true, false, true)
vim.fn.feedkeys(termcode, 'n') vim.fn.feedkeys(termcode, 'n')
end end
@ -85,7 +87,7 @@ in {
elseif has_words_before() then elseif has_words_before() then
cmp.complete() cmp.complete()
else else
local termcode = vim.api.nvim_replace_termcodes(${builtins.toJSON mappings.next.value}, true, false, true) local termcode = vim.api.nvim_replace_termcodes(${toJSON mappings.next.value}, true, false, true)
vim.fn.feedkeys(termcode, 'n') vim.fn.feedkeys(termcode, 'n')
end end
@ -152,7 +154,7 @@ in {
elseif has_words_before() then elseif has_words_before() then
cmp.complete() cmp.complete()
else else
local termcode = vim.api.nvim_replace_termcodes(${builtins.toJSON mappings.next.value}, true, false, true) local termcode = vim.api.nvim_replace_termcodes(${toJSON mappings.next.value}, true, false, true)
vim.fn.feedkeys(termcode, 'n') vim.fn.feedkeys(termcode, 'n')
end end

View file

@ -1,6 +1,6 @@
{lib, ...}: {lib, ...}: let
with lib; inherit (lib) mkEnableOption mkMappingOption mkOption types;
with builtins; { in {
options.vim = { options.vim = {
autocomplete = { autocomplete = {
enable = mkEnableOption "enable autocomplete" // {default = false;}; enable = mkEnableOption "enable autocomplete" // {default = false;};

View file

@ -2,9 +2,13 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (builtins) attrValues attrNames map mapAttrs toJSON isString concatStringsSep filter;
with builtins; let inherit (lib) mkOption types mapAttrsFlatten filterAttrs optionalString getAttrs literalExpression;
inherit (lib) nvim;
inherit (nvim.lua) toLuaObject;
inherit (nvim.vim) valToVim;
cfg = config.vim; cfg = config.vim;
wrapLuaConfig = luaConfig: '' wrapLuaConfig = luaConfig: ''
@ -20,7 +24,7 @@ with builtins; let
mkOption { mkOption {
type = types.bool; type = types.bool;
default = value; default = value;
description = description; inherit description;
}; };
# Most of the keybindings code is highly inspired by pta2002/nixvim. Thank you! # Most of the keybindings code is highly inspired by pta2002/nixvim. Thank you!
@ -67,7 +71,7 @@ with builtins; let
normalizeAction = action: let normalizeAction = action: let
# Extract the values of the config options that have been explicitly set by the user # Extract the values of the config options that have been explicitly set by the user
config = config =
filterAttrs (n: v: v != null) filterAttrs (_: v: v != null)
(getAttrs (attrNames mapConfigOptions) action); (getAttrs (attrNames mapConfigOptions) action);
in { in {
config = config =
@ -80,13 +84,13 @@ with builtins; let
else action.action; else action.action;
}; };
in in
builtins.attrValues (builtins.mapAttrs attrValues (mapAttrs
(key: action: let (key: action: let
normalizedAction = normalizeAction action; normalizedAction = normalizeAction action;
in { in {
inherit (normalizedAction) action config; inherit (normalizedAction) action config;
key = key; inherit key;
mode = mode; inherit mode;
}) })
maps); maps);
@ -117,171 +121,144 @@ with builtins; let
default = {}; default = {};
}; };
in { in {
options.vim = { options = {
viAlias = mkOption { assertions = lib.mkOption {
description = "Enable vi alias"; type = with types; listOf unspecified;
type = types.bool;
default = true;
};
vimAlias = mkOption {
description = "Enable vim alias";
type = types.bool;
default = true;
};
configRC = mkOption {
description = "vimrc contents";
type = types.oneOf [(nvim.types.dagOf types.lines) types.str];
default = {};
};
luaConfigRC = mkOption {
description = "vim lua config";
type = types.oneOf [(nvim.types.dagOf types.lines) types.str];
default = {};
};
builtConfigRC = mkOption {
internal = true; internal = true;
type = types.lines;
description = "The built config for neovim after resolving the DAG";
};
startPlugins = nvim.types.pluginsOpt {
default = []; default = [];
description = "List of plugins to startup.";
};
optPlugins = nvim.types.pluginsOpt {
default = [];
description = "List of plugins to optionally load";
};
extraPlugins = mkOption {
type = types.attrsOf nvim.types.extraPluginType;
default = {};
description = ''
List of plugins and related config.
Note that these are setup after builtin plugins.
'';
example = literalExpression '' example = literalExpression ''
with pkgs.vimPlugins; { [
aerial = { {
package = aerial-nvim; assertion = false;
setup = "require('aerial').setup {}"; message = "you can't enable this for that reason";
}; }
harpoon = { ]
package = harpoon; '';
setup = "require('harpoon').setup {}";
after = ["aerial"];
};
}'';
}; };
globals = mkOption { warnings = mkOption {
default = {}; internal = true;
description = "Set containing global variable values"; default = [];
type = types.attrs; type = with types; listOf str;
example = ["The `foo' service is deprecated and will go away soon!"];
description = lib.mdDoc ''
This option allows modules to show warnings to users during
the evaluation of the system configuration.
'';
}; };
maps = mkOption { vim = {
type = types.submodule { viAlias = mkOption {
options = { description = "Enable vi alias";
normal = mapOptions "normal"; type = types.bool;
insert = mapOptions "insert"; default = true;
select = mapOptions "select";
visual = mapOptions "visual and select";
terminal = mapOptions "terminal";
normalVisualOp = mapOptions "normal, visual, select and operator-pending (same as plain 'map')";
visualOnly = mapOptions "visual only";
operator = mapOptions "operator-pending";
insertCommand = mapOptions "insert and command-line";
lang = mapOptions "insert, command-line and lang-arg";
command = mapOptions "command-line";
};
}; };
default = {};
description = ''
Custom keybindings for any mode.
For plain maps (e.g. just 'map' or 'remap') use maps.normalVisualOp. vimAlias = mkOption {
''; description = "Enable vim alias";
type = types.bool;
default = true;
};
example = '' configRC = mkOption {
maps = { description = "vimrc contents";
normal."<leader>m" = { type = types.oneOf [(nvim.types.dagOf types.lines) types.str];
silent = true; default = {};
action = "<cmd>make<CR>"; };
}; # Same as nnoremap <leader>m <silent> <cmd>make<CR>
luaConfigRC = mkOption {
description = "vim lua config";
type = types.oneOf [(nvim.types.dagOf types.lines) types.str];
default = {};
};
builtConfigRC = mkOption {
internal = true;
type = types.lines;
description = "The built config for neovim after resolving the DAG";
};
startPlugins = nvim.types.pluginsOpt {
default = [];
description = "List of plugins to startup.";
};
optPlugins = nvim.types.pluginsOpt {
default = [];
description = "List of plugins to optionally load";
};
extraPlugins = mkOption {
type = types.attrsOf nvim.types.extraPluginType;
default = {};
description = ''
List of plugins and related config.
Note that these are setup after builtin plugins.
'';
example = literalExpression ''
with pkgs.vimPlugins; {
aerial = {
package = aerial-nvim;
setup = "require('aerial').setup {}";
};
harpoon = {
package = harpoon;
setup = "require('harpoon').setup {}";
after = ["aerial"];
};
}'';
};
globals = mkOption {
default = {};
description = "Set containing global variable values";
type = types.attrs;
};
maps = mkOption {
type = types.submodule {
options = {
normal = mapOptions "normal";
insert = mapOptions "insert";
select = mapOptions "select";
visual = mapOptions "visual and select";
terminal = mapOptions "terminal";
normalVisualOp = mapOptions "normal, visual, select and operator-pending (same as plain 'map')";
visualOnly = mapOptions "visual only";
operator = mapOptions "operator-pending";
insertCommand = mapOptions "insert and command-line";
lang = mapOptions "insert, command-line and lang-arg";
command = mapOptions "command-line";
};
}; };
''; default = {};
description = ''
Custom keybindings for any mode.
For plain maps (e.g. just 'map' or 'remap') use maps.normalVisualOp.
'';
example = ''
maps = {
normal."<leader>m" = {
silent = true;
action = "<cmd>make<CR>";
}; # Same as nnoremap <leader>m <silent> <cmd>make<CR>
};
'';
};
}; };
}; };
config = let config = let
mkVimBool = val:
if val
then "1"
else "0";
valToVim = val:
if (isInt val)
then (builtins.toString val)
else
(
if (isBool val)
then (mkVimBool val)
else (toJSON val)
);
filterNonNull = mappings: filterAttrs (_name: value: value != null) mappings; filterNonNull = mappings: filterAttrs (_name: value: value != null) mappings;
globalsScript = globalsScript =
mapAttrsFlatten (name: value: "let g:${name}=${valToVim value}") mapAttrsFlatten (name: value: "let g:${name}=${valToVim value}")
(filterNonNull cfg.globals); (filterNonNull cfg.globals);
toLuaObject = args:
if builtins.isAttrs args
then
if hasAttr "__raw" args
then args.__raw
else if hasAttr "__empty" args
then "{ }"
else
"{"
+ (concatStringsSep ","
(mapAttrsToList
(n: v:
if head (stringToCharacters n) == "@"
then toLuaObject v
else "[${toLuaObject n}] = " + (toLuaObject v))
(filterAttrs
(
n: v:
!isNull v && (toLuaObject v != "{}")
)
args)))
+ "}"
else if builtins.isList args
then "{" + concatMapStringsSep "," toLuaObject args + "}"
else if builtins.isString args
then
# This should be enough!
builtins.toJSON args
else if builtins.isPath args
then builtins.toJSON (toString args)
else if builtins.isBool args
then "${boolToString args}"
else if builtins.isFloat args
then "${toString args}"
else if builtins.isInt args
then "${toString args}"
else if isNull args
then "nil"
else "";
toLuaBindings = mode: maps: toLuaBindings = mode: maps:
builtins.map (value: '' map (value: ''
vim.keymap.set(${toLuaObject mode}, ${toLuaObject value.key}, ${toLuaObject value.action}, ${toLuaObject value.config}) vim.keymap.set(${toLuaObject mode}, ${toLuaObject value.key}, ${toLuaObject value.action}, ${toLuaObject value.config})
'') (genMaps mode maps); '') (genMaps mode maps);
@ -304,8 +281,8 @@ in {
mapResult, mapResult,
}: let }: let
# When the value is a string, default it to dag.entryAnywhere # When the value is a string, default it to dag.entryAnywhere
finalDag = lib.mapAttrs (name: value: finalDag = lib.mapAttrs (_: value:
if builtins.isString value if isString value
then nvim.dag.entryAnywhere value then nvim.dag.entryAnywhere value
else value) else value)
dag; dag;
@ -313,7 +290,7 @@ in {
result = result =
if sortedDag ? result if sortedDag ? result
then mapResult sortedDag.result then mapResult sortedDag.result
else abort ("Dependency cycle in ${name}: " + toJSON sortedConfig); else abort ("Dependency cycle in ${name}: " + toJSON sortedDag);
in in
result; result;
in { in {
@ -378,6 +355,13 @@ in {
}; };
builtConfigRC = let builtConfigRC = let
failedAssertions = map (x: x.message) (filter (x: !x.assertion) config.assertions);
baseSystemAssertWarn =
if failedAssertions != []
then throw "\nFailed assertions:\n${concatStringsSep "\n" (map (x: "- ${x}") failedAssertions)}"
else lib.showWarnings config.warnings;
mkSection = r: '' mkSection = r: ''
" SECTION: ${r.name} " SECTION: ${r.name}
${r.data} ${r.data}
@ -389,7 +373,7 @@ in {
inherit mapResult; inherit mapResult;
}; };
in in
vimConfig; baseSystemAssertWarn vimConfig;
}; };
}; };
} }

View file

@ -2,9 +2,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) mkEnableOption;
with builtins; { in {
options.vim.dashboard.alpha = { options.vim.dashboard.alpha = {
enable = mkEnableOption "dashboard via alpha.nvim"; enable = mkEnableOption "dashboard via alpha.nvim";
}; };

View file

@ -2,9 +2,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) mkIf nvim;
with builtins; let
cfg = config.vim.dashboard.alpha; cfg = config.vim.dashboard.alpha;
in { in {
config = mkIf cfg.enable { config = mkIf cfg.enable {

View file

@ -2,9 +2,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) mkIf nvim;
with builtins; let
cfg = config.vim.dashboard.dashboard-nvim; cfg = config.vim.dashboard.dashboard-nvim;
in { in {
config = mkIf cfg.enable { config = mkIf cfg.enable {

View file

@ -2,9 +2,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) mkEnableOption;
with builtins; { in {
options.vim.dashboard.dashboard-nvim = { options.vim.dashboard.dashboard-nvim = {
enable = mkEnableOption "dashboard via dashboard.nvim"; enable = mkEnableOption "dashboard via dashboard.nvim";
}; };

View file

@ -3,9 +3,9 @@
config, config,
lib, lib,
... ...
}: }: let
with builtins; inherit (lib) mkIf;
with lib; let
cfg = config.vim.dashboard.startify; cfg = config.vim.dashboard.startify;
mkVimBool = val: mkVimBool = val:

View file

@ -2,9 +2,9 @@
config, config,
lib, lib,
... ...
}: }: let
with builtins; inherit (lib) mkEnableOption mkOption types;
with lib; { in {
options.vim.dashboard.startify = { options.vim.dashboard.startify = {
enable = mkEnableOption "dashboard via vim-startify"; enable = mkEnableOption "dashboard via vim-startify";

View file

@ -2,9 +2,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) addDescriptionsToMappings mkMerge mkIf mapAttrs nvim mkSetLuaBinding optionalString;
with builtins; let
cfg = config.vim.debugger.nvim-dap; cfg = config.vim.debugger.nvim-dap;
self = import ./nvim-dap.nix { self = import ./nvim-dap.nix {
inherit lib; inherit lib;

View file

@ -1,5 +1,6 @@
{lib, ...}: {lib, ...}: let
with lib; { inherit (lib) mkEnableOption mkOption types mkMappingOption;
in {
options.vim.debugger.nvim-dap = { options.vim.debugger.nvim-dap = {
enable = mkEnableOption "debugging via nvim-dap"; enable = mkEnableOption "debugging via nvim-dap";

View file

@ -5,8 +5,8 @@ inputs: {
check ? true, check ? true,
extraSpecialArgs ? {}, extraSpecialArgs ? {},
}: let }: let
inherit (pkgs) neovim-unwrapped wrapNeovim vimPlugins;
inherit (builtins) map filter isString toString getAttr; inherit (builtins) map filter isString toString getAttr;
inherit (pkgs) wrapNeovim vimPlugins;
inherit (pkgs.vimUtils) buildVimPlugin; inherit (pkgs.vimUtils) buildVimPlugin;
extendedLib = import ../lib/stdlib-extended.nix lib; extendedLib = import ../lib/stdlib-extended.nix lib;
@ -21,6 +21,8 @@ inputs: {
specialArgs = {modulesPath = toString ./.;} // extraSpecialArgs; specialArgs = {modulesPath = toString ./.;} // extraSpecialArgs;
}; };
vimOptions = module.config.vim;
buildPlug = {pname, ...} @ args: buildPlug = {pname, ...} @ args:
assert lib.asserts.assertMsg (pname != "nvim-treesitter") "Use buildTreesitterPlug for building nvim-treesitter."; assert lib.asserts.assertMsg (pname != "nvim-treesitter") "Use buildTreesitterPlug for building nvim-treesitter.";
buildVimPlugin (args buildVimPlugin (args
@ -31,8 +33,6 @@ inputs: {
buildTreesitterPlug = grammars: vimPlugins.nvim-treesitter.withPlugins (_: grammars); buildTreesitterPlug = grammars: vimPlugins.nvim-treesitter.withPlugins (_: grammars);
vimOptions = module.config.vim;
buildConfigPlugins = plugins: buildConfigPlugins = plugins:
map map
(plug: ( (plug: (

View file

@ -3,9 +3,9 @@
lib, lib,
pkgs, pkgs,
... ...
}: }: let
with lib; inherit (lib) mkIf mkMerge mkBinding nvim boolToString;
with builtins; let
cfg = config.vim.filetree.nvimTree; cfg = config.vim.filetree.nvimTree;
self = import ./nvimtree.nix { self = import ./nvimtree.nix {
inherit pkgs; inherit pkgs;

View file

@ -2,9 +2,9 @@
pkgs, pkgs,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) mkEnableOption mkOption types literalExpression;
with builtins; { in {
options.vim.filetree.nvimTree = { options.vim.filetree.nvimTree = {
enable = mkEnableOption "filetree via nvim-tree.lua"; enable = mkEnableOption "filetree via nvim-tree.lua";

View file

@ -2,9 +2,10 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (builtins) toJSON;
with builtins; let inherit (lib) addDescriptionsToMappings mkIf mkMerge mkSetExprBinding mkSetLuaBinding nvim;
cfg = config.vim.git; cfg = config.vim.git;
self = import ./git.nix {inherit lib;}; self = import ./git.nix {inherit lib;};
@ -70,7 +71,7 @@ in {
vim.lsp.null-ls.sources.gitsigns-ca = '' vim.lsp.null-ls.sources.gitsigns-ca = ''
table.insert( table.insert(
ls_sources, ls_sources,
null_ls.builtins.code_actions.gitsigns null_ls.gcode_actions.gitsigns
) )
''; '';
}) })

View file

@ -1,6 +1,6 @@
{lib, ...}: {lib, ...}: let
with lib; inherit (lib) mkEnableOption mkMappingOption;
with builtins; { in {
options.vim.git = { options.vim.git = {
enable = mkEnableOption "git tools via gitsigns"; enable = mkEnableOption "git tools via gitsigns";

View file

@ -3,9 +3,9 @@
config, config,
lib, lib,
... ...
}: }: let
with builtins; let inherit (builtins) attrNames;
inherit (lib) mkOption mkEnableOption types; inherit (lib) mkOption mkEnableOption types isList nvim;
cfg = config.vim.languages.bash; cfg = config.vim.languages.bash;

View file

@ -3,9 +3,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) isList nvim mkIf mkMerge;
with builtins; let
cfg = config.vim.languages.bash; cfg = config.vim.languages.bash;
diagnostics = { diagnostics = {
shellcheck = { shellcheck = {

View file

@ -3,9 +3,10 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (builtins) attrNames;
with builtins; let inherit (lib) isList nvim optionalString mkEnableOption mkOption types mkIf mkMerge;
cfg = config.vim.languages.clang; cfg = config.vim.languages.clang;
defaultServer = "ccls"; defaultServer = "ccls";

View file

@ -3,9 +3,9 @@
lib, lib,
pkgs, pkgs,
... ...
}: }: let
with lib; inherit (lib) isList nvim mkIf mkMerge optionalString boolToString;
with builtins; let
cfg = config.vim.languages.dart; cfg = config.vim.languages.dart;
ftcfg = cfg.flutter-tools; ftcfg = cfg.flutter-tools;
servers = { servers = {

View file

@ -3,9 +3,10 @@
lib, lib,
pkgs, pkgs,
... ...
}: }: let
with lib; inherit (builtins) attrNames;
with builtins; let inherit (lib) isList nvim mkEnableOption mkOption types optionalString;
cfg = config.vim.languages.dart; cfg = config.vim.languages.dart;
defaultServer = "dart"; defaultServer = "dart";
servers = { servers = {

View file

@ -3,9 +3,9 @@
lib, lib,
pkgs, pkgs,
... ...
}: }: let
with lib; inherit (lib) nvim mkIf getExe;
with builtins; let
cfg = config.vim.languages.elixir; cfg = config.vim.languages.elixir;
in { in {
config = mkIf (cfg.enable) { config = mkIf (cfg.enable) {
@ -23,7 +23,7 @@ in {
-- alternatively, point to an existing elixir-ls installation (optional) -- alternatively, point to an existing elixir-ls installation (optional)
-- not currently supported by elixirls, but can be a table if you wish to pass other args `{"path/to/elixirls", "--foo"}` -- not currently supported by elixirls, but can be a table if you wish to pass other args `{"path/to/elixirls", "--foo"}`
cmd = "${lib.getExe pkgs.elixir-ls}", cmd = "${getExe pkgs.elixir-ls}",
-- default settings, use the `settings` function to override settings -- default settings, use the `settings` function to override settings
settings = elixirls.settings { settings = elixirls.settings {

View file

@ -2,9 +2,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) mkEnableOption;
with builtins; { in {
options.vim.languages.elixir = { options.vim.languages.elixir = {
enable = mkEnableOption "Elixir language support"; enable = mkEnableOption "Elixir language support";
}; };

View file

@ -3,9 +3,10 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (builtins) attrNames;
with builtins; let inherit (lib) isList nvim getExe mkEnableOption mkOption types mkMerge mkIf;
cfg = config.vim.languages.go; cfg = config.vim.languages.go;
defaultServer = "gopls"; defaultServer = "gopls";

View file

@ -3,9 +3,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) mkEnableOption mkOption types nvim mkIf mkMerge optional;
with builtins; let
cfg = config.vim.languages.html; cfg = config.vim.languages.html;
in { in {
options.vim.languages.html = { options.vim.languages.html = {

View file

@ -3,9 +3,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) isList nvim mkEnableOption mkOption types mkIf mkMerge;
with builtins; let
cfg = config.vim.languages.java; cfg = config.vim.languages.java;
in { in {
options.vim.languages.java = { options.vim.languages.java = {

View file

@ -3,9 +3,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) isList nvim mkEnableOption mkOption types mkIf mkMerge optionalString getExe;
with builtins; let
cfg = config.vim.languages.lua; cfg = config.vim.languages.lua;
in { in {
options.vim.languages.lua = { options.vim.languages.lua = {

View file

@ -3,9 +3,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) nvim mkIf mkMerge;
with builtins; let
cfg = config.vim.languages.markdown; cfg = config.vim.languages.markdown;
in { in {
config = mkIf cfg.enable (mkMerge [ config = mkIf cfg.enable (mkMerge [

View file

@ -3,9 +3,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) mkEnableOption mkOption types nvim;
with builtins; let
cfg = config.vim.languages.markdown; cfg = config.vim.languages.markdown;
in { in {
options.vim.languages.markdown = { options.vim.languages.markdown = {

View file

@ -3,9 +3,10 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (builtins) attrNames;
with builtins; let inherit (lib) isList nvim mkEnableOption mkOption types mkIf mkMerge optionalString;
cfg = config.vim.languages.nix; cfg = config.vim.languages.nix;
useFormat = "on_attach = default_on_attach"; useFormat = "on_attach = default_on_attach";

View file

@ -3,9 +3,10 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (builtins) attrNames;
with builtins; let inherit (lib) isList nvim mkEnableOption mkOption types mkIf mkMerge getExe;
cfg = config.vim.languages.php; cfg = config.vim.languages.php;
defaultServer = "phpactor"; defaultServer = "phpactor";

View file

@ -3,9 +3,10 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (builtins) attrNames;
with builtins; let inherit (lib) isList nvim mkEnableOption mkOption types mkIf mkMerge getExe literalExpression;
cfg = config.vim.languages.python; cfg = config.vim.languages.python;
defaultServer = "pyright"; defaultServer = "pyright";

View file

@ -3,9 +3,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) isList nvim mkEnableOption mkOption types mkIf mkMerge optionalString boolToString optionals;
with builtins; let
cfg = config.vim.languages.rust; cfg = config.vim.languages.rust;
in { in {
options.vim.languages.rust = { options.vim.languages.rust = {

View file

@ -3,9 +3,10 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (builtins) attrNames;
with builtins; let inherit (lib) isList nvim mkEnableOption mkOption types mkIf mkMerge;
cfg = config.vim.languages.sql; cfg = config.vim.languages.sql;
sqlfluffDefault = pkgs.sqlfluff; sqlfluffDefault = pkgs.sqlfluff;

View file

@ -3,9 +3,10 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (builtins) attrNames;
with builtins; let inherit (lib) isList nvim mkEnableOption mkOption types mkIf mkMerge;
cfg = config.vim.languages.svelte; cfg = config.vim.languages.svelte;
defaultServer = "svelte"; defaultServer = "svelte";

View file

@ -3,9 +3,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) mkIf;
with builtins; let
cfg = config.vim.tidal; cfg = config.vim.tidal;
in { in {
config = mkIf (cfg.enable) { config = mkIf (cfg.enable) {

View file

@ -2,9 +2,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) mkEnableOption mkOption types;
with builtins; { in {
options.vim.tidal = { options.vim.tidal = {
enable = mkEnableOption "tidalcycles tools and plugins"; enable = mkEnableOption "tidalcycles tools and plugins";

View file

@ -3,9 +3,10 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (builtins) attrNames;
with builtins; let inherit (lib) isList nvim mkEnableOption mkOption types mkIf mkMerge;
cfg = config.vim.languages.ts; cfg = config.vim.languages.ts;
defaultServer = "tsserver"; defaultServer = "tsserver";

View file

@ -3,9 +3,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) isList nvim mkEnableOption mkOption types mkIf mkMerge;
with builtins; let
cfg = config.vim.languages.zig; cfg = config.vim.languages.zig;
in { in {
options.vim.languages.zig = { options.vim.languages.zig = {

View file

@ -3,9 +3,9 @@
lib, lib,
pkgs, pkgs,
... ...
}: }: let
with lib; inherit (lib) addDescriptionsToMappings mkIf optional boolToString optionalString;
with builtins; let
cfg = config.vim.lsp; cfg = config.vim.lsp;
usingNvimCmp = config.vim.autocomplete.enable && config.vim.autocomplete.type == "nvim-cmp"; usingNvimCmp = config.vim.autocomplete.enable && config.vim.autocomplete.type == "nvim-cmp";
self = import ./module.nix {inherit config lib pkgs;}; self = import ./module.nix {inherit config lib pkgs;};

View file

@ -2,9 +2,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) mkIf nvim;
with builtins; let
cfg = config.vim.lsp; cfg = config.vim.lsp;
in { in {
config = mkIf (cfg.enable && cfg.lightbulb.enable) { config = mkIf (cfg.enable && cfg.lightbulb.enable) {

View file

@ -2,9 +2,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) mkEnableOption;
with builtins; { in {
options.vim.lsp = { options.vim.lsp = {
lightbulb = { lightbulb = {
enable = mkEnableOption "Lightbulb for code actions. Requires an emoji font"; enable = mkEnableOption "Lightbulb for code actions. Requires an emoji font";

View file

@ -2,9 +2,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) mkIf nvim optionalString;
with builtins; let
cfg = config.vim.lsp; cfg = config.vim.lsp;
in { in {
config = mkIf (cfg.enable && cfg.lspSignature.enable) { config = mkIf (cfg.enable && cfg.lspSignature.enable) {

View file

@ -2,9 +2,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) mkEnableOption;
with builtins; { in {
options.vim.lsp = { options.vim.lsp = {
lspSignature = { lspSignature = {
enable = mkEnableOption "lsp signature viewer"; enable = mkEnableOption "lsp signature viewer";

View file

@ -3,9 +3,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) mkIf mkMerge nvim optionalString mapAttrs;
with builtins; let
cfg = config.vim.lsp; cfg = config.vim.lsp;
in { in {
config = mkIf cfg.lspconfig.enable (mkMerge [ config = mkIf cfg.lspconfig.enable (mkMerge [

View file

@ -3,9 +3,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) mkEnableOption mkOption types;
with builtins; { in {
options.vim.lsp.lspconfig = { options.vim.lsp.lspconfig = {
enable = mkEnableOption "nvim-lspconfig, also enabled automatically"; enable = mkEnableOption "nvim-lspconfig, also enabled automatically";

View file

@ -3,9 +3,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) mkIf nvim;
with builtins; let
cfg = config.vim.lsp; cfg = config.vim.lsp;
in { in {
config = mkIf (cfg.enable && cfg.lspkind.enable) { config = mkIf (cfg.enable && cfg.lspkind.enable) {

View file

@ -3,9 +3,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) mkEnableOption mkOption types;
with builtins; let
cfg = config.vim.lsp; cfg = config.vim.lsp;
in { in {
options.vim.lsp = { options.vim.lsp = {

View file

@ -2,9 +2,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) mkIf nvim;
with builtins; let
cfg = config.vim.lsp; cfg = config.vim.lsp;
in { in {
config = mkIf (cfg.enable && cfg.lsplines.enable) { config = mkIf (cfg.enable && cfg.lsplines.enable) {

View file

@ -1,6 +1,6 @@
{lib, ...}: {lib, ...}: let
with lib; inherit (lib) mkEnableOption;
with builtins; { in {
options.vim.lsp = { options.vim.lsp = {
lsplines = { lsplines = {
enable = mkEnableOption "diagnostics using virtual lines on top of the real line of code. [lsp_lines]"; enable = mkEnableOption "diagnostics using virtual lines on top of the real line of code. [lsp_lines]";

View file

@ -2,9 +2,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) addDescriptionsToMappings mkIf mkSetLuaBinding mkMerge nvim optionalString;
with builtins; let
cfg = config.vim.lsp; cfg = config.vim.lsp;
self = import ./lspsaga.nix {inherit lib;}; self = import ./lspsaga.nix {inherit lib;};

View file

@ -1,6 +1,6 @@
{lib, ...}: {lib, ...}: let
with lib; inherit (lib) mkEnableOption mkMappingOption;
with builtins; { in {
options.vim.lsp.lspsaga = { options.vim.lsp.lspsaga = {
enable = mkEnableOption "LSP Saga"; enable = mkEnableOption "LSP Saga";

View file

@ -1,6 +1,5 @@
{lib, ...}: {lib, ...}: let
with lib; inherit (lib) mkEnableOption mkMappingOption;
with builtins; let
in { in {
options.vim.lsp = { options.vim.lsp = {
enable = mkEnableOption "LSP, also enabled automatically through null-ls and lspconfig options"; enable = mkEnableOption "LSP, also enabled automatically through null-ls and lspconfig options";

View file

@ -3,9 +3,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) mkIf mkMerge nvim mapAttrs;
with builtins; let
cfg = config.vim.lsp; cfg = config.vim.lsp;
in { in {
config = mkIf cfg.null-ls.enable (mkMerge [ config = mkIf cfg.null-ls.enable (mkMerge [

View file

@ -3,9 +3,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) mkEnableOption mkOption types;
with builtins; let
cfg = config.vim.lsp; cfg = config.vim.lsp;
in { in {
options.vim.lsp.null-ls = { options.vim.lsp.null-ls = {

View file

@ -2,9 +2,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) addDescriptionsToMappings mkIf mkSetBinding nvim;
with builtins; let
cfg = config.vim.lsp; cfg = config.vim.lsp;
self = import ./nvim-code-action-menu.nix {inherit lib;}; self = import ./nvim-code-action-menu.nix {inherit lib;};

View file

@ -1,5 +1,6 @@
{lib, ...}: {lib, ...}: let
with lib; { inherit (lib) mkEnableOption mkMappingOption;
in {
options.vim.lsp = { options.vim.lsp = {
nvimCodeActionMenu = { nvimCodeActionMenu = {
enable = mkEnableOption "nvim code action menu"; enable = mkEnableOption "nvim code action menu";

View file

@ -2,9 +2,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) addDescriptionsToMappings mkIf mkMerge mkSetBinding nvim;
with builtins; let
cfg = config.vim.lsp; cfg = config.vim.lsp;
self = import ./trouble.nix {inherit lib;}; self = import ./trouble.nix {inherit lib;};

View file

@ -1,5 +1,6 @@
{lib, ...}: {lib, ...}: let
with lib; { inherit (lib) mkEnableOption mkMappingOption;
in {
options.vim.lsp = { options.vim.lsp = {
trouble = { trouble = {
enable = mkEnableOption "trouble diagnostics viewer"; enable = mkEnableOption "trouble diagnostics viewer";

View file

@ -1,5 +1,6 @@
{lib, ...}: {lib, ...}: let
with lib; { inherit (lib) mkEnableOption mkMappingOption;
in {
options.vim.minimap.codewindow = { options.vim.minimap.codewindow = {
enable = mkEnableOption "codewindow plugin for minimap view"; enable = mkEnableOption "codewindow plugin for minimap view";

View file

@ -2,9 +2,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) addDescriptionsToMappings mkIf mkMerge mkSetLuaBinding nvim;
with builtins; let
cfg = config.vim.minimap.codewindow; cfg = config.vim.minimap.codewindow;
self = import ./codewindow.nix {inherit lib;}; self = import ./codewindow.nix {inherit lib;};

View file

@ -3,9 +3,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) mkIf;
with builtins; let
cfg = config.vim.minimap.minimap-vim; cfg = config.vim.minimap.minimap-vim;
in { in {
config = mkIf cfg.enable { config = mkIf cfg.enable {

View file

@ -2,9 +2,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) mkEnableOption;
with builtins; { in {
options.vim.minimap.minimap-vim = { options.vim.minimap.minimap-vim = {
enable = mkEnableOption "minimap-vim plugin for minimap view"; enable = mkEnableOption "minimap-vim plugin for minimap view";
}; };

View file

@ -34,10 +34,14 @@
pkgsModule = {config, ...}: { pkgsModule = {config, ...}: {
config = { config = {
_module.args.baseModules = modules; _module = {
_module.args.pkgsPath = lib.mkDefault pkgs.path; inherit check;
_module.args.pkgs = lib.mkDefault pkgs; args = {
_module.check = check; baseModules = modules;
pkgsPath = lib.mkDefault pkgs.path;
pkgs = lib.mkDefault pkgs;
};
};
}; };
}; };
in in

View file

@ -2,9 +2,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) mkIf nvim;
with builtins; let
cfg = config.vim.notes.mind-nvim; cfg = config.vim.notes.mind-nvim;
in { in {
config = mkIf (cfg.enable) { config = mkIf (cfg.enable) {

View file

@ -2,9 +2,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) mkEnableOption;
with builtins; { in {
options.vim.notes.mind-nvim = { options.vim.notes.mind-nvim = {
enable = mkEnableOption "organizer tool for Neovim."; enable = mkEnableOption "organizer tool for Neovim.";
}; };

View file

@ -2,9 +2,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) mkIf nvim;
with builtins; let
cfg = config.vim.notes.obsidian; cfg = config.vim.notes.obsidian;
auto = config.vim.autocomplete; auto = config.vim.autocomplete;
in { in {

View file

@ -2,9 +2,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) mkEnableOption mkOption types;
with builtins; { in {
options.vim.notes = { options.vim.notes = {
obsidian = { obsidian = {
enable = mkEnableOption "complementary neovim plugins for Obsidian editor"; enable = mkEnableOption "complementary neovim plugins for Obsidian editor";

View file

@ -2,9 +2,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) mkIf mkMerge nvim;
with builtins; let
cfg = config.vim.notes.orgmode; cfg = config.vim.notes.orgmode;
in { in {
config = mkIf cfg.enable (mkMerge [ config = mkIf cfg.enable (mkMerge [

View file

@ -3,9 +3,9 @@
lib, lib,
pkgs, pkgs,
... ...
}: }: let
with lib; inherit (lib) mkEnableOption types mkOption nvim;
with builtins; { in {
options.vim.notes.orgmode = { options.vim.notes.orgmode = {
enable = mkEnableOption "nvim-orgmode: Neovim plugin for Emac Orgmode. Get the best of both worlds"; enable = mkEnableOption "nvim-orgmode: Neovim plugin for Emac Orgmode. Get the best of both worlds";

View file

@ -3,9 +3,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) mkMerge mkBinding mkIf;
with builtins; let
cfg = config.vim.notes.todo-comments; cfg = config.vim.notes.todo-comments;
self = import ./todo-comments.nix {inherit lib;}; self = import ./todo-comments.nix {inherit lib;};
mappings = self.options.vim.notes.todo-comments.mappings; mappings = self.options.vim.notes.todo-comments.mappings;

View file

@ -1,6 +1,6 @@
{lib, ...}: {lib, ...}: let
with lib; inherit (lib) mkEnableOption mkOption types mkMappingOption;
with builtins; { in {
options.vim.notes.todo-comments = { options.vim.notes.todo-comments = {
enable = mkEnableOption "todo-comments: highlight and search for todo comments like TODO, HACK, BUG in your code base"; enable = mkEnableOption "todo-comments: highlight and search for todo comments like TODO, HACK, BUG in your code base";

View file

@ -2,9 +2,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) mkIf nvim boolToString concatStringsSep;
with builtins; let
cfg = config.vim.projects.project-nvim; cfg = config.vim.projects.project-nvim;
in { in {
config = mkIf cfg.enable { config = mkIf cfg.enable {

View file

@ -2,9 +2,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) mkEnableOption mkOption types;
with builtins; { in {
options.vim.projects.project-nvim = { options.vim.projects.project-nvim = {
enable = mkEnableOption "project-nvim for project management"; enable = mkEnableOption "project-nvim for project management";

View file

@ -2,9 +2,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) mkIf nvim boolToString;
with builtins; let
cfg = config.vim.presence.presence-nvim; cfg = config.vim.presence.presence-nvim;
in { in {
config = mkIf cfg.enable { config = mkIf cfg.enable {

View file

@ -2,9 +2,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) mkEnableOption mkOption types;
with builtins; { in {
options.vim.presence.presence-nvim = { options.vim.presence.presence-nvim = {
enable = mkEnableOption "presence.nvim plugin for discord rich presence"; enable = mkEnableOption "presence.nvim plugin for discord rich presence";

View file

@ -2,9 +2,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) mkIf optionals mkMerge mkBinding nvim concatStringsSep boolToString;
with builtins; let
cfg = config.vim.session.nvim-session-manager; cfg = config.vim.session.nvim-session-manager;
in { in {
config = mkIf cfg.enable { config = mkIf cfg.enable {

View file

@ -2,9 +2,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) mkEnableOption mkOption types;
with builtins; { in {
options.vim.session.nvim-session-manager = { options.vim.session.nvim-session-manager = {
enable = mkEnableOption "nvim-session-manager: manage sessions like folders in VSCode"; enable = mkEnableOption "nvim-session-manager: manage sessions like folders in VSCode";

View file

@ -2,9 +2,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) mkIf;
with builtins; let
cfg = config.vim.snippets.vsnip; cfg = config.vim.snippets.vsnip;
in { in {
config = mkIf cfg.enable { config = mkIf cfg.enable {

View file

@ -1,5 +1,6 @@
{lib, ...}: {lib, ...}: let
with lib; { inherit (lib) mkEnableOption;
in {
options.vim.snippets.vsnip = { options.vim.snippets.vsnip = {
enable = mkEnableOption "vim-vsnip: snippet LSP/VSCode's format"; enable = mkEnableOption "vim-vsnip: snippet LSP/VSCode's format";
}; };

View file

@ -2,10 +2,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; let
cfg = config.vim.statusline.lualine; cfg = config.vim.statusline.lualine;
inherit (nvim.lua) luaTable; inherit (lib) mkIf nvim boolToString optionalString;
in { in {
config = (mkIf cfg.enable) { config = (mkIf cfg.enable) {
vim.startPlugins = [ vim.startPlugins = [
@ -33,21 +32,21 @@ in {
}, },
-- active sections -- active sections
sections = { sections = {
lualine_a = ${luaTable (cfg.activeSection.a ++ cfg.extraActiveSection.a)}, lualine_a = ${nvim.lua.luaTable (cfg.activeSection.a ++ cfg.extraActiveSection.a)},
lualine_b = ${luaTable (cfg.activeSection.b ++ cfg.extraActiveSection.b)}, lualine_b = ${nvim.lua.luaTable (cfg.activeSection.b ++ cfg.extraActiveSection.b)},
lualine_c = ${luaTable (cfg.activeSection.c ++ cfg.extraActiveSection.c)}, lualine_c = ${nvim.lua.luaTable (cfg.activeSection.c ++ cfg.extraActiveSection.c)},
lualine_x = ${luaTable (cfg.activeSection.x ++ cfg.extraActiveSection.x)}, lualine_x = ${nvim.lua.luaTable (cfg.activeSection.x ++ cfg.extraActiveSection.x)},
lualine_y = ${luaTable (cfg.activeSection.y ++ cfg.extraActiveSection.y)}, lualine_y = ${nvim.lua.luaTable (cfg.activeSection.y ++ cfg.extraActiveSection.y)},
lualine_z = ${luaTable (cfg.activeSection.z ++ cfg.extraActiveSection.z)}, lualine_z = ${nvim.lua.luaTable (cfg.activeSection.z ++ cfg.extraActiveSection.z)},
}, },
-- --
inactive_sections = { inactive_sections = {
lualine_a = ${luaTable (cfg.inactiveSection.a ++ cfg.extraInactiveSection.a)}, lualine_a = ${nvim.lua.luaTable (cfg.inactiveSection.a ++ cfg.extraInactiveSection.a)},
lualine_b = ${luaTable (cfg.inactiveSection.b ++ cfg.extraInactiveSection.b)}, lualine_b = ${nvim.lua.luaTable (cfg.inactiveSection.b ++ cfg.extraInactiveSection.b)},
lualine_c = ${luaTable (cfg.inactiveSection.c ++ cfg.extraInactiveSection.c)}, lualine_c = ${nvim.lua.luaTable (cfg.inactiveSection.c ++ cfg.extraInactiveSection.c)},
lualine_x = ${luaTable (cfg.inactiveSection.x ++ cfg.extraInactiveSection.x)}, lualine_x = ${nvim.lua.luaTable (cfg.inactiveSection.x ++ cfg.extraInactiveSection.x)},
lualine_y = ${luaTable (cfg.inactiveSection.y ++ cfg.extraInactiveSection.y)}, lualine_y = ${nvim.lua.luaTable (cfg.inactiveSection.y ++ cfg.extraInactiveSection.y)},
lualine_z = ${luaTable (cfg.inactiveSection.z ++ cfg.extraInactiveSection.z)}, lualine_z = ${nvim.lua.luaTable (cfg.inactiveSection.z ++ cfg.extraInactiveSection.z)},
}, },
tabline = {}, tabline = {},

View file

@ -2,9 +2,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) mkEnableOption mkOption types elem optional;
with builtins; let
supported_themes = import ./supported_themes.nix; supported_themes = import ./supported_themes.nix;
colorPuccin = colorPuccin =
if config.vim.statusline.lualine.theme == "catppuccin" if config.vim.statusline.lualine.theme == "catppuccin"

View file

@ -2,9 +2,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) mkIf mkMerge mkLuaBinding mkBinding nvim;
with builtins; let
cfg = config.vim.tabline.nvimBufferline; cfg = config.vim.tabline.nvimBufferline;
self = import ./nvim-bufferline.nix { self = import ./nvim-bufferline.nix {
inherit lib; inherit lib;

View file

@ -1,6 +1,6 @@
{lib, ...}: {lib, ...}: let
with lib; inherit (lib) mkEnableOption mkMappingOption;
with builtins; { in {
options.vim.tabline.nvimBufferline = { options.vim.tabline.nvimBufferline = {
enable = mkEnableOption "nvim-bufferline-lua as a bufferline"; enable = mkEnableOption "nvim-bufferline-lua as a bufferline";

Some files were not shown because too many files have changed in this diff Show more