Commit graph

1790 commits

Author SHA1 Message Date
traxys
53f76f76b0 dev: Re-evaluate direnv when a flake-module changes 2024-07-23 22:04:28 +02:00
traxys
f1eaf5b617 dev: Allow to pass arguments to nix in tests
This can allow to pass --show-trace for example
2024-07-23 22:03:42 +02:00
traxys
1c75b414cb dev: Allow to choose the system in tests
This is done through the -s/--system <system> option
2024-07-23 21:58:23 +02:00
Gaetan Lepage
901e8760d0 flake-modules/dev: format launch-test.sh 2024-07-22 23:25:28 +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
Matt Sturgeon
6dc0bda459
lib/to-lua: handle derivations as path strings
Fixes #1888
2024-07-22 13:24:16 +01:00
Stanislav Asunkin
34aa3e00e7 modules/filetype: ensure that the module does not set empty settings
When setting any filetype suboption to null (or anything else guarded by
mkIf) it's value becomes:

    { extension = null; filename = null; pattern = null; }

Account for that case in mkIf condition so that the option would not
produce empty filetype definition.
2024-07-22 11:33:52 +03:00
Sorin Iclanzan
d2f733efb4 systemModules should be systemPackages in README example 2024-07-21 20:06:19 +00:00
Stanislav Asunkin
06261fc472 modules/lsp/servers/vls: do not add filetype extension if not enabled 2024-07-21 20:17:03 +02:00
Stanislav Asunkin
8eb5763bbb modules/lua-loader: make enable option nullable
This avoids having the option always "defined".

This also avoids luaLoader configuration in extra files by default.
Earlier `vim.loader.disable()` was always added to configs produced
by `files` option, effectively disabling luaLoader even if it was
explicitly enabled in a top-level configuration.
2024-07-21 17:11:50 +03:00
traxys
7908729711 dev: Make the tests command able to select which test to launch
The `tests` command can either launch all tests (without any arguments),
a specific test with `-t/--test` or choose a test with `-i/--interactive`
2024-07-21 15:17:17 +02:00
traxys
b1576362a7 tests: Remove the test link farm
Fixes #1878
2024-07-21 15:17:17 +02:00
traxys
e80a8874ac docs: Add a section of *Package options
Documents the fix for #1282

Closes #1282
2024-07-19 22:46:32 +02:00
Sandro Jäckel
8a4dc239d6 plugins/{lsp,none-ls}: remove package aliases 2024-07-19 18:39:01 +02:00
Stanislav Asunkin
c9a6912be5 modules/files: fix creating configs of vim type 2024-07-19 14:45:34 +03:00
traxys
daa94bd6c2 tests: Disable coq-nvim defaults on x86_64 darwin 2024-07-19 11:11:17 +02:00
traxys
50d865275d tests: Reduce the number of calls to mkTestDerivationFromNixvimModule 2024-07-19 11:11:17 +02:00
traxys
71126bfebe tests: Allow to test multiple derivations in a single test derivation 2024-07-19 11:11:17 +02:00
Matt Sturgeon
55bda0cc3b
plugins/none-ls/sources: structured "with" settings
Allow supplying strLua or an attrset that will be handled using
`toLuaObject`.

Included an example and a link to the [upstream documentation].

[upstream documentation]: https://github.com/nvimtools/none-ls.nvim/blob/main/doc/BUILTIN_CONFIG.md
2024-07-17 14:50:05 +01:00
Sandro
ff6ad12a7d
readme: Simplify flakes instructions 2024-07-17 13:28:28 +01:00
Matt Sturgeon
b9ed900032
github/update: remove broken team-reviewers
> Unable to request reviewers.
> If requesting team reviewers a 'repo' scoped PAT is required.
2024-07-15 12:17:30 +01:00
Matt Sturgeon
c1feceda64
dev: fix --commit when the worktree is dirty 2024-07-15 12:11:28 +01:00
Matt Sturgeon
cff06c8570
github/update: improve summary for generated files 2024-07-15 12:11:28 +01:00
Matt Sturgeon
bd1dddaf50
github/update: run update on the respective branch
- Run the `update.yml` workflow on the triggered branch, replace the
  job matrix with a conditional step that runs update on nixos-24.05.
- Added a `cancel-in-progress` concurrency group.
- Disabled committing in PR action (using negative add-paths).
2024-07-15 12:11:27 +01:00
Sandro
433d2f213c
plugins/treesitter: disable folding by default 2024-07-15 11:58:08 +02:00
github-actions[bot]
ac9a1cbf9c generated: Updated rust-analyzer.nix 2024-07-13 22:39:48 +00:00
Gaetan Lepage
94bea519de tests/efmls-configs: update test excludes 2024-07-14 00:06:08 +02:00
Gaetan Lepage
0d95fc6888 plugins/telescope/extensions/undo: deprecate option diff_context_lines 2024-07-14 00:05:32 +02:00
github-actions[bot]
c029f1745e flake.lock: Update
Flake lock file updates:

• Updated input 'flake-parts':
    'github:hercules-ci/flake-parts/4e3583423212f9303aa1a6337f8dffb415920e4f' (2024-07-01)
  → 'github:hercules-ci/flake-parts/9227223f6d922fee3c7b190b2cc238a99527bbb7' (2024-07-03)
• Updated input 'git-hooks':
    'github:cachix/git-hooks.nix/0ff4381bbb8f7a52ca4a851660fc7a437a4c6e07' (2024-06-24)
  → 'github:cachix/git-hooks.nix/2b6bd3c87d3a66fb0b8f2f06c985995e04b4fb96' (2024-07-08)
• Updated input 'home-manager':
    'github:nix-community/home-manager/59ce796b2563e19821361abbe2067c3bb4143a7d' (2024-07-01)
  → 'github:nix-community/home-manager/6b7ce96f34b324e4e104abc30d06955d216bac71' (2024-07-07)
• Updated input 'nix-darwin':
    'github:lnl7/nix-darwin/ec12b88104d6c117871fad55e931addac4626756' (2024-07-01)
  → 'github:lnl7/nix-darwin/0f89b73f41eaa1dde67b291452c181d9a75f10dd' (2024-07-07)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/00d80d13810dbfea8ab4ed1009b09100cca86ba8' (2024-07-01)
  → 'github:NixOS/nixpkgs/655a58a72a6601292512670343087c2d75d859c1' (2024-07-08)
• Updated input 'treefmt-nix':
    'github:numtide/treefmt-nix/bdb6355009562d8f9313d9460c0d3860f525bc6c' (2024-07-02)
  → 'github:numtide/treefmt-nix/6fc8bded78715cdd43a3278a14ded226eb3a239e' (2024-07-08)
2024-07-13 22:03:28 +02:00
Matt Sturgeon
06a44e9e88
plugins/none-ls: rename servers.nix to sources.nix 2024-07-13 20:20:51 +01:00
Matt Sturgeon
4f3cd9f368
plugins/none-ls: combine packaged+unpackaged lists
We can just make `packaged` nullable again.
2024-07-13 20:20:46 +01:00
Matt Sturgeon
d8f3113e90
plugins/none-ls: refactor using mkSourcePlugin
Introduce `_mk-source-plugin.nix`, which returns a module handling a
specific none-ls source plugin.

This wasn't possible previously due to IFD conflicting with evaluating
module imports.

Adjusted the test to use the `options` provided via module args, and
cleaned up some stuff allowing "unpackaged" sources to not be listed
again in the test file.
2024-07-13 20:11:09 +01:00
Matt Sturgeon
195978e627
plugins/treesitter: fix ensure_installed to allow "all"
The plugin allows passing either the string `"all"` or a list of languages.
2024-07-13 10:59:02 +01:00
Austin Horstman
89d74cdce1
plugins/treesitter: fix folding
opts getting wiped out by setting entire set as default instead of each
attribute
2024-07-12 12:13:27 -05:00
Austin Horstman
1385953299
plugins/treesitter: fix parser_install_dir default
The plugin's default is not compatible with nix, because it ends up in
the read-only /nix/store.

Set our default to the one used in their upcoming "1.0" version.
2024-07-12 10:48:21 -05:00
Austin Horstman
dc1559f25e
plugins/rustaceanvim: fix deprecation in test 2024-07-12 09:59:09 -05:00
hrmny
53e85da240
plugins/intellitab: fix treesitter option usage
intellitab was still using the old deprecated option.
2024-07-11 23:06:35 +01:00
Gaetan Lepage
ca01a644ef flake/dev/formatting: run ruff format in isolated mode 2024-07-11 14:59:08 +02:00
traxys
123c102a13 plugin/rustaceanvim: Handle rust-analyzer settings rename 2024-07-10 22:44:58 +02:00
Matt Sturgeon
34c3c026b4
tests: add check for nixpkgs maintainers
The test fails if a nixvim maintainer is also a nixpkgs maintainer.
2024-07-10 09:18:18 +01:00
Matt Sturgeon
497ce47593
maintainers: remove MattSturgeon 2024-07-10 09:18:17 +01:00
Matt Sturgeon
abc409c16f
github: refactor update CI workflow
- Rename workflow to simply "update"
- Drop the DeterminateSystems/update-flake-lock action
- Instead use `nix flake update --commit-lock-file`
- Also use `generate-files`'s `--commit` option
- Use peter-evans/create-pull-request to open a PR
2024-07-10 08:30:47 +01:00
Matt Sturgeon
7e3d629bb0
flake/generate-files: add --commit command + fixes
- Added `--commit` with a git-based message
- `nix fmt` only operates on files known to git
- ensure `generated` directory exists
2024-07-10 08:30:03 +01:00
Matt Sturgeon
a5e9dbdef1
plugins/bufdelete: init 2024-07-09 14:15:38 +01:00
traxys
023dc1c93a plugins/treesitter: Add a treesitter injection query for raw lua 2024-07-09 07:45:26 +00:00
traxys
29118021b3 plugins/treesitter: Adapt nixvim queries to 0.10 2024-07-09 07:45:26 +00:00
seth
0f76a8cdfc plugins/glow: init 2024-07-09 06:06:29 +00:00
Austin Horstman
1a644b8c2b
plugins/treesitter: fix settingsExample 2024-07-08 14:23:42 -05:00
Matt Sturgeon
0e8b248a52
lib/options: allow rawLua in mkEnum' default 2024-07-08 17:48:00 +01:00