Commit graph

39 commits

Author SHA1 Message Date
sportshead
2b6f694b48 output: add extraPackagesAfter option
Some checks are pending
Build and deploy documentation / deploy (push) Waiting to run
Publish every Git push to main to FlakeHub / flakehub-publish (push) Waiting to run
Publish every git push to Flakestry / publish-flake (push) Waiting to run
Allow users to add packages to the end of `PATH` in the neovim wrapper.
This is useful for LSP versions that might need to be overriden based on
the environment, e.g. `haskell-language-server` versions provided by a
project's devshell.
2025-06-08 22:14:58 +00:00
Stanislav Asunkin
49a7bb573a modules/top-level: change usages of import to callPackage 2025-05-12 17:39:01 +03:00
Stanislav Asunkin
75f2c1b1f1 modules/performance: ensure dependencies of lua packages also compiled
Previously only extraLuaPackages themselves were byte-compiled, not
theirs dependencies. This commit fixes that by compiling lua packages
recursively. It uses byte-compile-lua-lib.nix shared file.
Also this commit uses the shared stub lua libraries for extraLuaPackages
byte-compiling test.
2025-05-12 17:39:01 +03:00
Stanislav Asunkin
404e56066f modules/performance: add ability to byte compile extraLuaPackages
This commit adds `performance.byteCompileLua.luaLib` options. When
enabled it byte-compiles lua packages from extraLuaPackages option.
2025-05-12 17:39:01 +03:00
Gaetan Lepage
efb24d78bd modules: refactor plugins code in top-level 2025-04-01 15:43:26 +02:00
Gaetan Lepage
db01a0dd97 modules: add env option 2025-03-24 18:50:29 +01:00
Matt Sturgeon
00586f8f1b
modules/output: move symlinkJoin to build.package 2025-01-20 14:49:59 +00:00
Matt Sturgeon
8938e09db1
modules/output: add manDocsPackage 2024-12-23 12:18:06 +00:00
Heitor Augusto
d100a4e994
modules/output: expose withPython3 2024-11-13 16:23:27 -03:00
Heitor Augusto
590153d403
modules/output: expose withPerl 2024-11-13 15:21:17 -03:00
Stanislav Asunkin
767eb62f48 modules/output: obtain plugin configs from wrapped neovim
The official method for obtaining the generated initRc content is from
wrapped neovim rather than from makeNeovimConfig helper. To use this
approach: first wrap neovim with the generated config, then override it
with our wrapperArgs.
2024-10-13 09:54:05 +03:00
Stanislav Asunkin
ba77e88740 modules/output: remove unused binding 2024-10-13 09:33:20 +03:00
Matt Sturgeon
6a1bf6bdc3
modules/output: check warnings+assertions on build.package
Add a `build.packageUnchecked` option for use instead of the old `check`
evalNixvim argument.
2024-09-26 18:04:36 +01:00
Matt Sturgeon
2ab8751b8b
modules/output: add build.initSource option
Allows access to the init "source" file even when
`performance.byteCompileLua` is enabled.
2024-09-26 06:31:57 +01:00
Matt Sturgeon
692e39311e
modules/{output,files,test}: move outputs to build scope
Move the following output options into `build`:
- finalPackage -> package
- printInitPackage
- initPath -> initFile
- filesPlugin -> extraFiles
- test.derivation -> test
2024-09-26 06:31:57 +01:00
Matt Sturgeon
7bda0f1ce4
modules/output: don't remove "site" dir when impureRtp is disabled
This is required for storing the state of several things, such as spell
files.
2024-09-25 18:43:32 +01:00
Matt Sturgeon
11924e1593
modules/output: add impureRtp option
Instead of assuming `wrapRc` implies we don't want impurities, configure
this separately.
2024-09-25 18:43:32 +01:00
Matt Sturgeon
fb7cda2868
modules/output: refactor wrapRc default
Set default to `true`, with a low priority. Home-manager's wrapper sets
its own default using `mkOptionDefault`.

Clarify using `defaultText`.
2024-09-25 18:43:10 +01:00
Matt Sturgeon
4e5bd1d79b
lib: segregate and deprecate functions that need pkgs
Splits everything that depends on a `pkgs` instance into an optional
attrs, allowing `helpers.nix` to be bootstrapped without `pkgs`.

This required some refactoring:
- `modules.specialArgs` is only available when `pkgs` is used
- `modules.specialArgsWith` now requires `defaultPkgs` be provided
- `builders.*` now have `*With` variants that take `pkgs` as an argument
  and a `withPkgs` function that returns the old interface
- Had to define the fixed part of `builders` outside the attrs for now,
  to avoid infinite recursion.
- The old `builders` are now deprecated, and print a warning when
  evaluated
- `withOptoinalFns` was introduced to merge the optional attrs into the
  final lib.
2024-09-13 19:05:26 +01:00
Matt Sturgeon
c4a54da4a5
modules/output: use mkPackageOption for package option 2024-09-04 21:56:48 +01:00
Austin Horstman
203d31810f
top-level/output: add global table top of init.lua
Creating a global table at top of init.lua to allow sharing between
different sections of the init.lua without worrying about ordering.
2024-08-24 11:33:08 -05:00
Matt Sturgeon
bc7a7ad1d6
module/outputs: use mkIf for wrapRc
Implement the `wrapRc` option using `lib.mkIf` instead of using _real_
`if` branches.
2024-08-20 22:02:29 +01:00
Matt Sturgeon
6975ee09f5
modules/outputs: make type readOnly at the top-level
Instead of relying on `lib.mkForce` we can enforce this more strictly by
setting the option "readOnly".
2024-08-20 22:02:29 +01:00
Austin Horstman
6ab17b1b2e
top-level/output: include meta in package
Required to prevent errors due to missing license information in
neovim-wrapper.
2024-08-15 22:28:28 -05:00
Stanislav Asunkin
9314cd46f0 modules/performance: add ability to byte compile nvim runtime directory
This commit adds `performance.byteCompileLua.nvimRuntime` toggle that,
if enabled, byte compiles all lua files in Nvim runtime directory.
2024-07-31 11:31:40 +00:00
Stanislav Asunkin
55ca9d235b modules/performance: add ability to byte compile lua plugins
This commit adds `performance.byteCompileLua.plugins` toggle that, if
enabled, byte compiles all lua files in plugins
2024-07-31 11:31:40 +00:00
Stanislav Asunkin
17e8904992 modules/performance: add performance.byteCompileLua option
* add `performance.byteCompileLua.enable` toggle to enable or disable
  all byte compiling features
* add `performance.byteCompileLua.initLua` toggle to enable or
  disable byte compiling of init.lua
* add `writeByteCompiledLua` helper for saving byte compiled lua source
  code to the nix store
* `nixvim-print-init` utility is always pointed to uncompiled init.lua
* add tests
2024-07-31 11:31:40 +00:00
Stanislav Asunkin
0ac10f6776 modules/performance: refactor after code review 2024-07-24 16:50:50 +02:00
Stanislav Asunkin
e65c9590d0 modules/performance: add combinePlugins.standalonePlugins option 2024-07-24 16:50:50 +02:00
Stanislav Asunkin
d6bebcefa3 modules/performance: handle plugin configs when combining plugins 2024-07-24 16:50:50 +02:00
Stanislav Asunkin
27201addd7 modules/performance: handle optional plugins when combining plugins 2024-07-24 16:50:50 +02:00
Stanislav Asunkin
f900dcd6aa modules/performance: handle python3 dependencies when combining plugins 2024-07-24 16:50:50 +02:00
Stanislav Asunkin
fdb3950c59 modules/performance: add an option to combine plugins to a single plugin pack 2024-07-24 16:50:50 +02:00
Stanislav Asunkin
119f12db27 modules/output: avoid using global with lib; 2024-07-24 16:50:50 +02:00
Stanislav Asunkin
9317537848 modules: avoid setting empty strings to extraConfig* options
Problem:  Some modules are setting empty strings to extraConfig* options
          with the intention to not generate any config. But empty
          strings are also values, so they are still concatenated in the
          final value of extraConfig* options. This results in a
          multiple empty strings in extraConfigs.

Solution: Avoid using optionalString when setting values to extraConfig*
          options. Use mkIf instead.

          This commit also fixes mkIf condition in autocmd module.

          `mkNeovimPlugin` is a special case. To avoid evaluating
          caller's arguments mkMerge/optionalAttrs pattern is used
          instead.
2024-07-22 23:18:53 +02:00
Stanislav Asunkin
299d0406bb modules/output: refactor config generation
The motivation for this change was to avoid generating empty
config sections like

    vim.cmd([[

    ]])

To make a config generation cleaner several helper functions introduced:

* `hasContent` have been moved to helpers
* `concatNonEmptyLines` joins strings (which has content) separated with
  newlines
* `wrapVimscriptForLua` wraps a lua string for using in Vimscript, but
  only if the string has content, otherwise empty string is returned
* `wrapLuaForVimscript` wraps Vimscript for using in lua, but only if
  the string has content, otherwise empty string is returned

Added tests:

* testing that all possible config sections are present in the final
  generated config
* testing that the config files generated by empty `files` definitions
  don't have any content in it
2024-07-22 23:18:53 +02:00
Stanislav Asunkin
6674dea840 modules/output: fix extraLuaPackages 2024-07-06 20:44:43 +00:00
traxys
367380bd84 modules/output: Remove the initContent option
This (internal) option introduces IFD, and can be substituted internally
with the `initPath` option easily.
If the content is required somewhere users can use readFile on the
initPath, though it will result in an IFD in their project.
2024-07-05 22:08:25 +02:00
Matt Sturgeon
2deb61f6a5
modules/top-level: move out of wrappers/modules 2024-07-05 17:20:28 +01:00
Renamed from wrappers/modules/output.nix (Browse further)