Commit graph

23 commits

Author SHA1 Message Date
Matt Sturgeon
587b1cbf21
lib/types: allow inline-lua in rawLua type 2024-11-16 17:20:11 +00:00
Matt Sturgeon
a9c08fb6a5
lib/types: make strLua coerce strings to rawLua
Instead of relying on option `apply` functions to coerce the value to
rawLua, this can be done in the type's merge function.

Inspired by `types.coercedTo` in nixpkgs.
2024-09-29 16:57:15 +01:00
Matt Sturgeon
7886be8760
lib/types: flip maybeRaw's merge function
`maybeRaw` should prioritise merging `rawLua` before the other type
2024-09-29 16:57:15 +01:00
Matt Sturgeon
47364df496
lib/types/pluginLuaConfig: use lib.optional instead of lib.mkIf
This may slightly increase performance by reducing work done by the
module system.
2024-09-23 20:08:52 +01:00
Matt Sturgeon
76df09619d
lib/types/pluginLuaConfig: only merge pre and post when defined
- Have them default to `null`
- Only merge them into `content` when non-null
- Mention this in `content`'s description
2024-09-22 17:49:41 +01:00
Quentin Boyer
d2f9e011d9 lib/neovim-plugin: Add lua configuration scoped to the plugin
This commit adds a `plugins.<name>.luaConfig` section controlling the
plugin specific configuration.

The section contains the internal `init` option, containing the plugin's
initialization code.

It also contains the public `pre` and `post` options, that allow to add
code before & after the `init` section

Finally, it contains the `final` option, being the concatenation of the
three previous options.
2024-09-22 16:15:27 +00:00
Matt Sturgeon
27a0dd435d
lib/types: simplify eitherRecursive by defining it only once 2024-09-12 14:44:54 +01:00
Matt Sturgeon
555035ef79
lib: add types.flagInt + defaultNullOpts.mkIntFlag
Either `0` or `1`, but can be coerced from a boolean definition to
support legacy definitions.

When coerced, a warning is printed
2024-09-08 12:54:30 +01:00
Austin Horstman
35788bbc5a
lib: cleanup with lib 2024-09-03 22:12:33 -05:00
Matt Sturgeon
b7f419a759
lib: migrate helpers.nixvimTypes -> lib.types 2024-08-21 07:37:11 +01:00
Matt Sturgeon
b414a53649
lib/types: merge into extendedLib 2024-08-21 07:37:11 +01:00
Austin Horstman
e3ec1c4a46 plugins/which-key: move listOfLen to lib.types
Allows us to require a list to have a certain length for plugins that
request it.
2024-08-14 11:20:17 +00:00
Matt Sturgeon
040bab5f55
lib/helpers: call with auto-args
Define `call = callPackageWith { inherit pkgs lib helpers; }`, which can
be used to automatically pass the correct args into helpers files.

`helpers` is passed in recursively.
2024-07-28 22:51:24 +01:00
Matt Sturgeon
0e98d9cf1e
lib/helpers: build recursively 2024-07-28 22:30:11 +01:00
Gaetan Lepage
6055d0f28c lib/types: allow emptyTable as a valid rawLua value 2024-07-08 10:21:49 +02:00
Matt Sturgeon
36b4a39b2b
lib/types: allow assigning raw lua to string lua
Relax the check a little to allow (slightly) incorrect usage and enable migrating option types to string lua types.
2024-06-17 00:01:40 +01:00
Matt Sturgeon
2d063c2c24
lib/types: simplify isRawType
No change in behaviour.
2024-06-17 00:01:39 +01:00
traxys
62f32bfc71 treewide: Reformat with nixfmt 2024-05-05 22:00:40 +02:00
Gaetan Lepage
776cc84ad1 helpers/types: allow highlight.ctypes to accept a string 2024-04-13 11:00:19 +02:00
Gaetan Lepage
d348bb3e03 lib/types: factor out logLevel enum for standalone use 2024-04-07 11:30:24 +02:00
Gaetan Lepage
22b587f3dc helpers/types: expose isRawType 2024-03-06 22:27:43 +01:00
traxys
507ff5b142
docs: Use a nixpkgs patch instead of copy/pasting nixpkgs functions (#1011)
This makes the code more maintainable, as it only depends on our small
patch, instead of a large number of internals of nixpkgs.
2024-02-03 19:04:09 +01:00
Gaetan Lepage
98dbe8a89b lib/helpers: internal refactoring 2024-01-25 16:38:59 +01:00