feat: make it possible to use strings for the RC

when providing a string, it will get mapped as if it was given with nivm.dag.entryAnywhere, which will most likely be what people want
This commit is contained in:
n3oney 2023-05-22 15:59:12 +02:00 committed by NotAShelf
parent bc26d437d1
commit c8ea2f0f8e
No known key found for this signature in database
GPG key ID: F0D14CCB5ED5AA22
2 changed files with 10 additions and 3 deletions

View file

@ -16,6 +16,8 @@ https://github.com/n3oney[n3oney]:
* Moved default keybinds into keybinds section of each module * Moved default keybinds into keybinds section of each module
* Simplified luaConfigRC and configRC setting - they can now just take strings
https://github.com/horriblename[horriblename]: https://github.com/horriblename[horriblename]:
* Added `clangd` as alternative lsp for C/++. * Added `clangd` as alternative lsp for C/++.

View file

@ -132,13 +132,13 @@ in {
configRC = mkOption { configRC = mkOption {
description = "vimrc contents"; description = "vimrc contents";
type = nvim.types.dagOf types.lines; type = types.oneOf [(nvim.types.dagOf types.lines) types.str];
default = {}; default = {};
}; };
luaConfigRC = mkOption { luaConfigRC = mkOption {
description = "vim lua config"; description = "vim lua config";
type = nvim.types.dagOf types.lines; type = types.oneOf [(nvim.types.dagOf types.lines) types.str];
default = {}; default = {};
}; };
@ -282,7 +282,12 @@ in {
dag, dag,
mapResult, mapResult,
}: let }: let
sortedDag = nvim.dag.topoSort dag; finalDag = lib.mapAttrs (name: value:
if builtins.isString value
then nvim.dag.entryAnywhere value
else value)
dag;
sortedDag = nvim.dag.topoSort finalDag;
result = result =
if sortedDag ? result if sortedDag ? result
then mapResult sortedDag.result then mapResult sortedDag.result