mirror of
https://github.com/NotAShelf/nvf.git
synced 2024-11-22 21:30:51 +00:00
Compare commits
No commits in common. "8997e62b3b00ece6d51685b23949e3062a19dd06" and "56a8476bc16b0aa8fba0ce5d2d8969d9ae1857db" have entirely different histories.
8997e62b3b
...
56a8476bc1
181 changed files with 3050 additions and 4807 deletions
2
.github/CONTRIBUTING.md
vendored
2
.github/CONTRIBUTING.md
vendored
|
@ -16,7 +16,7 @@ If you have any questions regarding those files, feel free to open an issue or [
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
The contribution process is mostly documented in the [pull request template](pull_request_template.md). You will find a checklist of items to complete before submitting a pull request. Please make sure you complete it before submitting a pull request. If you are unsure about any of the items, please ask.
|
The contribution process is mostly documented in the [pull request template](.github/pull_request_template.md). You will find a checklist of items to complete before submitting a pull request. Please make sure you complete it before submitting a pull request. If you are unsure about any of the items, please ask.
|
||||||
|
|
||||||
### Guidelines
|
### Guidelines
|
||||||
|
|
||||||
|
|
4
.github/FUNDING.yml
vendored
4
.github/FUNDING.yml
vendored
|
@ -1,4 +0,0 @@
|
||||||
github: NotAShelf
|
|
||||||
ko_fi: NotAShelf
|
|
||||||
liberapay: NotAShelf
|
|
||||||
|
|
39
.github/PULL_REQUEST_TEMPLATE/pull_request_template.md
vendored
Normal file
39
.github/PULL_REQUEST_TEMPLATE/pull_request_template.md
vendored
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
# Description
|
||||||
|
|
||||||
|
A clear and concise description of the aim of your Pull Request.
|
||||||
|
|
||||||
|
**If your pull request aims to fix an open issue or a present bug, please link the relevant issue below. If not, please remove this section**
|
||||||
|
Fixes #(issue)
|
||||||
|
|
||||||
|
## Type of change
|
||||||
|
|
||||||
|
Please delete any options that are not relevant.
|
||||||
|
|
||||||
|
- Bug fix (non-breaking change which fixes an issue)
|
||||||
|
- New feature (non-breaking change which adds functionality)
|
||||||
|
- Breaking change (fix or feature that would cause existing functionality to not work as expected)
|
||||||
|
- Translation/Language update
|
||||||
|
- Docs
|
||||||
|
- Other
|
||||||
|
|
||||||
|
## Checklist
|
||||||
|
|
||||||
|
Please try to check at least a majority of the checklist before opening your pull request. Exceptions to this will be reviewed on a case by case basis.
|
||||||
|
|
||||||
|
- [ ] My code follows the style and contributing guidelines of this project.
|
||||||
|
- [ ] I ran Alejandra to format my code (`nix fmt`).
|
||||||
|
- [ ] I have performed a self-review of my own code and tested it.
|
||||||
|
- [ ] I have commented my code, particularly in hard-to-understand areas.
|
||||||
|
- [ ] My changes generate no new warnings.
|
||||||
|
- [ ] This change requires a documentation update.
|
||||||
|
- [ ] I have updated the documentation accordingly.
|
||||||
|
|
||||||
|
## Screenshots & Logs
|
||||||
|
|
||||||
|
You are kindly requested to attach screenshots of your changes in actions and preferably your build/run logs for all available packages. If you are not sure how to do this, you can refer to the [documentation](https://notashelf.github.io/neovim-flake/).
|
||||||
|
|
||||||
|
**Please do not use any external image service. Instead, just paste in or drag and drop the image here, and it will be uploaded automatically.**
|
||||||
|
|
||||||
|
```console
|
||||||
|
# Paste your logs here
|
||||||
|
```
|
216
.github/README.md
vendored
216
.github/README.md
vendored
|
@ -1,11 +1,9 @@
|
||||||
<div align="center">
|
<div align="center">
|
||||||
<img src="assets/nvf-logo-work.svg" alt="nvf Logo" width="200">
|
<img src="assets/nvf-logo-work.svg" alt="nvf Logo" width="200">
|
||||||
<br/>
|
|
||||||
<h1>nvf</h1>
|
|
||||||
</div>
|
</div>
|
||||||
|
<h1 align="center">❄️ nvf</h1>
|
||||||
<div align="center">
|
<div align="center">
|
||||||
<p>
|
<p>
|
||||||
<a href="https://github.com/NotAShelf/nvf/releases/latest">
|
<a href="https://github.com/NotAShelf/nvf/releases/latest">
|
||||||
<img alt="Latest release" src="https://img.shields.io/github/v/release/NotAShelf/nvf?style=for-the-badge&logo=nixos&color=C9CBFF&logoColor=D9E0EE&labelColor=302D41" />
|
<img alt="Latest release" src="https://img.shields.io/github/v/release/NotAShelf/nvf?style=for-the-badge&logo=nixos&color=C9CBFF&logoColor=D9E0EE&labelColor=302D41" />
|
||||||
</a>
|
</a>
|
||||||
|
@ -24,8 +22,7 @@
|
||||||
<a href="https://github.com/NotAShelf/nvf">
|
<a href="https://github.com/NotAShelf/nvf">
|
||||||
<img alt="Repo Size" src="https://img.shields.io/github/repo-size/NotAShelf/nvf?color=%23DDB6F2&label=SIZE&logo=codesandbox&style=for-the-badge&logoColor=D9E0EE&labelColor=302D41" />
|
<img alt="Repo Size" src="https://img.shields.io/github/repo-size/NotAShelf/nvf?color=%23DDB6F2&label=SIZE&logo=codesandbox&style=for-the-badge&logoColor=D9E0EE&labelColor=302D41" />
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<img src="https://stars.medv.io/NotAShelf/nvf.svg", title="stars"/>
|
<img src="https://stars.medv.io/NotAShelf/nvf.svg", title="stars"/>
|
||||||
|
@ -33,17 +30,34 @@
|
||||||
|
|
||||||
<div align="center">
|
<div align="center">
|
||||||
<a>
|
<a>
|
||||||
nvf is a highly modular, configurable, extensible and easy to use Neovim configuration
|
A highly modular, configurable, extensible and easy to use Neovim configuration
|
||||||
in Nix. Designed for flexibility and ease of use, nvf allows you to easily configure
|
framework in Nix. Designed for flexibility and ease of use, this flake
|
||||||
your fully featured Neovim instance with a few lines of Nix.
|
allows you to easily configure your Neovim instance with a few lines of
|
||||||
|
Nix code.
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
<br/>
|
||||||
|
|
||||||
|
> [!WARNING]
|
||||||
|
> Main branch is only updated for small, non-breaking changes. For the latest version of neovim-flake, please see
|
||||||
|
> [the list of branches](https://github.com/NotAShelf/neovim-flake/branches) or
|
||||||
|
> [open pull requests](https://github.com/NotAShelf/neovim-flake/pulls?q=is%3Apr+is%3Aopen+sort%3Aupdated-desc).
|
||||||
|
> neovim-flake, at the time, is still being actively developed - and will continue to be so for the foreseeable
|
||||||
|
> future.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
<div align="center"><p>
|
<div align="center"><p>
|
||||||
|
|
||||||
[Features]: #features
|
**[<kbd> <br> Get Started <br> </kbd>][Get Started]**
|
||||||
|
**[<kbd> <br> Documentation <br> </kbd>][Documentation]**
|
||||||
|
**[<kbd> <br> Help <br> </kbd>][Help]**
|
||||||
|
**[<kbd> <br> Contribute <br> </kbd>][Contribute]**
|
||||||
|
**[<kbd> <br> FAQ <br> </kbd>][Faq]**
|
||||||
|
**[<kbd> <br> Credits <br> </kbd>][Credits]**
|
||||||
|
|
||||||
|
</p></div>
|
||||||
|
|
||||||
[Get Started]: #get-started
|
[Get Started]: #get-started
|
||||||
[Documentation]: #documentation
|
[Documentation]: #documentation
|
||||||
[Help]: #help
|
[Help]: #help
|
||||||
|
@ -51,156 +65,100 @@
|
||||||
[FAQ]: #faq
|
[FAQ]: #faq
|
||||||
[Credits]: #credits
|
[Credits]: #credits
|
||||||
|
|
||||||
**[<kbd><br> Features <br></kbd>][Features]**
|
|
||||||
**[<kbd><br> Get Started <br></kbd>][Get Started]**
|
|
||||||
**[<kbd><br> Documentation <br></kbd>][Documentation]**
|
|
||||||
**[<kbd><br> Help <br></kbd>][Help]**
|
|
||||||
**[<kbd><br> Contribute <br></kbd>][Contribute]**
|
|
||||||
**[<kbd><br> FAQ <br></kbd>][Faq]** **[<kbd><br> Credits <br></kbd>][Credits]**
|
|
||||||
|
|
||||||
</p></div>
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Features
|
|
||||||
|
|
||||||
- **Reproducible**: Your configuration will behave the same _anywhere_. No
|
|
||||||
surprises, promise!
|
|
||||||
- **Portable**: nvf depends _solely_ on your Nix store, and nothing else. No
|
|
||||||
more global binaries! Works on all platforms, without hassle.
|
|
||||||
- **Customizable**: There are _almost no defaults_ to annoy you. nvf is fully
|
|
||||||
customizable through the Nix module system.
|
|
||||||
- **Well-documented**: Documentation is priority. You will _never_ face
|
|
||||||
undocumented, obscure behaviour.
|
|
||||||
- **Idiomatic**: nvf does things ✨ _the right way_ ✨ - the codebase is, and
|
|
||||||
will, remain maintainable for myself and any contributors.
|
|
||||||
|
|
||||||
## Get Started
|
## Get Started
|
||||||
|
|
||||||
[nvf manual]: https://notashelf.github.io/nvf/
|
### Using `nix` CLI
|
||||||
[issue tracker]: https://github.com/NotAShelf/nvf/issues
|
|
||||||
|
|
||||||
If you are not sold on the concepts of **nvf**, and would like to try out the
|
If you would like to try out the configuration before even thinking about
|
||||||
default configuration before even _thinking about_ installing it, you may run
|
installing it, you can run the following command
|
||||||
the following in order to take **nvf** out for a spin.
|
|
||||||
|
|
||||||
```bash
|
```console
|
||||||
# Run the default package
|
|
||||||
nix run github:notashelf/nvf
|
nix run github:notashelf/nvf
|
||||||
```
|
```
|
||||||
|
|
||||||
This will get you a feel for the base configuration and UI design. Though, none
|
This will get you a feel for the base configuration and UI design.
|
||||||
of the configuration options are final as **nvf** is designed to be modular and
|
The flake exposes `#nix` as the default package, providing minimal
|
||||||
configurable.
|
language support and various utilities.You may also use `#nix`,
|
||||||
|
`#tidal` or `#maximal` to get try out different configurations.
|
||||||
|
|
||||||
> [!TIP]
|
It is as simple as changing the target output to get a different
|
||||||
> The flake exposes `#nix` as the default package, providing minimal language
|
configuration. For example, to get a configuration with `tidal` support, run:
|
||||||
> support and various utilities. You may also use the `#nix` or `#maximal`
|
|
||||||
> packages provided by the this flake to get try out different configurations.
|
|
||||||
|
|
||||||
It is as simple as changing the target output to get a different configuration.
|
```console
|
||||||
For example, to get a configuration with large language coverage, run:
|
nix run github:notashelf/nvf#tidal
|
||||||
|
|
||||||
```bash
|
|
||||||
# Run the maximal package
|
|
||||||
nix run github:notashelf/nvf#maximal
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Similar instructions will apply for `nix profile install`. However, you are
|
Similar instructions will apply for `nix profile install`. However, you are
|
||||||
recommended to instead use the module system as described in the manual.
|
recommended to instead use the module system as described in the manual.
|
||||||
|
|
||||||
> [!NOTE]
|
> [!NOTE]
|
||||||
> The `maximal` configuration is quite large, and might take a while to build.
|
> The `maximal` configuration is _massive_ and will take a while to build.
|
||||||
> To get a feel for the configuration, use the default `nix` configuration.
|
> To get a feel for the configuration, use the default `nix` or `tidal`
|
||||||
> Should you choose to try out the `maximal` configuration, using the binary
|
> configurations. Should you choose to try out the `maximal` configuration,
|
||||||
> cache as described in the manual is _strongly_ recommended.
|
> using the binary cache as described in the manual is _strongly_ recommended.
|
||||||
|
|
||||||
If you are convinced, proceed to the next section to view the installation
|
|
||||||
instructions.
|
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
The _recommended_ way of installing **nvf** is using either the NixOS or the
|
See the [**nvf** Manual](https://notashelf.github.io/nvf/) for
|
||||||
Home-Manager module, though it is completely possible and no less supported to
|
detailed installation guides, configurations, available options, release notes
|
||||||
install **nvf** as a standalone package, or a flake output.
|
and more. Tips for installing userspace plugins is also contained in the
|
||||||
|
documentation.
|
||||||
|
|
||||||
See the rendered [nvf manual] for detailed and up-to-date installation guides,
|
If you want to dive right into trying **nvf** you can get a fully
|
||||||
configurations, available options, release notes and more. Tips for installing
|
featured configuration with `nix` language support by running:
|
||||||
userspace plugins is also contained in the documentation.
|
|
||||||
|
|
||||||
> [!TIP]
|
```console
|
||||||
> While using NixOS or Home-Manager modules,
|
nix run github:notashelf/nvf#nix
|
||||||
> `programs.nvf.enableManpages = true;` will allow you to view option
|
```
|
||||||
> documentation from the comfort of your terminal via `man 5 nvf`. The more you
|
|
||||||
> know.
|
|
||||||
|
|
||||||
Please create an issue on the [issue tracker] if you find the documentation
|
Please create an issue on the [issue tracker](../../../issues) if you find
|
||||||
lacking or confusing. Any improvements to the documentation through pull
|
the documentation lacking or confusing. I also appreciate any contributions
|
||||||
requests are also welcome, and appreciated.
|
to the documentation.
|
||||||
|
|
||||||
## Help
|
## Help
|
||||||
|
|
||||||
You can create an issue on the [issue tracker] to ask questions or report bugs.
|
You can create an issue on the [issue tracker](../../../issues) to ask questions
|
||||||
I am not yet on spaces like matrix or IRC, so please use the issue tracker for
|
or report bugs. I am not yet on spaces like matrix or IRC, so please use the issue
|
||||||
now.
|
tracker for now.
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
I am always looking for new ways to help improve this flake. If you would like
|
I am always looking for new ways to help improve this flake. If you would like
|
||||||
to contribute, please read the [contributing guide](CONTRIBUTING.md) before
|
to contribute, please read the [contributing guide](CONTRIBUTING.md) before
|
||||||
submitting a pull request. You can also create an issue on the [issue tracker]
|
submitting a pull request. You can also create an issue on the
|
||||||
before submitting a pull request if you would like to discuss a feature or bug
|
[issue tracker](../../../issues) before submitting a pull request if you would
|
||||||
fix.
|
like to discuss a feature or bug fix.
|
||||||
|
|
||||||
## FAQ
|
## FAQ
|
||||||
|
|
||||||
[appropriate issue template]: https://github.com/NotAShelf/nvf/issues/new/choose
|
|
||||||
[list of branches]: https://github.com/NotAShelf/nvf/branches
|
|
||||||
[list of open pull requests]: https://github.com/NotAShelf/nvf/pulls
|
|
||||||
|
|
||||||
**Q**: What platforms are supported?
|
|
||||||
<br/> **A**: nvf actively supports Linux and Darwin platforms using standalone
|
|
||||||
Nix, NixOS or Home-Manager. Please take a look at the
|
|
||||||
|
|
||||||
**Q**: Can you add _X_?
|
**Q**: Can you add _X_?
|
||||||
<br/> **A**: Maybe! It is not one of our goals to support each and every Neovim
|
<br/>
|
||||||
plugin, however, I am always open to new modules and plugin setup additions to
|
**A**: Maybe! It is not one of our goals to support each and every Neovim
|
||||||
**nvf**. Use the [appropriate issue template] and I will consider a module
|
plugin, however, I am always open to new modules and plugin setup additions
|
||||||
addition. As mentioned before, PRs adding new features are also welcome.
|
to **nvf**. Use the [appropritate issue
|
||||||
|
template](https://github.com/NotAShelf/nvf/issues/new/choose) and I will
|
||||||
|
consider a module addition.
|
||||||
|
|
||||||
**Q**: A plugin I need is not available in **nvf**. What to do?
|
**Q**: A plugin I need is not available in **nvf**. What to do?
|
||||||
<br/> **A**: **nvf** exposes several APIs for you to be able to add your own
|
<br/>
|
||||||
plugin configurations! Please see the documentation on how you may do this.
|
**A**: **nvf** exposes several APIs for you to be able to add your own
|
||||||
|
plugin configurations! Please see the documentation on how you may do
|
||||||
**Q**: Main branch is awfully silent, is the project dead?
|
this.
|
||||||
<br/> **A**: No! Sometimes we branch out (e.g. `v0.6`) to avoid breaking
|
|
||||||
userspace and work in a separate branch until we make sure the new additions are
|
|
||||||
implemented in the most comfortable way possible for the end user. If you have
|
|
||||||
not noticed any activity on the main branch, consider taking a look at the
|
|
||||||
[list of branches] or the [list of open pull requests]. You may also consider
|
|
||||||
_testing_ those release branches to get access to new features ahead of time and
|
|
||||||
better prepare to breaking changes.
|
|
||||||
|
|
||||||
## Credits
|
## Credits
|
||||||
|
|
||||||
### Contributors
|
### Contributors
|
||||||
|
|
||||||
Special, heart-felt thanks to
|
Special thanks to
|
||||||
|
|
||||||
- [@fufexan](https://github.com/fufexan) - For the transition to flake-parts
|
- [@fufexan](https://github.com/fufexan) - For the transition to flake-parts
|
||||||
- [@FlafyDev](https://github.com/FlafyDev) - For getting the home-manager to
|
- [@FlafyDev](https://github.com/FlafyDev) - For getting the home-manager to work
|
||||||
work
|
- [@n3oney](https://github.com/n3oney) - For making custom keybinds finally possible
|
||||||
- [@n3oney](https://github.com/n3oney) - For making custom keybinds finally
|
- [@horriblename](https://github.com/horriblename) - For actively implementing planned features and quality of life updates
|
||||||
possible
|
|
||||||
- [@horriblename](https://github.com/horriblename) - For actively implementing
|
|
||||||
planned features and quality of life updates
|
|
||||||
- [@Yavko](https://github.com/Yavko) - For the amazing **nvf** logo
|
- [@Yavko](https://github.com/Yavko) - For the amazing **nvf** logo
|
||||||
- [@FrothyMarrow](https://github.com/FrothyMarrow) - For seeing mistakes that I
|
- [@FrothyMarrow](https://github.com/FrothyMarrow) - For seeing mistakes that I could not
|
||||||
could not
|
|
||||||
- [@Diniamo](https://github.com/Diniamo) - For actively submitting PRs, pull
|
|
||||||
requests and overall assistence
|
|
||||||
- [@Gerg-l](https://github.com/gerg-l) - For the modern Neovim wrapper, mnw and
|
|
||||||
occasional code improvements
|
|
||||||
|
|
||||||
and everyone who has submitted issues or pull requests!
|
and everyone who has submitted issues or pull requests!
|
||||||
|
|
||||||
|
@ -209,18 +167,10 @@ and everyone who has submitted issues or pull requests!
|
||||||
This configuration borrows from and is based on a few other configurations,
|
This configuration borrows from and is based on a few other configurations,
|
||||||
including:
|
including:
|
||||||
|
|
||||||
- [@jordanisaacs's](https://github.com/jordanisaacs)
|
- [@jordanisaacs's](https://github.com/jordanisaacs) [neovim-flake](https://github.com/jordanisaacs/neovim-flake) that this flake is originally based on.
|
||||||
[neovim-flake](https://github.com/jordanisaacs/neovim-flake) that this flake
|
- [@sioodmy's](https://github.com/sioodmy) [dotfiles](https://github.com/sioodmy/dotfiles) that inspired the design choices.
|
||||||
is originally based on.
|
- [@wiltaylor's](https://github.com/wiltaylor) [neovim-flake](https://github.com/wiltaylor/neovim-flake) for plugin and design ideas.
|
||||||
- [@sioodmy's](https://github.com/sioodmy)
|
- [@gvolpe's](https://github.com/gvolpe) [neovim-flake](https://github.com/gvolpe/neovim-flake) for plugin, design and nix concepts.
|
||||||
[dotfiles](https://github.com/sioodmy/dotfiles) that inspired the design
|
|
||||||
choices.
|
|
||||||
- [@wiltaylor's](https://github.com/wiltaylor)
|
|
||||||
[neovim-flake](https://github.com/wiltaylor/neovim-flake) for plugin and
|
|
||||||
design ideas.
|
|
||||||
- [@gvolpe's](https://github.com/gvolpe)
|
|
||||||
[neovim-flake](https://github.com/gvolpe/neovim-flake) for plugin, design and
|
|
||||||
nix concepts.
|
|
||||||
|
|
||||||
I am grateful for their previous work and inspiration, and I wholeheartedly
|
I am grateful for their previous work and inspiration, and I wholeheartedly
|
||||||
recommend checking their work out.
|
recommend checking their work out.
|
||||||
|
@ -228,13 +178,9 @@ recommend checking their work out.
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
Following the license of the
|
Following the [original neovim-flake](https://github.com/jordanisaacs/neovim-flake)
|
||||||
[original neovim-flake](https://github.com/jordanisaacs/neovim-flake), **nvf**
|
**nvf** has been made available under the **MIT License**. However, all assets
|
||||||
has been made available under the [**MIT License**](LICENSE). However, all
|
are published under the [CC BY License].
|
||||||
assets and documentation are published under the
|
|
||||||
[**CC BY License**](https://github.com/NotAShelf/nvf/blob/main/.github/assets/LICENSE).
|
|
||||||
|
|
||||||
<h6 align="center">Yes, this includes the logo work too. Stop taking artwork that is not yours!</h6>
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
57
.github/pull_request_template.md
vendored
57
.github/pull_request_template.md
vendored
|
@ -1,57 +0,0 @@
|
||||||
<!--
|
|
||||||
^ Please include a clear and concise description of the aim of your Pull Request above this line ^
|
|
||||||
|
|
||||||
For plugin dependency/module additions, please make sure to link the source link of the added plugin
|
|
||||||
or dependency in this section.
|
|
||||||
|
|
||||||
If your pull request aims to fix an open issue or a please bug, please also link the relevant issue
|
|
||||||
below this line. You may attach an issue to your pull request with `Fixes #<issue number>` outside
|
|
||||||
this comment.
|
|
||||||
-->
|
|
||||||
|
|
||||||
## Sanity Checking
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Please check all that apply. As before, this section is not a hard requirement but checklists with more checked
|
|
||||||
items are likely to be merged faster. You may save some time in maintainer review by performing self-reviews here
|
|
||||||
before submitting your pull request.
|
|
||||||
|
|
||||||
If your pull request includes any change or unexpected behaviour not covered below, please do make sure to include
|
|
||||||
it above in your description.
|
|
||||||
-->
|
|
||||||
|
|
||||||
[editorconfig]: https://editorconfig.org
|
|
||||||
[changelog]: https://github.com/NotAShelf/nvf/tree/main/docs/release-notes
|
|
||||||
|
|
||||||
- [ ] I have updated the [changelog] as per my changes.
|
|
||||||
- [ ] I have tested, and self-reviewed my code.
|
|
||||||
- Style and consistency
|
|
||||||
- [ ] I ran **Alejandra** to format my code (`nix fmt`).
|
|
||||||
- [ ] My code conforms to the [editorconfig] configuration of the project.
|
|
||||||
- [ ] My changes are consistent with the rest of the codebase.
|
|
||||||
- If new changes are particularly complex:
|
|
||||||
- [ ] My code includes comments in particularly complex areas
|
|
||||||
- [ ] I have added a section in the manual.
|
|
||||||
- [ ] _(For breaking changes)_ I have included a migration guide.
|
|
||||||
- Package(s) built:
|
|
||||||
- [ ] `.#nix` (default package)
|
|
||||||
- [ ] `.#maximal`
|
|
||||||
- [ ] `.#docs-html`
|
|
||||||
- Tested on platform(s)
|
|
||||||
- [ ] `x86_64-linux`
|
|
||||||
- [ ] `aarch64-linux`
|
|
||||||
- [ ] `x86_64-darwin`
|
|
||||||
- [ ] `aarch64-darwin`
|
|
||||||
|
|
||||||
<!--
|
|
||||||
If your changes touch upon a portion of the codebase that you do not understand well, please make sure to consult
|
|
||||||
the maintainers on your changes. In most cases, making an issue before creating your PR will help you avoid duplicate
|
|
||||||
efforts in the long run.
|
|
||||||
-->
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
Add a :+1: [reaction] to [pull requests you find important].
|
|
||||||
|
|
||||||
[reaction]: https://github.blog/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/
|
|
||||||
[pull requests you find important]: https://github.com/NixOS/nixpkgs/pulls?q=is%3Aopen+sort%3Areactions-%2B1-desc
|
|
3
.github/workflows/cachix.yml
vendored
3
.github/workflows/cachix.yml
vendored
|
@ -19,6 +19,7 @@ jobs:
|
||||||
package:
|
package:
|
||||||
- default
|
- default
|
||||||
- nix
|
- nix
|
||||||
|
- tidal
|
||||||
- maximal
|
- maximal
|
||||||
steps:
|
steps:
|
||||||
- uses: easimon/maximize-build-space@v10
|
- uses: easimon/maximize-build-space@v10
|
||||||
|
@ -37,7 +38,7 @@ jobs:
|
||||||
uses: DeterminateSystems/nix-installer-action@main
|
uses: DeterminateSystems/nix-installer-action@main
|
||||||
- uses: DeterminateSystems/magic-nix-cache-action@main
|
- uses: DeterminateSystems/magic-nix-cache-action@main
|
||||||
|
|
||||||
- uses: cachix/cachix-action@v15
|
- uses: cachix/cachix-action@v14
|
||||||
with:
|
with:
|
||||||
authToken: ${{ secrets.CACHIX_TOKEN }}
|
authToken: ${{ secrets.CACHIX_TOKEN }}
|
||||||
extraPullNames: nix-community
|
extraPullNames: nix-community
|
||||||
|
|
2
.github/workflows/check-docs.yml
vendored
2
.github/workflows/check-docs.yml
vendored
|
@ -48,4 +48,4 @@ jobs:
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: "${{ matrix.package }}"
|
name: "${{ matrix.package }}"
|
||||||
path: result/share/doc/nvf
|
path: result/share/doc/neovim-flake/
|
||||||
|
|
22
.github/workflows/cleanup.yml
vendored
22
.github/workflows/cleanup.yml
vendored
|
@ -1,22 +0,0 @@
|
||||||
name: Cleanup
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
schedule:
|
|
||||||
- cron: "0 4 1 * *" # 4AM on 1st of every month
|
|
||||||
- cron: "0 4 15 * *" # 4AM on the 15th of every month
|
|
||||||
jobs:
|
|
||||||
branches:
|
|
||||||
name: Cleanup old branches
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: "Checkout"
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: "Delete old branches"
|
|
||||||
uses: beatlabs/delete-old-branches-action@v0.0.10
|
|
||||||
with:
|
|
||||||
repo_token: "${{ secrets.GITHUB_TOKEN }}"
|
|
||||||
date: "1 months ago"
|
|
||||||
dry_run: false
|
|
||||||
delete_tags: false
|
|
||||||
exclude_open_pr_branches: true
|
|
50
.github/workflows/docker.yml
vendored
Normal file
50
.github/workflows/docker.yml
vendored
Normal file
|
@ -0,0 +1,50 @@
|
||||||
|
name: "Publish Docker Image"
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
push:
|
||||||
|
tags: ["v*"]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-docker-image:
|
||||||
|
name: "Build Docker Image"
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
packages: write
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install Nix
|
||||||
|
uses: DeterminateSystems/nix-installer-action@main
|
||||||
|
- name: Magic Nix Cache
|
||||||
|
uses: DeterminateSystems/magic-nix-cache-action@main
|
||||||
|
|
||||||
|
- name: Build Docker Image
|
||||||
|
run: nix build .#docker-nix --print-build-logs
|
||||||
|
|
||||||
|
- name: Load & Tag Built Docker Image
|
||||||
|
run: |
|
||||||
|
docker load -i result &&
|
||||||
|
docker tag neovim-flake:latest notashelf/neovim-flake:latest
|
||||||
|
|
||||||
|
- name: Log into DockerHub
|
||||||
|
uses: docker/login-action@master
|
||||||
|
with:
|
||||||
|
username: notashelf
|
||||||
|
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
|
||||||
|
|
||||||
|
- name: Push to DockerHub
|
||||||
|
run: docker push notashelf/neovim-flake:latest
|
||||||
|
|
||||||
|
- name: Log into ghcr
|
||||||
|
uses: docker/login-action@master
|
||||||
|
with:
|
||||||
|
registry: "ghcr.io"
|
||||||
|
username: "${{ github.actor }}"
|
||||||
|
password: "${{ secrets.GITHUB_TOKEN }}"
|
||||||
|
|
||||||
|
- name: Publish Docker Image (Github Packages)
|
||||||
|
run: docker push notashelf/neovim-flake:latest
|
39
.github/workflows/manual.yml
vendored
39
.github/workflows/manual.yml
vendored
|
@ -1,5 +1,4 @@
|
||||||
name: "Build and deploy documentation"
|
name: "Build and deploy documentation"
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
push:
|
push:
|
||||||
|
@ -8,7 +7,6 @@ on:
|
||||||
paths:
|
paths:
|
||||||
# build the manuals only when docs directory is updated
|
# build the manuals only when docs directory is updated
|
||||||
- docs/**
|
- docs/**
|
||||||
- modules/**
|
|
||||||
|
|
||||||
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
|
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
|
||||||
permissions:
|
permissions:
|
||||||
|
@ -22,34 +20,23 @@ concurrency:
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check_date:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
name: Check latest commit
|
|
||||||
outputs:
|
|
||||||
should_run: ${{ steps.should_run.outputs.should_run }}
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4.1.7
|
|
||||||
- name: print latest_commit
|
|
||||||
run: echo ${{ github.sha }}
|
|
||||||
|
|
||||||
- id: should_run
|
|
||||||
continue-on-error: true
|
|
||||||
name: check latest commit is less than a day
|
|
||||||
if: ${{ github.event_name == 'schedule' }}
|
|
||||||
run: test -z $(git rev-list --after="24 hours" ${{ github.sha }}) && echo "::set-output name=should_run::false"
|
|
||||||
|
|
||||||
publish:
|
publish:
|
||||||
needs: check_date
|
|
||||||
if: ${{ needs.check_date.outputs.should_run != 'false' }}
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4.1.7
|
- name: Checkout
|
||||||
- uses: DeterminateSystems/nix-installer-action@main
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install Nix
|
||||||
|
uses: DeterminateSystems/nix-installer-action@main
|
||||||
- uses: DeterminateSystems/magic-nix-cache-action@main
|
- uses: DeterminateSystems/magic-nix-cache-action@main
|
||||||
- run: |
|
|
||||||
nix build .#docs
|
- name: Build
|
||||||
cp -r result/share/doc/nvf public
|
run: |
|
||||||
- uses: peaceiris/actions-gh-pages@v4
|
nix build '.#docs'
|
||||||
|
cp -r result/share/doc/neovim-flake public
|
||||||
|
|
||||||
|
- name: Deploy
|
||||||
|
uses: peaceiris/actions-gh-pages@v4
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
publish_dir: ./public
|
publish_dir: ./public
|
||||||
|
|
|
@ -1,237 +1,255 @@
|
||||||
isMaximal: {
|
inputs: let
|
||||||
config.vim = {
|
modulesWithInputs = import ./modules inputs;
|
||||||
viAlias = true;
|
|
||||||
vimAlias = true;
|
neovimConfiguration = {
|
||||||
debugMode = {
|
modules ? [],
|
||||||
enable = false;
|
pkgs,
|
||||||
level = 16;
|
lib ? pkgs.lib,
|
||||||
logFile = "/tmp/nvim.log";
|
check ? true,
|
||||||
|
extraSpecialArgs ? {},
|
||||||
|
extraModules ? [],
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
modulesWithInputs {
|
||||||
|
inherit pkgs lib check extraSpecialArgs extraModules;
|
||||||
|
configuration.imports = modules;
|
||||||
};
|
};
|
||||||
|
|
||||||
spellcheck = {
|
tidalConfig = {
|
||||||
enable = isMaximal;
|
config.vim.languages.tidal.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
lsp = {
|
mainConfig = isMaximal: {
|
||||||
formatOnSave = true;
|
config.vim = {
|
||||||
lspkind.enable = false;
|
viAlias = true;
|
||||||
lightbulb.enable = true;
|
vimAlias = true;
|
||||||
lspsaga.enable = false;
|
debugMode = {
|
||||||
trouble.enable = true;
|
enable = false;
|
||||||
lspSignature.enable = true;
|
level = 16;
|
||||||
otter-nvim.enable = isMaximal;
|
logFile = "/tmp/nvim.log";
|
||||||
lsplines.enable = isMaximal;
|
|
||||||
nvim-docs-view.enable = isMaximal;
|
|
||||||
};
|
|
||||||
|
|
||||||
debugger = {
|
|
||||||
nvim-dap = {
|
|
||||||
enable = true;
|
|
||||||
ui.enable = true;
|
|
||||||
};
|
};
|
||||||
};
|
|
||||||
|
|
||||||
languages = {
|
spellcheck = {
|
||||||
enableLSP = true;
|
|
||||||
enableFormat = true;
|
|
||||||
enableTreesitter = true;
|
|
||||||
enableExtraDiagnostics = true;
|
|
||||||
|
|
||||||
# Nim LSP is broken on Darwin and therefore
|
|
||||||
# should be disabled by default. Users may still enable
|
|
||||||
# `vim.languages.vim` to enable it, this does not restrict
|
|
||||||
# that.
|
|
||||||
# See: <https://github.com/PMunch/nimlsp/issues/178#issue-2128106096>
|
|
||||||
nim.enable = false;
|
|
||||||
|
|
||||||
nix.enable = true;
|
|
||||||
|
|
||||||
markdown.enable = isMaximal;
|
|
||||||
html.enable = isMaximal;
|
|
||||||
css.enable = isMaximal;
|
|
||||||
sql.enable = isMaximal;
|
|
||||||
java.enable = isMaximal;
|
|
||||||
ts.enable = isMaximal;
|
|
||||||
svelte.enable = isMaximal;
|
|
||||||
go.enable = isMaximal;
|
|
||||||
lua.enable = isMaximal;
|
|
||||||
elixir.enable = isMaximal;
|
|
||||||
zig.enable = isMaximal;
|
|
||||||
ocaml.enable = isMaximal;
|
|
||||||
python.enable = isMaximal;
|
|
||||||
dart.enable = isMaximal;
|
|
||||||
bash.enable = isMaximal;
|
|
||||||
r.enable = isMaximal;
|
|
||||||
tailwind.enable = isMaximal;
|
|
||||||
typst.enable = isMaximal;
|
|
||||||
clang = {
|
|
||||||
enable = isMaximal;
|
enable = isMaximal;
|
||||||
lsp.server = "clangd";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
rust = {
|
lsp = {
|
||||||
enable = isMaximal;
|
formatOnSave = true;
|
||||||
crates.enable = isMaximal;
|
lspkind.enable = false;
|
||||||
};
|
lightbulb.enable = true;
|
||||||
};
|
lspsaga.enable = false;
|
||||||
|
nvimCodeActionMenu.enable = isMaximal;
|
||||||
visuals = {
|
trouble.enable = true;
|
||||||
enable = true;
|
lspSignature.enable = true;
|
||||||
nvimWebDevicons.enable = true;
|
lsplines.enable = isMaximal;
|
||||||
scrollBar.enable = isMaximal;
|
nvim-docs-view.enable = isMaximal;
|
||||||
smoothScroll.enable = true;
|
|
||||||
cellularAutomaton.enable = false;
|
|
||||||
fidget-nvim.enable = true;
|
|
||||||
highlight-undo.enable = true;
|
|
||||||
|
|
||||||
indentBlankline.enable = true;
|
|
||||||
|
|
||||||
cursorline = {
|
|
||||||
enable = true;
|
|
||||||
lineTimeout = 0;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
statusline = {
|
|
||||||
lualine = {
|
|
||||||
enable = true;
|
|
||||||
theme = "catppuccin";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
theme = {
|
|
||||||
enable = true;
|
|
||||||
name = "catppuccin";
|
|
||||||
style = "mocha";
|
|
||||||
transparent = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
autopairs.enable = true;
|
|
||||||
|
|
||||||
autocomplete = {
|
|
||||||
enable = true;
|
|
||||||
type = "nvim-cmp";
|
|
||||||
};
|
|
||||||
|
|
||||||
filetree = {
|
|
||||||
nvimTree = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
tabline = {
|
|
||||||
nvimBufferline.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
treesitter.context.enable = true;
|
|
||||||
|
|
||||||
binds = {
|
|
||||||
whichKey.enable = true;
|
|
||||||
cheatsheet.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
telescope.enable = true;
|
|
||||||
|
|
||||||
git = {
|
|
||||||
enable = true;
|
|
||||||
gitsigns.enable = true;
|
|
||||||
gitsigns.codeActions.enable = false; # throws an annoying debug message
|
|
||||||
};
|
|
||||||
|
|
||||||
minimap = {
|
|
||||||
minimap-vim.enable = false;
|
|
||||||
codewindow.enable = isMaximal; # lighter, faster, and uses lua for configuration
|
|
||||||
};
|
|
||||||
|
|
||||||
dashboard = {
|
|
||||||
dashboard-nvim.enable = false;
|
|
||||||
alpha.enable = isMaximal;
|
|
||||||
};
|
|
||||||
|
|
||||||
notify = {
|
|
||||||
nvim-notify.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
projects = {
|
|
||||||
project-nvim.enable = isMaximal;
|
|
||||||
};
|
|
||||||
|
|
||||||
utility = {
|
|
||||||
ccc.enable = false;
|
|
||||||
vim-wakatime.enable = false;
|
|
||||||
icon-picker.enable = isMaximal;
|
|
||||||
surround.enable = isMaximal;
|
|
||||||
diffview-nvim.enable = true;
|
|
||||||
motion = {
|
|
||||||
hop.enable = true;
|
|
||||||
leap.enable = true;
|
|
||||||
precognition.enable = isMaximal;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
images = {
|
debugger = {
|
||||||
image-nvim.enable = false;
|
nvim-dap = {
|
||||||
};
|
enable = true;
|
||||||
};
|
ui.enable = true;
|
||||||
|
|
||||||
notes = {
|
|
||||||
obsidian.enable = false; # FIXME: neovim fails to build if obsidian is enabled
|
|
||||||
orgmode.enable = false;
|
|
||||||
mind-nvim.enable = isMaximal;
|
|
||||||
todo-comments.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
terminal = {
|
|
||||||
toggleterm = {
|
|
||||||
enable = true;
|
|
||||||
lazygit.enable = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
ui = {
|
|
||||||
borders.enable = true;
|
|
||||||
noice.enable = true;
|
|
||||||
colorizer.enable = true;
|
|
||||||
modes-nvim.enable = false; # the theme looks terrible with catppuccin
|
|
||||||
illuminate.enable = true;
|
|
||||||
breadcrumbs = {
|
|
||||||
enable = isMaximal;
|
|
||||||
navbuddy.enable = isMaximal;
|
|
||||||
};
|
|
||||||
smartcolumn = {
|
|
||||||
enable = true;
|
|
||||||
setupOpts.custom_colorcolumn = {
|
|
||||||
# this is a freeform module, it's `buftype = int;` for configuring column position
|
|
||||||
nix = "110";
|
|
||||||
ruby = "120";
|
|
||||||
java = "130";
|
|
||||||
go = ["90" "130"];
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
fastaction.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
assistant = {
|
languages = {
|
||||||
chatgpt.enable = false;
|
enableLSP = true;
|
||||||
copilot = {
|
enableFormat = true;
|
||||||
enable = false;
|
enableTreesitter = true;
|
||||||
cmp.enable = isMaximal;
|
enableExtraDiagnostics = true;
|
||||||
|
|
||||||
|
nix.enable = true;
|
||||||
|
html.enable = isMaximal;
|
||||||
|
css.enable = isMaximal;
|
||||||
|
sql.enable = isMaximal;
|
||||||
|
java.enable = isMaximal;
|
||||||
|
ts.enable = isMaximal;
|
||||||
|
svelte.enable = isMaximal;
|
||||||
|
go.enable = isMaximal;
|
||||||
|
zig.enable = isMaximal;
|
||||||
|
python.enable = isMaximal;
|
||||||
|
dart.enable = isMaximal;
|
||||||
|
elixir.enable = isMaximal;
|
||||||
|
bash.enable = isMaximal;
|
||||||
|
terraform.enable = isMaximal;
|
||||||
|
nim.enable = false;
|
||||||
|
tailwind.enable = isMaximal;
|
||||||
|
clang = {
|
||||||
|
enable = isMaximal;
|
||||||
|
lsp.server = "clangd";
|
||||||
|
};
|
||||||
|
|
||||||
|
rust = {
|
||||||
|
enable = isMaximal;
|
||||||
|
crates.enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
visuals = {
|
||||||
|
enable = true;
|
||||||
|
nvimWebDevicons.enable = true;
|
||||||
|
scrollBar.enable = true;
|
||||||
|
smoothScroll.enable = true;
|
||||||
|
cellularAutomaton.enable = false;
|
||||||
|
fidget-nvim.enable = true;
|
||||||
|
highlight-undo.enable = true;
|
||||||
|
|
||||||
|
indentBlankline = {
|
||||||
|
enable = true;
|
||||||
|
fillChar = null;
|
||||||
|
eolChar = null;
|
||||||
|
scope = {
|
||||||
|
enabled = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
cursorline = {
|
||||||
|
enable = true;
|
||||||
|
lineTimeout = 0;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
statusline = {
|
||||||
|
lualine = {
|
||||||
|
enable = true;
|
||||||
|
theme = "catppuccin";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
theme = {
|
||||||
|
enable = true;
|
||||||
|
name = "catppuccin";
|
||||||
|
style = "mocha";
|
||||||
|
transparent = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
autopairs.enable = true;
|
||||||
|
|
||||||
|
autocomplete = {
|
||||||
|
enable = true;
|
||||||
|
type = "nvim-cmp";
|
||||||
|
};
|
||||||
|
|
||||||
|
filetree = {
|
||||||
|
nvimTree = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
tabline = {
|
||||||
|
nvimBufferline.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
treesitter.context.enable = true;
|
||||||
|
|
||||||
|
binds = {
|
||||||
|
whichKey.enable = true;
|
||||||
|
cheatsheet.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
telescope.enable = true;
|
||||||
|
|
||||||
|
git = {
|
||||||
|
enable = true;
|
||||||
|
gitsigns.enable = true;
|
||||||
|
gitsigns.codeActions.enable = false; # throws an annoying debug message
|
||||||
|
};
|
||||||
|
|
||||||
|
minimap = {
|
||||||
|
minimap-vim.enable = false;
|
||||||
|
codewindow.enable = isMaximal; # lighter, faster, and uses lua for configuration
|
||||||
|
};
|
||||||
|
|
||||||
|
dashboard = {
|
||||||
|
dashboard-nvim.enable = false;
|
||||||
|
alpha.enable = isMaximal;
|
||||||
|
};
|
||||||
|
|
||||||
|
notify = {
|
||||||
|
nvim-notify.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
projects = {
|
||||||
|
project-nvim.enable = isMaximal;
|
||||||
|
};
|
||||||
|
|
||||||
|
utility = {
|
||||||
|
ccc.enable = isMaximal;
|
||||||
|
vim-wakatime.enable = isMaximal;
|
||||||
|
icon-picker.enable = isMaximal;
|
||||||
|
surround.enable = isMaximal;
|
||||||
|
diffview-nvim.enable = true;
|
||||||
|
motion = {
|
||||||
|
hop.enable = true;
|
||||||
|
leap.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
images = {
|
||||||
|
image-nvim.enable = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
notes = {
|
||||||
|
obsidian.enable = false; # FIXME: neovim fails to build if obsidian is enabled
|
||||||
|
orgmode.enable = false;
|
||||||
|
mind-nvim.enable = isMaximal;
|
||||||
|
todo-comments.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
terminal = {
|
||||||
|
toggleterm = {
|
||||||
|
enable = true;
|
||||||
|
lazygit.enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
ui = {
|
||||||
|
borders.enable = true;
|
||||||
|
noice.enable = true;
|
||||||
|
colorizer.enable = true;
|
||||||
|
modes-nvim.enable = false; # the theme looks terrible with catppuccin
|
||||||
|
illuminate.enable = true;
|
||||||
|
breadcrumbs = {
|
||||||
|
enable = isMaximal;
|
||||||
|
navbuddy.enable = isMaximal;
|
||||||
|
};
|
||||||
|
smartcolumn = {
|
||||||
|
enable = true;
|
||||||
|
setupOpts.custom_colorcolumn = {
|
||||||
|
# this is a freeform module, it's `buftype = int;` for configuring column position
|
||||||
|
nix = 110;
|
||||||
|
ruby = 120;
|
||||||
|
java = 130;
|
||||||
|
go = [90 130];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
assistant = {
|
||||||
|
chatgpt.enable = false;
|
||||||
|
copilot = {
|
||||||
|
enable = false;
|
||||||
|
cmp.enable = isMaximal;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
session = {
|
||||||
|
nvim-session-manager.enable = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
gestures = {
|
||||||
|
gesture-nvim.enable = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
comments = {
|
||||||
|
comment-nvim.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
presence = {
|
||||||
|
neocord.enable = false;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
session = {
|
|
||||||
nvim-session-manager.enable = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
gestures = {
|
|
||||||
gesture-nvim.enable = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
comments = {
|
|
||||||
comment-nvim.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
presence = {
|
|
||||||
neocord.enable = false;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
in {
|
||||||
|
inherit neovimConfiguration mainConfig tidalConfig;
|
||||||
}
|
}
|
||||||
|
|
256
docs/default.nix
256
docs/default.nix
|
@ -1,132 +1,132 @@
|
||||||
{
|
{
|
||||||
inputs,
|
inputs,
|
||||||
pkgs,
|
pkgs,
|
||||||
lib,
|
lib ? import ../lib/stdlib-extended.nix pkgs.lib inputs,
|
||||||
|
manpageUrls ? pkgs.path + "/doc/manpage-urls.json",
|
||||||
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit ((lib.importJSON ../release.json)) release;
|
inherit (lib.modules) mkForce evalModules;
|
||||||
|
inherit (lib.strings) hasPrefix removePrefix;
|
||||||
|
inherit (lib.attrsets) isAttrs mapAttrs optionalAttrs recursiveUpdate isDerivation;
|
||||||
|
inherit (builtins) fromJSON readFile;
|
||||||
|
|
||||||
nvimModuleDocs = pkgs.nixosOptionsDoc {
|
# release data
|
||||||
variablelistId = "nvf-options";
|
release-config = fromJSON (readFile ../release.json);
|
||||||
warningsAreErrors = true;
|
revision = release-config.release;
|
||||||
|
|
||||||
inherit
|
# From home-manager:
|
||||||
(
|
#
|
||||||
(lib.evalModules {
|
# Recursively replace each derivation in the given attribute set
|
||||||
modules =
|
# with the same derivation but with the `outPath` attribute set to
|
||||||
import ../modules/modules.nix {
|
# the string `"\${pkgs.attribute.path}"`. This allows the
|
||||||
inherit lib pkgs;
|
# documentation to refer to derivations through their values without
|
||||||
}
|
# establishing an actual dependency on the derivation output.
|
||||||
++ [
|
#
|
||||||
(
|
# This is not perfect, but it seems to cover a vast majority of use
|
||||||
let
|
# cases.
|
||||||
# From nixpkgs:
|
#
|
||||||
#
|
# Caveat: even if the package is reached by a different means, the
|
||||||
# Recursively replace each derivation in the given attribute set
|
# path above will be shown and not e.g.
|
||||||
# with the same derivation but with the `outPath` attribute set to
|
# `${config.services.foo.package}`.
|
||||||
# the string `"\${pkgs.attribute.path}"`. This allows the
|
scrubDerivations = prefixPath: attrs: let
|
||||||
# documentation to refer to derivations through their values without
|
scrubDerivation = name: value: let
|
||||||
# establishing an actual dependency on the derivation output.
|
pkgAttrName = prefixPath + "." + name;
|
||||||
#
|
in
|
||||||
# This is not perfect, but it seems to cover a vast majority of use
|
if isAttrs value
|
||||||
# cases.
|
then
|
||||||
#
|
scrubDerivations pkgAttrName value
|
||||||
# Caveat: even if the package is reached by a different means, the
|
// optionalAttrs (isDerivation value) {
|
||||||
# path above will be shown and not e.g.
|
outPath = "\${${pkgAttrName}}";
|
||||||
# `${config.services.foo.package}`.
|
}
|
||||||
scrubDerivations = namePrefix: pkgSet:
|
else value;
|
||||||
builtins.mapAttrs (
|
in
|
||||||
name: value: let
|
mapAttrs scrubDerivation attrs;
|
||||||
wholeName = "${namePrefix}.${name}";
|
|
||||||
in
|
|
||||||
if builtins.isAttrs value
|
|
||||||
then
|
|
||||||
scrubDerivations wholeName value
|
|
||||||
// lib.optionalAttrs (lib.isDerivation value) {
|
|
||||||
inherit (value) drvPath;
|
|
||||||
outPath = "\${${wholeName}}";
|
|
||||||
}
|
|
||||||
else value
|
|
||||||
)
|
|
||||||
pkgSet;
|
|
||||||
in {
|
|
||||||
_module = {
|
|
||||||
check = false;
|
|
||||||
args.pkgs = lib.mkForce (scrubDerivations "pkgs" pkgs);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
)
|
|
||||||
];
|
|
||||||
})
|
|
||||||
)
|
|
||||||
options
|
|
||||||
;
|
|
||||||
|
|
||||||
transformOptions = opt:
|
# Make sure the used package is scrubbed to avoid actually
|
||||||
opt
|
# instantiating derivations.
|
||||||
// {
|
scrubbedPkgsModule = {
|
||||||
declarations =
|
imports = [
|
||||||
map (
|
{
|
||||||
decl:
|
_module.args = {
|
||||||
if lib.hasPrefix (toString ../.) (toString decl)
|
pkgs = mkForce (scrubDerivations "pkgs" pkgs);
|
||||||
|
pkgs_i686 = mkForce {};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
# Specify the path to the module entrypoint
|
||||||
|
nvimPath = toString ./..;
|
||||||
|
buildOptionsDocs = args @ {
|
||||||
|
modules,
|
||||||
|
includeModuleSystemOptions ? true,
|
||||||
|
warningsAreErrors ? true,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit ((evalModules {inherit modules;})) options;
|
||||||
|
|
||||||
|
# Declaration of the Github site URL.
|
||||||
|
# Takes a user, repo, and subpath, and returns a declaration site
|
||||||
|
# as a string.
|
||||||
|
githubDeclaration = user: repo: subpath: let
|
||||||
|
urlRef = "github.com";
|
||||||
|
branch = "main";
|
||||||
|
in {
|
||||||
|
url = "https://${urlRef}/${user}/${repo}/blob/${branch}/${subpath}";
|
||||||
|
name = "<${repo}/${subpath}>";
|
||||||
|
};
|
||||||
|
in
|
||||||
|
pkgs.buildPackages.nixosOptionsDoc ({
|
||||||
|
inherit warningsAreErrors;
|
||||||
|
|
||||||
|
options =
|
||||||
|
if includeModuleSystemOptions
|
||||||
|
then options
|
||||||
|
else builtins.removeAttrs options ["_module"];
|
||||||
|
|
||||||
|
transformOptions = opt:
|
||||||
|
recursiveUpdate opt {
|
||||||
|
# Clean up declaration sites to not refer to the nvf
|
||||||
|
# source tree.
|
||||||
|
declarations = map (decl:
|
||||||
|
if hasPrefix nvimPath (toString decl)
|
||||||
then
|
then
|
||||||
lib.pipe decl [
|
githubDeclaration "notashelf" "nvf"
|
||||||
toString
|
(removePrefix "/" (removePrefix nvimPath (toString decl)))
|
||||||
(lib.removePrefix (toString ../.))
|
|
||||||
(lib.removePrefix "/")
|
|
||||||
(x: {
|
|
||||||
url = "https://github.com/NotAShelf/nvf/blob/main/${x}";
|
|
||||||
name = "<nvf/${x}>";
|
|
||||||
})
|
|
||||||
]
|
|
||||||
else if decl == "lib/modules.nix"
|
else if decl == "lib/modules.nix"
|
||||||
then {
|
then
|
||||||
url = "https://github.com/NixOS/nixpkgs/blob/master/${decl}";
|
# TODO: handle this in a better way (may require upstream
|
||||||
name = "<nixpkgs/lib/modules.nix>";
|
# changes to nixpkgs)
|
||||||
}
|
githubDeclaration "NixOS" "nixpkgs" decl
|
||||||
else decl
|
else decl)
|
||||||
)
|
opt.declarations;
|
||||||
opt.declarations;
|
};
|
||||||
};
|
}
|
||||||
};
|
// builtins.removeAttrs args ["modules" "includeModuleSystemOptions"]);
|
||||||
|
|
||||||
# Generate the HTML manual pages
|
nvimModuleDocs = buildOptionsDocs {
|
||||||
html = pkgs.callPackage ./manual.nix {
|
variablelistId = "nvf-options";
|
||||||
inherit release;
|
|
||||||
inherit (nvimModuleDocs) optionsJSON;
|
|
||||||
};
|
|
||||||
in {
|
|
||||||
inherit (inputs) nmd;
|
|
||||||
|
|
||||||
# TODO: Use `hmOptionsDocs.optionsJSON` directly once upstream
|
modules =
|
||||||
# `nixosOptionsDoc` is more customizable.
|
import ../modules/modules.nix {
|
||||||
options.json =
|
inherit lib pkgs;
|
||||||
pkgs.runCommand "options.json" {
|
check = false;
|
||||||
meta.description = "List of nvf options in JSON format";
|
}
|
||||||
} ''
|
++ [scrubbedPkgsModule];
|
||||||
mkdir -p $out/{share/doc,nix-support}
|
};
|
||||||
cp -a ${nvimModuleDocs.optionsJSON}/share/doc/nixos $out/share/doc/nvf
|
|
||||||
substitute \
|
|
||||||
${nvimModuleDocs.optionsJSON}/nix-support/hydra-build-products \
|
|
||||||
$out/nix-support/hydra-build-products \
|
|
||||||
--replace \
|
|
||||||
'${nvimModuleDocs.optionsJSON}/share/doc/nixos' \
|
|
||||||
"$out/share/doc/nvf"
|
|
||||||
'';
|
|
||||||
|
|
||||||
# Generate the `man home-configuration.nix` package
|
# Generate the `man home-configuration.nix` package
|
||||||
manPages =
|
nvf-configuration-manual =
|
||||||
pkgs.runCommand "nvf-reference-manpage" {
|
pkgs.runCommand "nvf-reference-manpage" {
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [pkgs.buildPackages.installShellFiles pkgs.nixos-render-docs];
|
||||||
pkgs.buildPackages.installShellFiles
|
|
||||||
pkgs.nixos-render-docs
|
|
||||||
];
|
|
||||||
allowedReferences = ["out"];
|
allowedReferences = ["out"];
|
||||||
} ''
|
} ''
|
||||||
# Generate manpages.
|
# Generate manpages.
|
||||||
mkdir -p $out/share/man/{man5,man1}
|
mkdir -p $out/share/man/man5
|
||||||
|
mkdir -p $out/share/man/man1
|
||||||
|
|
||||||
nixos-render-docs -j $NIX_BUILD_CORES options manpage \
|
nixos-render-docs -j $NIX_BUILD_CORES options manpage \
|
||||||
--revision ${release} \
|
--revision ${revision} \
|
||||||
--header ${./man/header.5} \
|
--header ${./man/header.5} \
|
||||||
--footer ${./man/footer.5} \
|
--footer ${./man/footer.5} \
|
||||||
${nvimModuleDocs.optionsJSON}/share/doc/nixos/options.json \
|
${nvimModuleDocs.optionsJSON}/share/doc/nixos/options.json \
|
||||||
|
@ -135,8 +135,38 @@ in {
|
||||||
cp ${./man/nvf.1} $out/share/man/man1/nvf.1
|
cp ${./man/nvf.1} $out/share/man/man1/nvf.1
|
||||||
'';
|
'';
|
||||||
|
|
||||||
manual = {
|
# Generate the HTML manual pages
|
||||||
inherit html;
|
nvf-manual = pkgs.callPackage ./manual.nix {
|
||||||
htmlOpenTool = pkgs.callPackage ./html-open-tool.nix {inherit html;};
|
inherit revision manpageUrls;
|
||||||
|
outputPath = "share/doc/nvf";
|
||||||
|
options = {
|
||||||
|
nvf = nvimModuleDocs.optionsJSON;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
html = nvf-manual;
|
||||||
|
htmlOpenTool = pkgs.callPackage ./html-open-tool.nix {} {inherit html;};
|
||||||
|
in {
|
||||||
|
inherit (inputs) nmd;
|
||||||
|
|
||||||
|
options = {
|
||||||
|
# TODO: Use `hmOptionsDocs.optionsJSON` directly once upstream
|
||||||
|
# `nixosOptionsDoc` is more customizable.
|
||||||
|
json =
|
||||||
|
pkgs.runCommand "options.json" {
|
||||||
|
meta.description = "List of nvf options in JSON format";
|
||||||
|
} ''
|
||||||
|
mkdir -p $out/{share/doc,nix-support}
|
||||||
|
cp -a ${nvimModuleDocs.optionsJSON}/share/doc/nixos $out/share/doc/nvf
|
||||||
|
substitute \
|
||||||
|
${nvimModuleDocs.optionsJSON}/nix-support/hydra-build-products \
|
||||||
|
$out/nix-support/hydra-build-products \
|
||||||
|
--replace \
|
||||||
|
'${nvimModuleDocs.optionsJSON}/share/doc/nixos' \
|
||||||
|
"$out/share/doc/nvf"
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
manPages = nvf-configuration-manual;
|
||||||
|
manual = {inherit html htmlOpenTool;};
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,9 +2,13 @@
|
||||||
writeShellScriptBin,
|
writeShellScriptBin,
|
||||||
makeDesktopItem,
|
makeDesktopItem,
|
||||||
symlinkJoin,
|
symlinkJoin,
|
||||||
|
}: {
|
||||||
html,
|
html,
|
||||||
|
pathName ? "nvf",
|
||||||
|
projectName ? pathName,
|
||||||
|
name ? "${pathName}-help",
|
||||||
}: let
|
}: let
|
||||||
helpScript = writeShellScriptBin "nvf-help" ''
|
helpScript = writeShellScriptBin name ''
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
if [[ ! -v BROWSER || -z $BROWSER ]]; then
|
if [[ ! -v BROWSER || -z $BROWSER ]]; then
|
||||||
|
@ -20,23 +24,20 @@
|
||||||
echo "$0: unable to start a web browser; please set \$BROWSER"
|
echo "$0: unable to start a web browser; please set \$BROWSER"
|
||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
exec "$BROWSER" "${html}/share/doc/nvf/index.xhtml"
|
exec "$BROWSER" "${html}/share/doc/${pathName}/index.xhtml"
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
|
|
||||||
desktopItem = makeDesktopItem {
|
desktopItem = makeDesktopItem {
|
||||||
name = "nvf-manual";
|
name = "${pathName}-manual";
|
||||||
desktopName = "nvf Manual";
|
desktopName = "${projectName} Manual";
|
||||||
genericName = "View nvf documentation in a web browser";
|
genericName = "View ${projectName} documentation in a web browser";
|
||||||
icon = "nix-snowflake";
|
icon = "nix-snowflake";
|
||||||
exec = "${helpScript}/bin/nvf-help";
|
exec = "${helpScript}/bin/${name}";
|
||||||
categories = ["System"];
|
categories = ["System"];
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
symlinkJoin {
|
symlinkJoin {
|
||||||
name = "nvf-help";
|
inherit name;
|
||||||
paths = [
|
paths = [helpScript desktopItem];
|
||||||
helpScript
|
|
||||||
desktopItem
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,10 +4,11 @@
|
||||||
# build inputs
|
# build inputs
|
||||||
nixos-render-docs,
|
nixos-render-docs,
|
||||||
documentation-highlighter,
|
documentation-highlighter,
|
||||||
path,
|
|
||||||
# nrd configuration
|
# nrd configuration
|
||||||
release,
|
manpageUrls,
|
||||||
optionsJSON,
|
revision,
|
||||||
|
options,
|
||||||
|
outputPath ? "share/doc/nvf",
|
||||||
}:
|
}:
|
||||||
stdenvNoCC.mkDerivation {
|
stdenvNoCC.mkDerivation {
|
||||||
name = "nvf-manual";
|
name = "nvf-manual";
|
||||||
|
@ -19,11 +20,9 @@ stdenvNoCC.mkDerivation {
|
||||||
nativeBuildInputs = [nixos-render-docs];
|
nativeBuildInputs = [nixos-render-docs];
|
||||||
|
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
dest="$out/share/doc/nvf"
|
mkdir -p out/{highlightjs,media}
|
||||||
mkdir -p "$(dirname "$dest")"
|
|
||||||
mkdir -p $dest/{highlightjs,media}
|
|
||||||
|
|
||||||
cp -vt $dest/highlightjs \
|
cp -vt out/highlightjs \
|
||||||
${documentation-highlighter}/highlight.pack.js \
|
${documentation-highlighter}/highlight.pack.js \
|
||||||
${documentation-highlighter}/LICENSE \
|
${documentation-highlighter}/LICENSE \
|
||||||
${documentation-highlighter}/mono-blue.css \
|
${documentation-highlighter}/mono-blue.css \
|
||||||
|
@ -32,32 +31,38 @@ stdenvNoCC.mkDerivation {
|
||||||
substituteInPlace ./options.md \
|
substituteInPlace ./options.md \
|
||||||
--subst-var-by \
|
--subst-var-by \
|
||||||
OPTIONS_JSON \
|
OPTIONS_JSON \
|
||||||
${optionsJSON}/share/doc/nixos/options.json
|
${options.nvf}/share/doc/nixos/options.json
|
||||||
|
|
||||||
substituteInPlace ./manual.md \
|
substituteInPlace ./manual.md \
|
||||||
--subst-var-by \
|
--subst-var-by \
|
||||||
NVF_VERSION \
|
NVF_VERSION \
|
||||||
${release}
|
${revision}
|
||||||
|
|
||||||
# copy stylesheet
|
# copy stylesheet
|
||||||
cp ${./static/style.css} "$dest/style.css"
|
cp ${./static/style.css} out/style.css
|
||||||
|
|
||||||
# copy release notes
|
# copy release notes
|
||||||
cp -vr ${./release-notes} release-notes
|
cp -vr ${./release-notes} release-notes
|
||||||
|
|
||||||
# generate manual from
|
# generate manual from
|
||||||
nixos-render-docs manual html \
|
nixos-render-docs manual html \
|
||||||
--manpage-urls ${path + "/doc/manpage-urls.json"} \
|
--manpage-urls ${manpageUrls} \
|
||||||
--revision ${lib.trivial.revisionWithDefault release} \
|
--revision ${lib.trivial.revisionWithDefault revision} \
|
||||||
--stylesheet style.css \
|
--stylesheet style.css \
|
||||||
--script highlightjs/highlight.pack.js \
|
--script highlightjs/highlight.pack.js \
|
||||||
--script highlightjs/loader.js \
|
--script highlightjs/loader.js \
|
||||||
--toc-depth 2 \
|
--toc-depth 2 \
|
||||||
--section-toc-depth 1 \
|
--section-toc-depth 1 \
|
||||||
manual.md \
|
manual.md \
|
||||||
"$dest/index.xhtml"
|
out/index.xhtml
|
||||||
|
'';
|
||||||
|
|
||||||
mkdir -p $out/nix-support/
|
installPhase = ''
|
||||||
echo "doc manual $dest index.html" >> $out/nix-support/hydra-build-products
|
dest="$out/${outputPath}"
|
||||||
|
mkdir -p "$(dirname "$dest")"
|
||||||
|
mv out "$dest"
|
||||||
|
|
||||||
|
mkdir -p $out/nix-support/
|
||||||
|
echo "doc manual $dest index.html" >> $out/nix-support/hydra-build-products
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,5 +5,4 @@ configuring/custom-package.md
|
||||||
configuring/custom-plugins.md
|
configuring/custom-plugins.md
|
||||||
configuring/languages.md
|
configuring/languages.md
|
||||||
configuring/dags.md
|
configuring/dags.md
|
||||||
configuring/dag-entries.md
|
|
||||||
```
|
```
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# Custom Plugins {#ch-custom-plugins}
|
# Custom Plugins {#ch-custom-plugins}
|
||||||
|
|
||||||
**nvf**, by default, exposes a wide variety of plugins as module options
|
**nvf**, by default, exposes a wide variety of plugins as module options
|
||||||
for your convenience and bundles necessary dependencies into **nvf**'s runtime.
|
for your convience and bundles necessary dependencies into **nvf**'s runtime.
|
||||||
In case a plugin is not available in **nvf**, you may consider making a pull
|
In case a plugin is not available in **nvf**, you may consider making a pull
|
||||||
request to **nvf** to include it as a module or you may add it to your
|
request to **nvf** to include it as a module or you may add it to your
|
||||||
configuration locally.
|
configuration locally.
|
||||||
|
|
|
@ -1,38 +1,16 @@
|
||||||
# Configuring {#sec-configuring-plugins}
|
# Configuring {#sec-configuring-plugins}
|
||||||
|
|
||||||
Just making the plugin to your Neovim configuration available might not always
|
Just making the plugin to your Neovim configuration available might not always
|
||||||
be enough. In that case, you can write custom lua config using either
|
be enough. In that case, you can write custom vimscript or lua config, using
|
||||||
`config.vim.extraPlugins` (which has the `setup` field) or
|
either `config.vim.configRC` or `config.vim.luaConfigRC` respectively. Both of
|
||||||
`config.vim.luaConfigRC`. The first option uses an attribute set, which maps DAG
|
these options are attribute sets, and you need to give the configuration you're
|
||||||
section names to a custom type, which has the fields `package`, `after`,
|
adding some name, like this:
|
||||||
`setup`. They allow you to set the package of the plugin, the sections its setup
|
|
||||||
code should be after (note that the `extraPlugins` option has its own DAG
|
|
||||||
scope), and the its setup code respectively. For example:
|
|
||||||
|
|
||||||
```nix
|
|
||||||
config.vim.extraPlugins = with pkgs.vimPlugins; {
|
|
||||||
aerial = {
|
|
||||||
package = aerial-nvim;
|
|
||||||
setup = "require('aerial').setup {}";
|
|
||||||
};
|
|
||||||
|
|
||||||
harpoon = {
|
|
||||||
package = harpoon;
|
|
||||||
setup = "require('harpoon').setup {}";
|
|
||||||
after = ["aerial"]; # place harpoon configuration after aerial
|
|
||||||
};
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
The second option also uses an attribute set, but this one is resolved as a DAG
|
|
||||||
directly. The attribute names denote the section names, and the values lua code.
|
|
||||||
For example:
|
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
{
|
{
|
||||||
# this will create an "aquarium" section in your init.lua with the contents of your custom config
|
# this will create an "aquarium" section in your init.vim with the contents of your custom config
|
||||||
# which will be *appended* to the rest of your configuration, inside your init.vim
|
# which will be *appended* to the rest of your configuration, inside your init.vim
|
||||||
config.vim.luaConfigRC.aquarium = "vim.cmd('colorscheme aquiarum')";
|
config.vim.configRC.aquarium = "colorscheme aquiarum";
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -1,23 +0,0 @@
|
||||||
# DAG entries in nvf {#ch-dag-entries}
|
|
||||||
|
|
||||||
From the previous chapter, it should be clear that DAGs are useful, because you
|
|
||||||
can add code that relies on other code. However, if you don't know what the
|
|
||||||
entries are called, it's hard to do that, so here is a list of the internal
|
|
||||||
entries in nvf:
|
|
||||||
|
|
||||||
## `vim.luaConfigRC` (top-level DAG) {#ch-vim-luaconfigrc}
|
|
||||||
|
|
||||||
1. (`luaConfigPre`) - not a part of the actual DAG, instead, it's simply
|
|
||||||
inserted before the rest of the DAG
|
|
||||||
2. `globalsScript` - used to set globals defined in `vim.globals`
|
|
||||||
3. `basic` - used to set basic configuration options
|
|
||||||
4. `optionsScript` - used to set options defined in `vim.o`
|
|
||||||
5. `theme` (this is simply placed before `pluginConfigs`, meaning that
|
|
||||||
surrounding entries don't depend on it) - used to set up the theme, which has
|
|
||||||
to be done before other plugins
|
|
||||||
6. `pluginConfigs` - the result of the nested `vim.pluginRC` (internal option,
|
|
||||||
see the [Custom Plugins](/index.xhtml#ch-custom-plugins) page for adding your
|
|
||||||
own plugins) DAG, used to set up internal plugins
|
|
||||||
7. `extraPluginConfigs` - the result of `vim.extraPlugins`, which is not a
|
|
||||||
direct DAG, but is converted to, and resolved as one internally
|
|
||||||
8. `mappings` - the result of `vim.maps`
|
|
|
@ -6,8 +6,8 @@ addition for certain options is the [**DAG
|
||||||
type which is borrowed from home-manager's extended library. This type is most
|
type which is borrowed from home-manager's extended library. This type is most
|
||||||
used for topologically sorting strings. The DAG type allows the attribute set
|
used for topologically sorting strings. The DAG type allows the attribute set
|
||||||
entries to express dependency relations among themselves. This can, for
|
entries to express dependency relations among themselves. This can, for
|
||||||
example, be used to control the order of configuration sections in your
|
example, be used to control the order of configuration sections in your
|
||||||
`luaConfigRC`.
|
`configRC` or `luaConfigRC`.
|
||||||
|
|
||||||
The below section, mostly taken from the [home-manager
|
The below section, mostly taken from the [home-manager
|
||||||
manual](https://raw.githubusercontent.com/nix-community/home-manager/master/docs/manual/writing-modules/types.md)
|
manual](https://raw.githubusercontent.com/nix-community/home-manager/master/docs/manual/writing-modules/types.md)
|
||||||
|
|
|
@ -17,10 +17,6 @@ configuring.md
|
||||||
hacking.md
|
hacking.md
|
||||||
```
|
```
|
||||||
|
|
||||||
```{=include=} appendix html:into-file=//plugins.html
|
|
||||||
plugins.md
|
|
||||||
```
|
|
||||||
|
|
||||||
```{=include=} appendix html:into-file=//options.html
|
```{=include=} appendix html:into-file=//options.html
|
||||||
options.md
|
options.md
|
||||||
```
|
```
|
||||||
|
|
|
@ -1,16 +0,0 @@
|
||||||
# Plugin specific quirks {#ch-plugins}
|
|
||||||
|
|
||||||
At times, certain plugins refuse to play nicely. Be it as a result of generating
|
|
||||||
lua from Nix, or the state of packaging. This page shall list any plugins that
|
|
||||||
are known to misbehave, and potential workarounds.
|
|
||||||
|
|
||||||
```{=include=} chapters
|
|
||||||
plugins/nodejs.md
|
|
||||||
```
|
|
||||||
<!--
|
|
||||||
If adding a new section, uncomment this part and add your page to
|
|
||||||
plugins/<page>.md
|
|
||||||
```{=include=} chapters
|
|
||||||
plugins/page.md
|
|
||||||
```
|
|
||||||
-->
|
|
|
@ -1,18 +0,0 @@
|
||||||
# NodeJS {#ch-plugins-nodejs}
|
|
||||||
|
|
||||||
## eslint-plugin-prettier {#sec-eslint-plugin-prettier}
|
|
||||||
|
|
||||||
When working with NodeJS, everything works as expected, but some projects have settings that can fool nvf.
|
|
||||||
|
|
||||||
If [this plugin](https://github.com/prettier/eslint-plugin-prettier) or similar is included, you might get a situation where your eslint configuration diagnoses your formatting according to its own config (usually `.eslintrc.js`).
|
|
||||||
|
|
||||||
The issue there is your formatting is made via prettierd.
|
|
||||||
|
|
||||||
This results in auto-formating relying on your prettier config, while your eslint config diagnoses formatting [which it's not supposed to](https://prettier.io/docs/en/comparison.html))
|
|
||||||
|
|
||||||
In the end, you get discrepancies between what your editor does and what it wants.
|
|
||||||
|
|
||||||
Solutions are:
|
|
||||||
|
|
||||||
1. Don't add a formatting config to eslint, and separate prettier and eslint.
|
|
||||||
2. PR this repo to add an ESLint formatter and configure nvf to use it.
|
|
|
@ -5,6 +5,7 @@ Below are the commands you may run to try out different configurations provided
|
||||||
configurations are provided:
|
configurations are provided:
|
||||||
|
|
||||||
- Nix
|
- Nix
|
||||||
|
- Tidal
|
||||||
- Maximal
|
- Maximal
|
||||||
|
|
||||||
You may try out any of the provided configurations using the `nix run` command on a system where Nix is installed.
|
You may try out any of the provided configurations using the `nix run` command on a system where Nix is installed.
|
||||||
|
@ -21,6 +22,7 @@ once you garbage collect.
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ nix run github:notashelf/nvf#nix
|
$ nix run github:notashelf/nvf#nix
|
||||||
|
$ nix run github:notashelf/nvf#tidal
|
||||||
$ nix run github:notashelf/nvf#maximal
|
$ nix run github:notashelf/nvf#maximal
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -31,6 +33,10 @@ $ nix run github:notashelf/nvf#maximal
|
||||||
`Nix` configuration by default provides LSP/diagnostic support for Nix alongisde a set of visual and functional plugins.
|
`Nix` configuration by default provides LSP/diagnostic support for Nix alongisde a set of visual and functional plugins.
|
||||||
By running `nix run .#`, which is the default package, you will build Neovim with this config.
|
By running `nix run .#`, which is the default package, you will build Neovim with this config.
|
||||||
|
|
||||||
|
#### Tidal {#sec-configs-tidal}
|
||||||
|
|
||||||
|
Tidal is an alternative config that adds vim-tidal on top of the plugins from the Nix configuration.
|
||||||
|
|
||||||
#### Maximal {#sec-configs-maximal}
|
#### Maximal {#sec-configs-maximal}
|
||||||
|
|
||||||
`Maximal` is the ultimate configuration that will enable support for more commonly used language as well as additional
|
`Maximal` is the ultimate configuration that will enable support for more commonly used language as well as additional
|
||||||
|
|
|
@ -10,5 +10,4 @@ rl-0.3.md
|
||||||
rl-0.4.md
|
rl-0.4.md
|
||||||
rl-0.5.md
|
rl-0.5.md
|
||||||
rl-0.6.md
|
rl-0.6.md
|
||||||
rl-0.7.md
|
|
||||||
```
|
```
|
||||||
|
|
|
@ -83,7 +83,7 @@ Release notes for release 0.5
|
||||||
|
|
||||||
- Updated indent-blankine.nvim to v3 - this comes with a few option changes, which will be migrated with `renamedOptionModule`
|
- Updated indent-blankine.nvim to v3 - this comes with a few option changes, which will be migrated with `renamedOptionModule`
|
||||||
|
|
||||||
[jacekpoz](https://jacekpoz.pl):
|
[jacekpoz](https://github.com/jacekpoz):
|
||||||
|
|
||||||
- Fixed scrollOffset not being used
|
- Fixed scrollOffset not being used
|
||||||
|
|
||||||
|
|
|
@ -62,7 +62,7 @@ vim.api.nvim_set_keymap('n', '<leader>a', ':lua camelToSnake()<CR>', { noremap =
|
||||||
|
|
||||||
- Added rose-pine theme.
|
- Added rose-pine theme.
|
||||||
|
|
||||||
[jacekpoz](https://jacekpoz.pl):
|
[jacekpoz](https://github.com/jacekpoz):
|
||||||
|
|
||||||
- Added `vim.autocomplete.alwaysComplete`. Allows users to have the autocomplete window popup only when manually activated.
|
- Added `vim.autocomplete.alwaysComplete`. Allows users to have the autocomplete window popup only when manually activated.
|
||||||
|
|
||||||
|
|
|
@ -1,222 +0,0 @@
|
||||||
# Release 0.7 {#sec-release-0.7}
|
|
||||||
|
|
||||||
Release notes for release 0.7
|
|
||||||
|
|
||||||
## Breaking Changes and Migration Guide {#sec-breaking-changes-and-migration-guide-0-7}
|
|
||||||
|
|
||||||
### `vim.configRC` removed {#sec-vim-configrc-removed}
|
|
||||||
|
|
||||||
In v0.7 we are removing `vim.configRC` in favor of making `vim.luaConfigRC` the
|
|
||||||
top-level DAG, and thereby making the entire configuration Lua based. This
|
|
||||||
change introduces a few breaking changes:
|
|
||||||
|
|
||||||
[DAG entries in nvf manual]: /index.xhtml#ch-dag-entries
|
|
||||||
|
|
||||||
- `vim.configRC` has been removed, which means that you have to convert all of
|
|
||||||
your custom vimscript-based configuration to Lua. As for how to do that, you
|
|
||||||
will have to consult the Neovim documentation and your search engine.
|
|
||||||
- After migrating your Vimscript-based configuration to Lua, you might not be
|
|
||||||
able to use the same entry names in `vim.luaConfigRC`, because those have also
|
|
||||||
slightly changed. See the new [DAG entries in nvf manual] for more details.
|
|
||||||
|
|
||||||
**Why?**
|
|
||||||
|
|
||||||
Neovim being an aggressive refactor of Vim, is designed to be mainly Lua based;
|
|
||||||
making good use of its extensive Lua API. Additionally, Vimscript is slow and
|
|
||||||
brings unnecessary performance overhead while working with different
|
|
||||||
configuration formats.
|
|
||||||
|
|
||||||
### `vim.lsp.nvimCodeActionMenu` removed in favor of `vim.ui.fastaction` {#sec-nvim-code-action-menu-deprecation}
|
|
||||||
|
|
||||||
The nvim-code-action-menu plugin has been archived and broken for a long time,
|
|
||||||
so it's being replaced with a young, but better alternative called
|
|
||||||
fastaction.nvim. Simply remove everything set under
|
|
||||||
`vim.lsp.nvimCodeActionMenu`, and set `vim.ui.fastaction.enable` to `true`.
|
|
||||||
|
|
||||||
Note that we are looking to add more alternatives in the future like
|
|
||||||
dressing.nvim and actions-preview.nvim, in case fastaction doesn't work for
|
|
||||||
everyone.
|
|
||||||
|
|
||||||
## Changelog {#sec-release-0.7-changelog}
|
|
||||||
|
|
||||||
[ItsSorae](https://github.com/ItsSorae):
|
|
||||||
|
|
||||||
- Add support for [typst](https://typst.app/) under `vim.languages.typst` This
|
|
||||||
will enable the `typst-lsp` language server, and the `typstfmt` formatter
|
|
||||||
|
|
||||||
[frothymarrow](https://github.com/frothymarrow):
|
|
||||||
|
|
||||||
- Modified type for
|
|
||||||
[](#opt-vim.visuals.fidget-nvim.setupOpts.progress.display.overrides) from
|
|
||||||
`anything` to a `submodule` for better type checking.
|
|
||||||
|
|
||||||
- Fix null `vim.lsp.mappings` generating an error and not being filtered out.
|
|
||||||
|
|
||||||
- Add basic transparency support for `oxocarbon` theme by setting the highlight
|
|
||||||
group for `Normal`, `NormalFloat`, `LineNr`, `SignColumn` and optionally
|
|
||||||
`NvimTreeNormal` to `none`.
|
|
||||||
|
|
||||||
- Fix [](#opt-vim.ui.smartcolumn.setupOpts.custom_colorcolumn) using the wrong
|
|
||||||
type `int` instead of the expected type `string`.
|
|
||||||
|
|
||||||
[horriblename](https://github.com/horriblename):
|
|
||||||
|
|
||||||
- Fix broken treesitter-context keybinds in visual mode
|
|
||||||
- Deprecate use of `__empty` to define empty tables in Lua. Empty attrset are no
|
|
||||||
longer filtered and thus should be used instead.
|
|
||||||
- Add dap-go for better dap configurations
|
|
||||||
- Make noice.nvim customizable
|
|
||||||
- Standardize border style options and add custom borders
|
|
||||||
|
|
||||||
[rust-tools.nvim]: https://github.com/simrat39/rust-tools.nvim
|
|
||||||
[rustaceanvim]: https://github.com/mrcjkb/rustaceanvim
|
|
||||||
|
|
||||||
- Switch from [rust-tools.nvim] to the more feature-packed [rustaceanvim]. This
|
|
||||||
switch entails a whole bunch of new features and options, so you are
|
|
||||||
recommended to go through rustacean.nvim's README to take a closer look at its
|
|
||||||
features and usage
|
|
||||||
|
|
||||||
[jacekpoz](https://jacekpoz.pl):
|
|
||||||
|
|
||||||
[ocaml-lsp]: https://github.com/ocaml/ocaml-lsp
|
|
||||||
[new-file-template.nvim]: https://github.com/otavioschwanck/new-file-template.nvim
|
|
||||||
[neo-tree.nvim]: https://github.com/nvim-neo-tree/neo-tree.nvim
|
|
||||||
|
|
||||||
- Add [ocaml-lsp] support
|
|
||||||
|
|
||||||
- Fix "Emac" typo
|
|
||||||
|
|
||||||
- Add [new-file-template.nvim] to automatically fill new file contents using
|
|
||||||
templates
|
|
||||||
|
|
||||||
- Make [neo-tree.nvim] display file icons properly by enabling
|
|
||||||
`visuals.nvimWebDevicons`
|
|
||||||
|
|
||||||
[diniamo](https://github.com/diniamo):
|
|
||||||
|
|
||||||
- Move the `theme` dag entry to before `luaScript`.
|
|
||||||
|
|
||||||
- Add rustfmt as the default formatter for Rust.
|
|
||||||
|
|
||||||
- Enabled the terminal integration of catppuccin for theming Neovim's built-in
|
|
||||||
terminal (this also affects toggleterm).
|
|
||||||
|
|
||||||
- Migrate bufferline to setupOpts for more customizability
|
|
||||||
|
|
||||||
- Use `clangd` as the default language server for C languages
|
|
||||||
|
|
||||||
- Expose `lib.nvim.types.pluginType`, which for example allows the user to
|
|
||||||
create abstractions for adding plugins
|
|
||||||
|
|
||||||
- Migrate indent-blankline to setupOpts for more customizability. While the
|
|
||||||
plugin's options can now be found under `indentBlankline.setupOpts`, the
|
|
||||||
previous iteration of the module also included out of place/broken options,
|
|
||||||
which have been removed for the time being. These are:
|
|
||||||
|
|
||||||
- `listChar` - this was already unused
|
|
||||||
- `fillChar` - this had nothing to do with the plugin, please configure it
|
|
||||||
yourself by adding `vim.opt.listchars:append({ space = '<char>' })` to your
|
|
||||||
lua configuration
|
|
||||||
- `eolChar` - this also had nothing to do with the plugin, please configure it
|
|
||||||
yourself by adding `vim.opt.listchars:append({ eol = '<char>' })` to your
|
|
||||||
lua configuration
|
|
||||||
|
|
||||||
- Replace `vim.lsp.nvimCodeActionMenu` with `vim.ui.fastaction`, see the
|
|
||||||
breaking changes section above for more details
|
|
||||||
|
|
||||||
[Neovim documentation on `vim.cmd`]: https://neovim.io/doc/user/lua.html#vim.cmd()
|
|
||||||
|
|
||||||
- Make Neovim's configuration file entirely Lua based. This comes with a few
|
|
||||||
breaking changes:
|
|
||||||
- `vim.configRC` has been removed. You will need to migrate your entries to
|
|
||||||
Neovim-compliant Lua code, and add them to `vim.luaConfigRC` instead.
|
|
||||||
Existing vimscript configurations may be preserved in `vim.cmd` functions.
|
|
||||||
Please see [Neovim documentation on `vim.cmd`]
|
|
||||||
- `vim.luaScriptRC` is now the top-level DAG, and the internal `vim.pluginRC`
|
|
||||||
has been introduced for setting up internal plugins. See the "DAG entries in
|
|
||||||
nvf" manual page for more information.
|
|
||||||
|
|
||||||
[NotAShelf](https://github.com/notashelf):
|
|
||||||
|
|
||||||
[ts-error-translator.nvim]: https://github.com/dmmulroy/ts-error-translator.nvim
|
|
||||||
[credo]: https://github.com/rrrene/credo
|
|
||||||
|
|
||||||
- Add `deno fmt` as the default Markdown formatter. This will be enabled
|
|
||||||
automatically if you have autoformatting enabled, but can be disabled manually
|
|
||||||
if you choose to.
|
|
||||||
|
|
||||||
- Add `vim.extraLuaFiles` for optionally sourcing additional lua files in your
|
|
||||||
configuration.
|
|
||||||
|
|
||||||
- Refactor `programs.languages.elixir` to use lspconfig and none-ls for LSP and
|
|
||||||
formatter setups respectively. Diagnostics support is considered, and may be
|
|
||||||
added once the [credo] linter has been added to nixpkgs. A pull request is
|
|
||||||
currently open.
|
|
||||||
|
|
||||||
- Remove vim-tidal and friends.
|
|
||||||
|
|
||||||
- Clean up Lualine module to reduce theme dependency on Catppuccin, and fixed
|
|
||||||
blending issues in component separators.
|
|
||||||
|
|
||||||
- Add [ts-ereror-translator.nvim] extension of the TS language module, under
|
|
||||||
`vim.languages.ts.extensions.ts-error-translator` to aid with Typescript
|
|
||||||
development.
|
|
||||||
|
|
||||||
- Add [neo-tree.nvim] as an alternative file-tree plugin. It will be available
|
|
||||||
under `vim.filetree.neo-tree`, similar to nvimtree.
|
|
||||||
|
|
||||||
- Add `nvf-print-config` & `nvf-print-config-path` helper scripts to Neovim
|
|
||||||
closure. Both of those scripts have been automatically added to your PATH upon
|
|
||||||
using neovimConfig or `programs.nvf.enable`.
|
|
||||||
|
|
||||||
- `nvf-print-config` will display your `init.lua`, in full.
|
|
||||||
- `nvf-print-config-path` will display the path to _a clone_ of your
|
|
||||||
`init.lua`. This is not the path used by the Neovim wrapper, but an
|
|
||||||
identical clone.
|
|
||||||
|
|
||||||
- Add `vim.ui.breadcrumbs.lualine` to allow fine-tuning breadcrumbs behaviour on
|
|
||||||
Lualine. Only `vim.ui.breadcrumbs.lualine.winbar` is supported for the time
|
|
||||||
being.
|
|
||||||
|
|
||||||
- [](#opt-vim.ui.breadcrumbs.lualine.winbar.enable) has been added to allow
|
|
||||||
controlling the default behaviour of the `nvim-navic` component on Lualine,
|
|
||||||
which used to occupy `winbar.lualine_c` as long as breadcrumbs are enabled.
|
|
||||||
- `vim.ui.breadcrumbs.alwaysRender` has been renamed to
|
|
||||||
[](#opt-vim.ui.breadcrumbs.lualine.winbar.alwaysRender) to be conform to the
|
|
||||||
new format.
|
|
||||||
|
|
||||||
- Add [basedpyright](https://github.com/detachhead/basedpyright) as a Python LSP
|
|
||||||
server and make it default.
|
|
||||||
|
|
||||||
- Add [python-lsp-server](https://github.com/python-lsp/python-lsp-server) as an
|
|
||||||
additional Python LSP server.
|
|
||||||
|
|
||||||
- Add [](#opt-vim.options) to set `vim.o` values in in your nvf configuration
|
|
||||||
without using additional Lua. See option documentation for more details.
|
|
||||||
|
|
||||||
- Add [](#opt-vim.dashboard.dashboard-nvim.setupOpts) to allow user
|
|
||||||
configuration for [dashboard.nvim](https://github.com/nvimdev/dashboard-nvim)
|
|
||||||
|
|
||||||
- Update `lualine.nvim` input and add missing themes:
|
|
||||||
- Adds `ayu`, `gruvbox_dark`, `iceberg`, `moonfly`, `onedark`,
|
|
||||||
`powerline_dark` and `solarized_light` themes.
|
|
||||||
|
|
||||||
[ppenguin](https://github.com/ppenguin):
|
|
||||||
|
|
||||||
- Telescope:
|
|
||||||
- Fixed `project-nvim` command and keybinding
|
|
||||||
- Added default ikeybind/command for `Telescope resume` (`<leader>fr`)
|
|
||||||
|
|
||||||
[Soliprem](https://github.com/Soliprem):
|
|
||||||
|
|
||||||
- Add LSP and Treesitter support for R under `vim.languages.R`.
|
|
||||||
- Add Otter support under `vim.lsp.otter` and an assert to prevent conflict with
|
|
||||||
ccc
|
|
||||||
|
|
||||||
[Bloxx12](https://github.com/Bloxx12):
|
|
||||||
|
|
||||||
- Fix internal breakage in `elixir-tools` setup.
|
|
||||||
|
|
||||||
[Nowaaru](https://github.com/Nowaaru):
|
|
||||||
|
|
||||||
- Add `precognition-nvim`.
|
|
751
flake.lock
751
flake.lock
File diff suppressed because it is too large
Load diff
140
flake.nix
140
flake.nix
|
@ -1,22 +1,19 @@
|
||||||
{
|
{
|
||||||
description = "A neovim flake with a modular configuration";
|
description = "A neovim flake with a modular configuration";
|
||||||
outputs = {
|
outputs = {
|
||||||
|
nixpkgs,
|
||||||
flake-parts,
|
flake-parts,
|
||||||
self,
|
self,
|
||||||
...
|
...
|
||||||
} @ inputs: let
|
} @ inputs:
|
||||||
# call the extedended library with `inputs`
|
flake-parts.lib.mkFlake {inherit inputs;} {
|
||||||
# inputs is used to get the original standard library, and to pass inputs to the plugin autodiscovery function
|
# provide overridable systems
|
||||||
lib = import ./lib/stdlib-extended.nix inputs;
|
# https://github.com/nix-systems/nix-systems
|
||||||
in
|
|
||||||
flake-parts.lib.mkFlake {
|
|
||||||
inherit inputs;
|
|
||||||
specialArgs = {inherit lib;};
|
|
||||||
} {
|
|
||||||
# Allow users to bring their own systems.
|
|
||||||
# «https://github.com/nix-systems/nix-systems»
|
|
||||||
systems = import inputs.systems;
|
systems = import inputs.systems;
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
|
# add lib to module args
|
||||||
|
{_module.args = {inherit (nixpkgs) lib;};}
|
||||||
./flake/apps.nix
|
./flake/apps.nix
|
||||||
./flake/legacyPackages.nix
|
./flake/legacyPackages.nix
|
||||||
./flake/overlays.nix
|
./flake/overlays.nix
|
||||||
|
@ -25,32 +22,36 @@
|
||||||
|
|
||||||
flake = {
|
flake = {
|
||||||
lib = {
|
lib = {
|
||||||
inherit (lib) nvim;
|
inherit (import ./lib/stdlib-extended.nix nixpkgs.lib inputs) nvim;
|
||||||
inherit (lib.nvim) neovimConfiguration;
|
inherit (import ./configuration.nix inputs) neovimConfiguration;
|
||||||
};
|
};
|
||||||
|
|
||||||
homeManagerModules = {
|
homeManagerModules = {
|
||||||
neovim-flake =
|
neovim-flake =
|
||||||
lib.warn ''
|
nixpkgs.lib.warn ''
|
||||||
homeManagerModules.neovim-flake has been deprecated.
|
homeManagerModules.neovim-flake has been deprecated.
|
||||||
Plese use the homeManagerModules.nvf instead
|
Plese use the homeManagereModules.nvf instead
|
||||||
''
|
''
|
||||||
self.homeManagerModules.nvf;
|
self.homeManagerModules.nvf;
|
||||||
|
|
||||||
nvf = import ./flake/modules/home-manager.nix self.packages lib;
|
nvf = {
|
||||||
|
imports = [(import ./flake/modules/home-manager.nix self.packages inputs)];
|
||||||
|
};
|
||||||
|
|
||||||
default = self.homeManagerModules.nvf;
|
default = self.homeManagerModules.nvf;
|
||||||
};
|
};
|
||||||
|
|
||||||
nixosModules = {
|
nixosModules = {
|
||||||
neovim-flake =
|
neovim-flake =
|
||||||
lib.warn ''
|
nixpkgs.lib.warn ''
|
||||||
nixosModules.neovim-flake has been deprecated.
|
nixosModules.neovim-flake has been deprecated.
|
||||||
Please use the nixosModules.nvf instead
|
Please use the nixosModules.nvf instead
|
||||||
''
|
''
|
||||||
self.nixosModules.nvf;
|
self.nixosModules.neovim-flake;
|
||||||
|
|
||||||
nvf = import ./flake/modules/nixos.nix self.packages lib;
|
nvf = {
|
||||||
|
imports = [(import ./flake/modules/nixos.nix self.packages inputs)];
|
||||||
|
};
|
||||||
|
|
||||||
default = self.nixosModules.nvf;
|
default = self.nixosModules.nvf;
|
||||||
};
|
};
|
||||||
|
@ -62,49 +63,34 @@
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
|
formatter = pkgs.alejandra;
|
||||||
devShells = {
|
devShells = {
|
||||||
default = self'.devShells.lsp;
|
default = self'.devShells.lsp;
|
||||||
nvim-nix = pkgs.mkShell {packages = [config.packages.nix];};
|
nvim-nix = pkgs.mkShell {nativeBuildInputs = [config.packages.nix];};
|
||||||
lsp = pkgs.mkShell {
|
lsp = pkgs.mkShell {
|
||||||
packages = with pkgs; [nil statix deadnix alejandra];
|
nativeBuildInputs = with pkgs; [nil statix deadnix alejandra];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# Provide the default formatter. `nix fmt` in project root
|
|
||||||
# will format available files with the correct formatter.
|
|
||||||
# P.S: Please do not format with nixfmt! It messes with many
|
|
||||||
# syntax elements and results in unreadable code.
|
|
||||||
formatter = pkgs.alejandra;
|
|
||||||
|
|
||||||
# Check if codebase is properly formatted.
|
|
||||||
# This can be initiated with `nix build .#checks.<system>.nix-fmt`
|
|
||||||
# or with `nix flake check`
|
|
||||||
checks = {
|
|
||||||
nix-fmt = pkgs.runCommand "nix-fmt-check" {nativeBuildInputs = [pkgs.alejandra];} ''
|
|
||||||
alejandra --check ${self} < /dev/null | tee $out
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# Flake inputs
|
# Flake inputs
|
||||||
inputs = {
|
inputs = {
|
||||||
## Basic Inputs
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
|
||||||
flake-parts.url = "github:hercules-ci/flake-parts";
|
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||||
flake-utils.url = "github:numtide/flake-utils";
|
flake-utils.url = "github:numtide/flake-utils";
|
||||||
systems.url = "github:nix-systems/default";
|
systems.url = "github:nix-systems/default";
|
||||||
|
|
||||||
# Alternate neovim-wrapper
|
|
||||||
mnw.url = "github:Gerg-L/mnw";
|
|
||||||
|
|
||||||
# For generating documentation website
|
# For generating documentation website
|
||||||
nmd = {
|
nmd = {
|
||||||
url = "sourcehut:~rycee/nmd";
|
url = "sourcehut:~rycee/nmd";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Language servers (use master instead of nixpkgs)
|
# TODO: get zig from the zig overlay instead of nixpkgs
|
||||||
|
zig.url = "github:mitchellh/zig-overlay";
|
||||||
|
|
||||||
|
# Langauge server (use master instead of nixpkgs)
|
||||||
rnix-lsp.url = "github:nix-community/rnix-lsp";
|
rnix-lsp.url = "github:nix-community/rnix-lsp";
|
||||||
nil = {
|
nil = {
|
||||||
url = "github:oxalica/nil";
|
url = "github:oxalica/nil";
|
||||||
|
@ -112,7 +98,13 @@
|
||||||
inputs.flake-utils.follows = "flake-utils";
|
inputs.flake-utils.follows = "flake-utils";
|
||||||
};
|
};
|
||||||
|
|
||||||
## Plugins
|
### Plugins
|
||||||
|
# Tidal cycles
|
||||||
|
tidalcycles = {
|
||||||
|
url = "github:mitchmindtree/tidalcycles.nix";
|
||||||
|
inputs.vim-tidal-src.url = "github:tidalcycles/vim-tidal";
|
||||||
|
};
|
||||||
|
|
||||||
# LSP plugins
|
# LSP plugins
|
||||||
plugin-nvim-lspconfig = {
|
plugin-nvim-lspconfig = {
|
||||||
url = "github:neovim/nvim-lspconfig";
|
url = "github:neovim/nvim-lspconfig";
|
||||||
|
@ -144,8 +136,8 @@
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
plugin-fastaction-nvim = {
|
plugin-nvim-code-action-menu = {
|
||||||
url = "github:Chaitanyabsprip/fastaction.nvim";
|
url = "github:weilbith/nvim-code-action-menu";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -170,19 +162,14 @@
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
plugin-otter-nvim = {
|
# language support
|
||||||
url = "github:jmbuhr/otter.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Language support
|
|
||||||
plugin-sqls-nvim = {
|
plugin-sqls-nvim = {
|
||||||
url = "github:nanotee/sqls.nvim";
|
url = "github:nanotee/sqls.nvim";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
plugin-rustaceanvim = {
|
plugin-rust-tools = {
|
||||||
url = "github:mrcjkb/rustaceanvim";
|
url = "github:simrat39/rust-tools.nvim";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -196,13 +183,23 @@
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
plugin-elixir-ls = {
|
||||||
|
url = "github:elixir-lsp/elixir-ls";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
|
||||||
plugin-elixir-tools = {
|
plugin-elixir-tools = {
|
||||||
url = "github:elixir-tools/elixir-tools.nvim";
|
url = "github:elixir-tools/elixir-tools.nvim";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
plugin-ts-error-translator = {
|
plugin-glow-nvim = {
|
||||||
url = "github:dmmulroy/ts-error-translator.nvim";
|
url = "github:ellisonleao/glow.nvim";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
plugin-image-nvim = {
|
||||||
|
url = "github:3rd/image.nvim";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -234,22 +231,12 @@
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
plugin-nvim-dap-go = {
|
|
||||||
url = "github:leoluz/nvim-dap-go";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Filetrees
|
# Filetrees
|
||||||
plugin-nvim-tree-lua = {
|
plugin-nvim-tree-lua = {
|
||||||
url = "github:nvim-tree/nvim-tree.lua";
|
url = "github:nvim-tree/nvim-tree.lua";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
plugin-neo-tree-nvim = {
|
|
||||||
url = "github:nvim-neo-tree/neo-tree.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Tablines
|
# Tablines
|
||||||
plugin-nvim-bufferline-lua = {
|
plugin-nvim-bufferline-lua = {
|
||||||
url = "github:akinsho/nvim-bufferline.lua";
|
url = "github:akinsho/nvim-bufferline.lua";
|
||||||
|
@ -515,21 +502,6 @@
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
plugin-glow-nvim = {
|
|
||||||
url = "github:ellisonleao/glow.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-image-nvim = {
|
|
||||||
url = "github:3rd/image.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-precognition-nvim = {
|
|
||||||
url = "github:tris203/precognition.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Note-taking
|
# Note-taking
|
||||||
plugin-obsidian-nvim = {
|
plugin-obsidian-nvim = {
|
||||||
url = "github:epwalsh/obsidian.nvim";
|
url = "github:epwalsh/obsidian.nvim";
|
||||||
|
@ -649,15 +621,9 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
plugin-nvim-nio = {
|
plugin-nvim-nio = {
|
||||||
# (required by nvim-dap-ui)
|
# (required nvim-dap-ui)
|
||||||
url = "github:nvim-neotest/nvim-nio";
|
url = "github:nvim-neotest/nvim-nio";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
plugin-new-file-template-nvim = {
|
|
||||||
# (required by new-file-template.nvim)
|
|
||||||
url = "github:otavioschwanck/new-file-template.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,21 @@
|
||||||
{lib, ...}: let
|
{lib, ...}: {
|
||||||
inherit (lib.meta) getExe;
|
perSystem = {
|
||||||
in {
|
system,
|
||||||
perSystem = {config, ...}: {
|
config,
|
||||||
apps = {
|
...
|
||||||
nix.program = getExe config.packages.nix;
|
}: {
|
||||||
maximal.program = getExe config.packages.maximal;
|
apps =
|
||||||
default = config.apps.nix;
|
{
|
||||||
};
|
nix.program = lib.getExe config.packages.nix;
|
||||||
|
maximal.program = lib.getExe config.packages.maximal;
|
||||||
|
default = config.apps.nix;
|
||||||
|
}
|
||||||
|
// (
|
||||||
|
if !(builtins.elem system ["aarch64-darwin" "x86_64-darwin"])
|
||||||
|
then {
|
||||||
|
tidal.program = lib.getExe config.packages.tidal;
|
||||||
|
}
|
||||||
|
else {}
|
||||||
|
);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
legacyPackages = import inputs.nixpkgs {
|
legacyPackages = import inputs.nixpkgs {
|
||||||
inherit system;
|
inherit system;
|
||||||
overlays = [
|
overlays = [
|
||||||
|
inputs.tidalcycles.overlays.default
|
||||||
inputs.self.overlays.default
|
inputs.self.overlays.default
|
||||||
(_: _: {
|
(_: _: {
|
||||||
rnix-lsp = inputs'.rnix-lsp.defaultPackage;
|
rnix-lsp = inputs'.rnix-lsp.defaultPackage;
|
||||||
|
|
|
@ -1,44 +1,40 @@
|
||||||
# Home Manager module
|
# Home Manager module
|
||||||
packages: lib: {
|
packages: inputs: {
|
||||||
config,
|
config,
|
||||||
pkgs,
|
pkgs,
|
||||||
|
lib ? pkgs.lib,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib) maintainers;
|
inherit (lib) maintainers;
|
||||||
inherit (lib.modules) mkIf mkAliasOptionModule;
|
inherit (lib.modules) mkIf;
|
||||||
inherit (lib.lists) optional;
|
inherit (lib.lists) optional;
|
||||||
inherit (lib.options) mkOption mkEnableOption literalExpression;
|
inherit (lib.options) mkOption mkEnableOption literalExpression;
|
||||||
inherit (lib.types) attrsOf anything bool;
|
inherit (lib.types) attrsOf anything bool;
|
||||||
inherit (lib.nvim) neovimConfiguration;
|
|
||||||
inherit (lib.nvim.types) anythingConcatLists;
|
|
||||||
|
|
||||||
cfg = config.programs.nvf;
|
cfg = config.programs.neovim-flake;
|
||||||
|
inherit (import ../../configuration.nix inputs) neovimConfiguration;
|
||||||
|
|
||||||
neovimConfigured = neovimConfiguration {
|
neovimConfigured = neovimConfiguration {
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
modules = [cfg.settings];
|
modules = [cfg.settings];
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
imports = [
|
|
||||||
(mkAliasOptionModule ["programs" "neovim-flake"] ["programs" "nvf"])
|
|
||||||
];
|
|
||||||
|
|
||||||
meta.maintainers = with maintainers; [NotAShelf];
|
meta.maintainers = with maintainers; [NotAShelf];
|
||||||
|
|
||||||
options.programs.nvf = {
|
options.programs.neovim-flake = {
|
||||||
enable = mkEnableOption "nvf, the extensible neovim configuration wrapper";
|
enable = mkEnableOption "neovim-flake, the extensible neovim configuration wrapper";
|
||||||
|
|
||||||
enableManpages = mkOption {
|
enableManpages = mkOption {
|
||||||
type = bool;
|
type = bool;
|
||||||
default = false;
|
default = false;
|
||||||
description = "Whether to enable manpages for nvf.";
|
description = "Whether to enable manpages for neovim-flake.";
|
||||||
};
|
};
|
||||||
|
|
||||||
defaultEditor = mkOption {
|
defaultEditor = mkOption {
|
||||||
type = bool;
|
type = bool;
|
||||||
default = false;
|
default = false;
|
||||||
description = ''
|
description = ''
|
||||||
Whether to set `nvf` as the default editor.
|
Whether to set `neovim-flake` as the default editor.
|
||||||
|
|
||||||
This will set the `EDITOR` environment variable as `nvim`
|
This will set the `EDITOR` environment variable as `nvim`
|
||||||
if set to true.
|
if set to true.
|
||||||
|
@ -50,14 +46,14 @@ in {
|
||||||
visible = false;
|
visible = false;
|
||||||
readOnly = true;
|
readOnly = true;
|
||||||
description = ''
|
description = ''
|
||||||
The built nvf package, wrapped with the user's configuration.
|
The built neovim-flake package, wrapped with the user's configuration.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
settings = mkOption {
|
settings = mkOption {
|
||||||
type = attrsOf anythingConcatLists;
|
type = attrsOf anything;
|
||||||
default = {};
|
default = {};
|
||||||
description = "Attribute set of nvf preferences.";
|
description = "Attribute set of neovim-flake preferences.";
|
||||||
example = literalExpression ''
|
example = literalExpression ''
|
||||||
{
|
{
|
||||||
vim.viAlias = false;
|
vim.viAlias = false;
|
||||||
|
@ -67,6 +63,7 @@ in {
|
||||||
formatOnSave = true;
|
formatOnSave = true;
|
||||||
lightbulb.enable = true;
|
lightbulb.enable = true;
|
||||||
lspsaga.enable = false;
|
lspsaga.enable = false;
|
||||||
|
nvimCodeActionMenu.enable = true;
|
||||||
trouble.enable = true;
|
trouble.enable = true;
|
||||||
lspSignature.enable = true;
|
lspSignature.enable = true;
|
||||||
rust.enable = false;
|
rust.enable = false;
|
||||||
|
@ -78,7 +75,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
programs.nvf.finalPackage = neovimConfigured.neovim;
|
programs.neovim-flake.finalPackage = neovimConfigured.neovim;
|
||||||
|
|
||||||
home = {
|
home = {
|
||||||
sessionVariables = mkIf cfg.defaultEditor {EDITOR = "nvim";};
|
sessionVariables = mkIf cfg.defaultEditor {EDITOR = "nvim";};
|
||||||
|
@ -87,5 +84,4 @@ in {
|
||||||
++ optional cfg.enableManpages packages.${pkgs.stdenv.system}.docs-manpages;
|
++ optional cfg.enableManpages packages.${pkgs.stdenv.system}.docs-manpages;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
_file = ./home-manager.nix;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,44 +1,40 @@
|
||||||
# NixOS module
|
# NixOS module
|
||||||
packages: lib: {
|
packages: inputs: {
|
||||||
config,
|
config,
|
||||||
pkgs,
|
pkgs,
|
||||||
|
lib ? pkgs.lib,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib) maintainers;
|
inherit (lib) maintainers;
|
||||||
inherit (lib.modules) mkIf mkOverride mkAliasOptionModule;
|
inherit (lib.modules) mkIf mkOverride;
|
||||||
inherit (lib.lists) optional;
|
inherit (lib.lists) optional;
|
||||||
inherit (lib.options) mkOption mkEnableOption literalExpression;
|
inherit (lib.options) mkOption mkEnableOption literalExpression;
|
||||||
inherit (lib.types) attrsOf anything bool;
|
inherit (lib.types) attrsOf anything bool;
|
||||||
inherit (lib.nvim) neovimConfiguration;
|
|
||||||
inherit (lib.nvim.types) anythingConcatLists;
|
|
||||||
|
|
||||||
cfg = config.programs.nvf;
|
cfg = config.programs.neovim-flake;
|
||||||
|
inherit (import ../../configuration.nix inputs) neovimConfiguration;
|
||||||
|
|
||||||
neovimConfigured = neovimConfiguration {
|
neovimConfigured = neovimConfiguration {
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
modules = [cfg.settings];
|
modules = [cfg.settings];
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
imports = [
|
|
||||||
(mkAliasOptionModule ["programs" "neovim-flake"] ["programs" "nvf"])
|
|
||||||
];
|
|
||||||
|
|
||||||
meta.maintainers = with maintainers; [NotAShelf];
|
meta.maintainers = with maintainers; [NotAShelf];
|
||||||
|
|
||||||
options.programs.nvf = {
|
options.programs.neovim-flake = {
|
||||||
enable = mkEnableOption "nvf, the extensible neovim configuration wrapper";
|
enable = mkEnableOption "neovim-flake, the extensible neovim configuration wrapper";
|
||||||
|
|
||||||
enableManpages = mkOption {
|
enableManpages = mkOption {
|
||||||
type = bool;
|
type = bool;
|
||||||
default = false;
|
default = false;
|
||||||
description = "Whether to enable manpages for nvf.";
|
description = "Whether to enable manpages for neovim-flake.";
|
||||||
};
|
};
|
||||||
|
|
||||||
defaultEditor = mkOption {
|
defaultEditor = mkOption {
|
||||||
type = bool;
|
type = bool;
|
||||||
default = false;
|
default = false;
|
||||||
description = ''
|
description = ''
|
||||||
Whether to set `nvf` as the default editor.
|
Whether to set `neovim-flake` as the default editor.
|
||||||
|
|
||||||
This will set the `EDITOR` environment variable as `nvim`
|
This will set the `EDITOR` environment variable as `nvim`
|
||||||
if set to true.
|
if set to true.
|
||||||
|
@ -50,14 +46,14 @@ in {
|
||||||
visible = false;
|
visible = false;
|
||||||
readOnly = true;
|
readOnly = true;
|
||||||
description = ''
|
description = ''
|
||||||
The built nvf package, wrapped with the user's configuration.
|
The built neovim-flake package, wrapped with the user's configuration.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
settings = mkOption {
|
settings = mkOption {
|
||||||
type = attrsOf anythingConcatLists;
|
type = attrsOf anything;
|
||||||
default = {};
|
default = {};
|
||||||
description = "Attribute set of nvf preferences.";
|
description = "Attribute set of neovim-flake preferences.";
|
||||||
example = literalExpression ''
|
example = literalExpression ''
|
||||||
{
|
{
|
||||||
vim.viAlias = false;
|
vim.viAlias = false;
|
||||||
|
@ -67,6 +63,7 @@ in {
|
||||||
formatOnSave = true;
|
formatOnSave = true;
|
||||||
lightbulb.enable = true;
|
lightbulb.enable = true;
|
||||||
lspsaga.enable = false;
|
lspsaga.enable = false;
|
||||||
|
nvimCodeActionMenu.enable = true;
|
||||||
trouble.enable = true;
|
trouble.enable = true;
|
||||||
lspSignature.enable = true;
|
lspSignature.enable = true;
|
||||||
rust.enable = false;
|
rust.enable = false;
|
||||||
|
@ -78,7 +75,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
programs.nvf.finalPackage = neovimConfigured.neovim;
|
programs.neovim-flake.finalPackage = neovimConfigured.neovim;
|
||||||
|
|
||||||
environment = {
|
environment = {
|
||||||
variables.EDITOR = mkIf cfg.defaultEditor (mkOverride 900 "nvim");
|
variables.EDITOR = mkIf cfg.defaultEditor (mkOverride 900 "nvim");
|
||||||
|
@ -87,5 +84,4 @@ in {
|
||||||
++ optional cfg.enableManpages packages.${pkgs.stdenv.system}.docs-manpages;
|
++ optional cfg.enableManpages packages.${pkgs.stdenv.system}.docs-manpages;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
_file = ./nixos.nix;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,19 +1,21 @@
|
||||||
{
|
{
|
||||||
|
inputs,
|
||||||
pkgs,
|
pkgs,
|
||||||
lib,
|
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.nvim) neovimConfiguration;
|
inherit (import ../configuration.nix inputs) neovimConfiguration mainConfig;
|
||||||
|
|
||||||
buildPkg = pkgs: modules: (neovimConfiguration {inherit pkgs modules;}).neovim;
|
buildPkg = pkgs: modules: (neovimConfiguration {inherit pkgs modules;}).neovim;
|
||||||
|
|
||||||
nixConfig = import ../configuration.nix false;
|
nixConfig = mainConfig false;
|
||||||
maximalConfig = import ../configuration.nix true;
|
maximalConfig = mainConfig true;
|
||||||
|
tidalConfig = {config.vim.tidal.enable = true;};
|
||||||
in {
|
in {
|
||||||
flake.overlays.default = _final: prev: {
|
flake.overlays.default = _final: prev: {
|
||||||
inherit neovimConfiguration;
|
inherit neovimConfiguration;
|
||||||
neovim-nix = buildPkg prev [nixConfig];
|
neovim-nix = buildPkg prev [nixConfig];
|
||||||
neovim-maximal = buildPkg prev [maximalConfig];
|
neovim-maximal = buildPkg prev [maximalConfig];
|
||||||
|
neovim-tidal = buildPkg prev [tidalConfig];
|
||||||
devPkg = buildPkg pkgs [nixConfig {config.vim.languages.html.enable = pkgs.lib.mkForce true;}];
|
devPkg = buildPkg pkgs [nixConfig {config.vim.languages.html.enable = pkgs.lib.mkForce true;}];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,57 +1,62 @@
|
||||||
{inputs, ...}: {
|
{inputs, ...}: {
|
||||||
perSystem = {
|
perSystem = {
|
||||||
|
system,
|
||||||
config,
|
config,
|
||||||
pkgs,
|
pkgs,
|
||||||
lib,
|
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
docs = import ../docs {inherit pkgs inputs lib;};
|
docs = import ../docs {inherit pkgs inputs;};
|
||||||
in {
|
in {
|
||||||
packages = {
|
packages =
|
||||||
inherit (docs.manual) htmlOpenTool;
|
{
|
||||||
# Documentation
|
# Documentation
|
||||||
docs = docs.manual.html;
|
docs = docs.manual.html;
|
||||||
docs-html = docs.manual.html;
|
docs-html = docs.manual.html;
|
||||||
docs-manpages = docs.manPages;
|
docs-manpages = docs.manPages;
|
||||||
docs-json = docs.options.json;
|
docs-json = docs.options.json;
|
||||||
|
|
||||||
# Build and open the built manual in your system browser
|
# Build and open the built manual in your system browser
|
||||||
docs-html-wrapped = pkgs.writeScriptBin "docs-html-wrapped" ''
|
docs-html-wrapped = pkgs.writeScriptBin "docs-html-wrapped" ''
|
||||||
#!${pkgs.stdenv.shell}
|
#!${pkgs.stdenv.shell}
|
||||||
# use xdg-open to open the docs in the browser
|
# use xdg-open to open the docs in the browser
|
||||||
${pkgs.xdg_utils}/bin/xdg-open ${docs.manual.html}
|
${pkgs.xdg_utils}/bin/xdg-open ${docs.manual.html}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# Exposed neovim configurations
|
# Exposed neovim configurations
|
||||||
nix = config.legacyPackages.neovim-nix;
|
nix = config.legacyPackages.neovim-nix;
|
||||||
maximal = config.legacyPackages.neovim-maximal;
|
maximal = config.legacyPackages.neovim-maximal;
|
||||||
default = config.legacyPackages.neovim-nix;
|
default = config.legacyPackages.neovim-nix;
|
||||||
|
|
||||||
# Published docker images
|
# Published docker images
|
||||||
docker-nix = let
|
docker-nix = let
|
||||||
inherit (pkgs) bash gitFull buildEnv dockerTools;
|
inherit (pkgs) bash gitFull buildEnv dockerTools;
|
||||||
inherit (config.legacyPackages) neovim-nix;
|
inherit (config.legacyPackages) neovim-nix;
|
||||||
in
|
in
|
||||||
dockerTools.buildImage {
|
dockerTools.buildImage {
|
||||||
name = "nvf";
|
name = "nvf";
|
||||||
tag = "latest";
|
tag = "latest";
|
||||||
|
|
||||||
copyToRoot = buildEnv {
|
copyToRoot = buildEnv {
|
||||||
name = "neovim-root";
|
name = "neovim-root";
|
||||||
pathsToLink = ["/bin"];
|
pathsToLink = ["/bin"];
|
||||||
paths = [
|
paths = [
|
||||||
neovim-nix
|
neovim-nix
|
||||||
gitFull
|
gitFull
|
||||||
bash
|
bash
|
||||||
];
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
config = {
|
||||||
|
Cmd = ["${neovim-nix}/bin/nvim"];
|
||||||
|
WorkingDir = "/home/neovim/demo";
|
||||||
|
Volumes = {"/home/neovim/demo" = {};};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
}
|
||||||
config = {
|
// (
|
||||||
Cmd = ["${neovim-nix}/bin/nvim"];
|
if !(builtins.elem system ["aarch64-darwin" "x86_64-darwin"])
|
||||||
WorkingDir = "/home/neovim/demo";
|
then {tidal = config.legacyPackages.neovim-tidal;}
|
||||||
Volumes = {"/home/neovim/demo" = {};};
|
else {}
|
||||||
};
|
);
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,7 +66,7 @@
|
||||||
mkSetLuaBinding = binding: action:
|
mkSetLuaBinding = binding: action:
|
||||||
mkLuaBinding binding.value action binding.description;
|
mkLuaBinding binding.value action binding.description;
|
||||||
|
|
||||||
pushDownDefault = attr: mapAttrs (_: mkDefault) attr;
|
pushDownDefault = attr: mapAttrs (_: value: mkDefault value) attr;
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
binds
|
binds
|
||||||
|
|
29
lib/dag.nix
29
lib/dag.nix
|
@ -8,10 +8,10 @@
|
||||||
# - the addition of the function `entryBefore` indicating a "wanted
|
# - the addition of the function `entryBefore` indicating a "wanted
|
||||||
# by" relationship.
|
# by" relationship.
|
||||||
{lib}: let
|
{lib}: let
|
||||||
inherit (builtins) isAttrs attrValues attrNames elem all head tail length toJSON isString;
|
inherit (builtins) isAttrs attrValues attrNames elem all head tail length;
|
||||||
inherit (lib.attrsets) filterAttrs mapAttrs;
|
inherit (lib.attrsets) filterAttrs mapAttrs;
|
||||||
inherit (lib.lists) toposort;
|
inherit (lib.lists) toposort;
|
||||||
inherit (lib.nvim.dag) empty isEntry entryBetween entryAfter entriesBetween entryAnywhere topoSort;
|
inherit (lib.nvim.dag) empty isEntry entryBetween entryAfter entriesBetween;
|
||||||
in {
|
in {
|
||||||
empty = {};
|
empty = {};
|
||||||
|
|
||||||
|
@ -84,7 +84,7 @@ in {
|
||||||
normalizedDag =
|
normalizedDag =
|
||||||
mapAttrs (n: v: {
|
mapAttrs (n: v: {
|
||||||
name = n;
|
name = n;
|
||||||
inherit (v) data;
|
data = v.data;
|
||||||
after = v.after ++ dagBefore dag n;
|
after = v.after ++ dagBefore dag n;
|
||||||
})
|
})
|
||||||
dag;
|
dag;
|
||||||
|
@ -117,6 +117,7 @@ in {
|
||||||
entriesBetween = tag: let
|
entriesBetween = tag: let
|
||||||
go = i: before: after: entries: let
|
go = i: before: after: entries: let
|
||||||
name = "${tag}-${toString i}";
|
name = "${tag}-${toString i}";
|
||||||
|
i' = i + 1;
|
||||||
in
|
in
|
||||||
if entries == []
|
if entries == []
|
||||||
then empty
|
then empty
|
||||||
|
@ -147,22 +148,8 @@ in {
|
||||||
${section.data}
|
${section.data}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
resolveDag = {
|
mkVimrcSection = section: ''
|
||||||
name,
|
" SECTION: ${section.name}
|
||||||
dag,
|
${section.data}
|
||||||
mapResult,
|
'';
|
||||||
}: let
|
|
||||||
# When the value is a string, default it to dag.entryAnywhere
|
|
||||||
finalDag = mapAttrs (_: value:
|
|
||||||
if isString value
|
|
||||||
then entryAnywhere value
|
|
||||||
else value)
|
|
||||||
dag;
|
|
||||||
sortedDag = topoSort finalDag;
|
|
||||||
result =
|
|
||||||
if sortedDag ? result
|
|
||||||
then mapResult sortedDag.result
|
|
||||||
else abort ("Dependency cycle in ${name}: " + toJSON sortedDag);
|
|
||||||
in
|
|
||||||
result;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,5 +11,5 @@
|
||||||
languages = import ./languages.nix {inherit lib;};
|
languages = import ./languages.nix {inherit lib;};
|
||||||
lists = import ./lists.nix {inherit lib;};
|
lists = import ./lists.nix {inherit lib;};
|
||||||
lua = import ./lua.nix {inherit lib;};
|
lua = import ./lua.nix {inherit lib;};
|
||||||
neovimConfiguration = import ../modules {inherit inputs lib;};
|
vim = import ./vim.nix;
|
||||||
}
|
}
|
||||||
|
|
24
lib/lua.nix
24
lib/lua.nix
|
@ -2,9 +2,19 @@
|
||||||
{lib}: let
|
{lib}: let
|
||||||
inherit (builtins) hasAttr head throw typeOf isList isAttrs isBool isInt isString isPath isFloat toJSON;
|
inherit (builtins) hasAttr head throw typeOf isList isAttrs isBool isInt isString isPath isFloat toJSON;
|
||||||
inherit (lib.attrsets) mapAttrsToList filterAttrs;
|
inherit (lib.attrsets) mapAttrsToList filterAttrs;
|
||||||
inherit (lib.strings) concatStringsSep concatMapStringsSep stringToCharacters concatLines;
|
inherit (lib.strings) concatStringsSep concatMapStringsSep stringToCharacters;
|
||||||
inherit (lib.trivial) boolToString warn;
|
inherit (lib.trivial) boolToString;
|
||||||
in rec {
|
in rec {
|
||||||
|
wrapLuaConfig = {
|
||||||
|
luaBefore ? "",
|
||||||
|
luaConfig,
|
||||||
|
luaAfter ? "",
|
||||||
|
}: ''
|
||||||
|
lua << EOF
|
||||||
|
${concatStringsSep "\n" [luaBefore luaConfig luaAfter]}
|
||||||
|
EOF
|
||||||
|
'';
|
||||||
|
|
||||||
# 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
|
||||||
|
@ -56,10 +66,7 @@ in rec {
|
||||||
if isLuaInline args
|
if isLuaInline args
|
||||||
then args.expr
|
then args.expr
|
||||||
else if hasAttr "__empty" args
|
else if hasAttr "__empty" args
|
||||||
then
|
then "{ }"
|
||||||
warn ''
|
|
||||||
Using `__empty` to define an empty lua table is deprecated. Use an empty attrset instead.
|
|
||||||
'' "{ }"
|
|
||||||
else
|
else
|
||||||
"{"
|
"{"
|
||||||
+ (concatStringsSep ","
|
+ (concatStringsSep ","
|
||||||
|
@ -69,7 +76,10 @@ in rec {
|
||||||
then toLuaObject v
|
then toLuaObject v
|
||||||
else "[${toLuaObject n}] = " + (toLuaObject v))
|
else "[${toLuaObject n}] = " + (toLuaObject v))
|
||||||
(filterAttrs
|
(filterAttrs
|
||||||
(_: v: v != null)
|
(
|
||||||
|
_: v:
|
||||||
|
(v != null) && (toLuaObject v != "{}")
|
||||||
|
)
|
||||||
args)))
|
args)))
|
||||||
+ "}"
|
+ "}"
|
||||||
else if isList args
|
else if isList args
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# Convenience function that returns the given Nixpkgs standard library
|
# Convenience function that returns the given Nixpkgs standard library
|
||||||
# extended with our functions using `lib.extend`.
|
# extended with our functions using `lib.extend`.
|
||||||
inputs:
|
nixpkgsLib: inputs:
|
||||||
inputs.nixpkgs.lib.extend (self: super: {
|
nixpkgsLib.extend (self: super: {
|
||||||
# WARNING: New functions should not be added here, but to files
|
# WARNING: New functions should not be added here, but to files
|
||||||
# imported by `./default.nix` under their own categories. If your
|
# imported by `./default.nix` under their own categories. If your
|
||||||
# function does not fit to any of the existing categories, create
|
# function does not fit to any of the existing categories, create
|
||||||
|
|
|
@ -1,61 +0,0 @@
|
||||||
{lib}: let
|
|
||||||
inherit (lib) isStringLike showOption showFiles getFiles mergeOneOption mergeEqualOption mkOptionType;
|
|
||||||
inherit (lib.types) anything attrsOf;
|
|
||||||
inherit (lib.nvim.types) anythingConcatLists;
|
|
||||||
inherit (builtins) typeOf isAttrs any head concatLists stringLength;
|
|
||||||
in {
|
|
||||||
# HACK: Does this break anything in our case?
|
|
||||||
# A modified version of the nixpkgs anything type that concatenates lists
|
|
||||||
# This isn't the default because the order in which the lists are concatenated depends on the order in which the modules are imported,
|
|
||||||
# which makes it non-deterministic
|
|
||||||
anythingConcatLists =
|
|
||||||
anything
|
|
||||||
// {
|
|
||||||
merge = loc: defs: let
|
|
||||||
getType = value:
|
|
||||||
if isAttrs value && isStringLike value
|
|
||||||
then "stringCoercibleSet"
|
|
||||||
else typeOf value;
|
|
||||||
|
|
||||||
# Throw an error if not all defs have the same type
|
|
||||||
checkType = getType (head defs).value;
|
|
||||||
commonType =
|
|
||||||
if any (def: getType def.value != checkType) defs
|
|
||||||
then throw "The option `${showOption loc}' has conflicting option types in ${showFiles (getFiles defs)}"
|
|
||||||
else checkType;
|
|
||||||
|
|
||||||
mergeFunctions = {
|
|
||||||
# Recursively merge attribute sets
|
|
||||||
set = (attrsOf anythingConcatLists).merge;
|
|
||||||
|
|
||||||
# Overridden behavior for lists, that concatenates lists
|
|
||||||
list = _: defs: concatLists (map (e: e.value) defs);
|
|
||||||
|
|
||||||
# This means it's a package, only accept a single definition
|
|
||||||
stringCoercibleSet = mergeOneOption;
|
|
||||||
|
|
||||||
# This works by passing the argument to the functions,
|
|
||||||
# and merging their returns values instead
|
|
||||||
lambda = loc: defs: arg:
|
|
||||||
anythingConcatLists.merge
|
|
||||||
(loc ++ ["<function body>"])
|
|
||||||
(map (def: {
|
|
||||||
inherit (def) file;
|
|
||||||
value = def.value arg;
|
|
||||||
})
|
|
||||||
defs);
|
|
||||||
};
|
|
||||||
in
|
|
||||||
# Merge the defs with the correct function from above, if available
|
|
||||||
# otherwise only allow equal values
|
|
||||||
(mergeFunctions.${commonType} or mergeEqualOption) loc defs;
|
|
||||||
};
|
|
||||||
|
|
||||||
char = mkOptionType {
|
|
||||||
name = "char";
|
|
||||||
description = "character";
|
|
||||||
descriptionClass = "noun";
|
|
||||||
check = value: stringLength value < 2;
|
|
||||||
merge = mergeEqualOption;
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -6,10 +6,8 @@
|
||||||
typesDag = import ./dag.nix {inherit lib;};
|
typesDag = import ./dag.nix {inherit lib;};
|
||||||
typesPlugin = import ./plugins.nix {inherit inputs lib;};
|
typesPlugin = import ./plugins.nix {inherit inputs lib;};
|
||||||
typesLanguage = import ./languages.nix {inherit lib;};
|
typesLanguage = import ./languages.nix {inherit lib;};
|
||||||
typesCustom = import ./custom.nix {inherit lib;};
|
|
||||||
in {
|
in {
|
||||||
inherit (typesDag) dagOf;
|
inherit (typesDag) dagOf;
|
||||||
inherit (typesPlugin) pluginsOpt extraPluginType mkPluginSetupOption luaInline pluginType borderType;
|
inherit (typesPlugin) pluginsOpt extraPluginType mkPluginSetupOption luaInline;
|
||||||
inherit (typesLanguage) diagnostics mkGrammarOption;
|
inherit (typesLanguage) diagnostics mkGrammarOption;
|
||||||
inherit (typesCustom) anythingConcatLists char;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.options) mkOption;
|
inherit (lib.options) mkOption;
|
||||||
inherit (lib.attrsets) attrNames mapAttrs' filterAttrs nameValuePair;
|
inherit (lib.attrsets) attrNames mapAttrs' filterAttrs nameValuePair;
|
||||||
inherit (lib.strings) hasPrefix removePrefix;
|
inherit (lib.strings) hasPrefix removePrefix isString;
|
||||||
inherit (lib.types) submodule either package enum str lines attrsOf anything listOf nullOr;
|
inherit (lib.types) submodule either package enum str lines attrsOf anything listOf nullOr;
|
||||||
|
|
||||||
# Get the names of all flake inputs that start with the given prefix.
|
# Get the names of all flake inputs that start with the given prefix.
|
||||||
|
@ -51,12 +51,8 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
borderPresets = ["none" "single" "double" "rounded" "solid" "shadow"];
|
|
||||||
in {
|
in {
|
||||||
inherit extraPluginType fromInputs pluginType;
|
inherit extraPluginType fromInputs;
|
||||||
|
|
||||||
borderType = either (enum borderPresets) (listOf (either str (listOf str)));
|
|
||||||
|
|
||||||
pluginsOpt = {
|
pluginsOpt = {
|
||||||
description,
|
description,
|
||||||
|
@ -97,7 +93,7 @@ in {
|
||||||
|
|
||||||
default = {};
|
default = {};
|
||||||
type = submodule {
|
type = submodule {
|
||||||
freeformType = anything;
|
freeformType = attrsOf anything;
|
||||||
options = opts;
|
options = opts;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
26
lib/vim.nix
Normal file
26
lib/vim.nix
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
let
|
||||||
|
inherit (builtins) isInt isBool toJSON toString;
|
||||||
|
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 (toString val)
|
||||||
|
else
|
||||||
|
(
|
||||||
|
if (isBool val)
|
||||||
|
then (mkVimBool val)
|
||||||
|
else (toJSON val)
|
||||||
|
);
|
||||||
|
}
|
|
@ -1,134 +1,124 @@
|
||||||
{
|
inputs: {
|
||||||
inputs,
|
configuration,
|
||||||
lib,
|
|
||||||
}: {
|
|
||||||
pkgs,
|
pkgs,
|
||||||
|
lib ? pkgs.lib,
|
||||||
|
check ? true,
|
||||||
extraSpecialArgs ? {},
|
extraSpecialArgs ? {},
|
||||||
modules ? [],
|
|
||||||
# deprecated
|
|
||||||
extraModules ? [],
|
extraModules ? [],
|
||||||
configuration ? {},
|
|
||||||
}: let
|
}: let
|
||||||
inherit (pkgs) vimPlugins;
|
inherit (builtins) map filter isString toString getAttr;
|
||||||
inherit (lib.strings) isString toString;
|
inherit (pkgs) wrapNeovimUnstable vimPlugins;
|
||||||
inherit (lib.lists) filter map concatLists;
|
inherit (pkgs.vimUtils) buildVimPlugin;
|
||||||
|
inherit (pkgs.neovimUtils) makeNeovimConfig;
|
||||||
|
inherit (lib.strings) makeBinPath escapeShellArgs concatStringsSep;
|
||||||
|
inherit (lib.lists) concatLists optional;
|
||||||
|
inherit (lib.attrsets) recursiveUpdate;
|
||||||
|
inherit (lib.asserts) assertMsg;
|
||||||
|
|
||||||
|
# call the extedended library with `lib` and `inputs` as arguments
|
||||||
|
# lib is used to provide the standard library functions to the extended library
|
||||||
|
# but it can be overridden while this file is being called
|
||||||
|
# inputs is used to pass inputs to the plugin autodiscovery function
|
||||||
|
extendedLib = import ../lib/stdlib-extended.nix lib inputs;
|
||||||
|
|
||||||
# import modules.nix with `check`, `pkgs` and `lib` as arguments
|
# import modules.nix with `check`, `pkgs` and `lib` as arguments
|
||||||
# check can be disabled while calling this file is called
|
# check can be disabled while calling this file is called
|
||||||
# to avoid checking in all modules
|
# to avoid checking in all modules
|
||||||
nvimModules = import ./modules.nix {inherit pkgs lib;};
|
nvimModules = import ./modules.nix {
|
||||||
|
inherit check pkgs;
|
||||||
|
lib = extendedLib;
|
||||||
|
};
|
||||||
|
|
||||||
# evaluate the extended library with the modules
|
# evaluate the extended library with the modules
|
||||||
# optionally with any additional modules passed by the user
|
# optionally with any additional modules passed by the user
|
||||||
module = lib.evalModules {
|
module = extendedLib.evalModules {
|
||||||
specialArgs = extraSpecialArgs // {modulesPath = toString ./.;};
|
specialArgs = recursiveUpdate {modulesPath = toString ./.;} extraSpecialArgs;
|
||||||
modules = concatLists [
|
modules = concatLists [[configuration] nvimModules extraModules];
|
||||||
nvimModules
|
|
||||||
modules
|
|
||||||
(lib.optional (configuration != {}) (lib.warn ''
|
|
||||||
nvf: passing 'configuration' to lib.neovimConfiguration is deprecated.
|
|
||||||
''
|
|
||||||
configuration))
|
|
||||||
|
|
||||||
(lib.optionals (extraModules != []) (lib.warn ''
|
|
||||||
nvf: passing 'extraModules' to lib.neovimConfiguration is deprecated, use 'modules' instead.
|
|
||||||
''
|
|
||||||
extraModules))
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# alias to the internal configuration
|
# alias to the internal configuration
|
||||||
vimOptions = module.config.vim;
|
vimOptions = module.config.vim;
|
||||||
|
|
||||||
noBuildPlug = {pname, ...} @ attrs: let
|
|
||||||
src = inputs."plugin-${attrs.pname}";
|
|
||||||
in
|
|
||||||
{
|
|
||||||
version = src.shortRev or src.shortDirtyRev or "dirty";
|
|
||||||
outPath = src;
|
|
||||||
passthru.vimPlugin = false;
|
|
||||||
}
|
|
||||||
// attrs;
|
|
||||||
|
|
||||||
# build a vim plugin with the given name and arguments
|
# build a vim plugin with the given name and arguments
|
||||||
# if the plugin is nvim-treesitter, warn the user to use buildTreesitterPlug
|
# if the plugin is nvim-treesitter, warn the user to use buildTreesitterPlug
|
||||||
# instead
|
# instead
|
||||||
buildPlug = attrs: let
|
buildPlug = {pname, ...} @ args:
|
||||||
src = inputs."plugin-${attrs.pname}";
|
assert assertMsg (pname != "nvim-treesitter") "Use buildTreesitterPlug for building nvim-treesitter.";
|
||||||
in
|
buildVimPlugin (args
|
||||||
pkgs.vimUtils.buildVimPlugin (
|
// {
|
||||||
{
|
version = "master";
|
||||||
version = src.shortRev or src.shortDirtyRev or "dirty";
|
src = getAttr ("plugin-" + pname) inputs;
|
||||||
inherit src;
|
});
|
||||||
}
|
|
||||||
// attrs
|
|
||||||
);
|
|
||||||
|
|
||||||
buildTreesitterPlug = grammars: vimPlugins.nvim-treesitter.withPlugins (_: grammars);
|
buildTreesitterPlug = grammars: vimPlugins.nvim-treesitter.withPlugins (_: grammars);
|
||||||
|
|
||||||
pluginBuilders = {
|
|
||||||
nvim-treesitter = buildTreesitterPlug vimOptions.treesitter.grammars;
|
|
||||||
flutter-tools-patched = buildPlug {
|
|
||||||
pname = "flutter-tools";
|
|
||||||
patches = [../patches/flutter-tools.patch];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
buildConfigPlugins = plugins:
|
buildConfigPlugins = plugins:
|
||||||
map (
|
map
|
||||||
plug:
|
(plug: (
|
||||||
if (isString plug)
|
if (isString plug)
|
||||||
then pluginBuilders.${plug} or (noBuildPlug {pname = plug;})
|
then
|
||||||
else plug
|
(
|
||||||
) (filter (f: f != null) plugins);
|
if (plug == "nvim-treesitter")
|
||||||
|
then (buildTreesitterPlug vimOptions.treesitter.grammars)
|
||||||
|
else if (plug == "flutter-tools-patched")
|
||||||
|
then
|
||||||
|
(buildPlug {
|
||||||
|
pname = "flutter-tools";
|
||||||
|
patches = [../patches/flutter-tools.patch];
|
||||||
|
})
|
||||||
|
else (buildPlug {pname = plug;})
|
||||||
|
)
|
||||||
|
else plug
|
||||||
|
))
|
||||||
|
(filter
|
||||||
|
(f: f != null)
|
||||||
|
plugins);
|
||||||
|
|
||||||
# built (or "normalized") plugins that are modified
|
# built (or "normalized") plugins that are modified
|
||||||
builtStartPlugins = buildConfigPlugins vimOptions.startPlugins;
|
builtStartPlugins = buildConfigPlugins vimOptions.startPlugins;
|
||||||
builtOptPlugins = map (package: {
|
builtOptPlugins = map (package: {
|
||||||
plugin = package;
|
plugin = package;
|
||||||
optional = true;
|
optional = false;
|
||||||
}) (buildConfigPlugins vimOptions.optPlugins);
|
}) (buildConfigPlugins vimOptions.optPlugins);
|
||||||
|
|
||||||
|
# combine built start and optional plugins
|
||||||
|
# into a single list
|
||||||
|
plugins = builtStartPlugins ++ builtOptPlugins;
|
||||||
|
|
||||||
# additional Lua and Python3 packages, mapped to their respective functions
|
# additional Lua and Python3 packages, mapped to their respective functions
|
||||||
# to conform to the format mnw expects. end user should
|
# to conform to the format makeNeovimConfig expects. end user should
|
||||||
# only ever need to pass a list of packages, which are modified
|
# only ever need to pass a list of packages, which are modified
|
||||||
# here
|
# here
|
||||||
extraLuaPackages = ps: map (x: ps.${x}) vimOptions.luaPackages;
|
extraLuaPackages = ps: map (x: ps.${x}) vimOptions.luaPackages;
|
||||||
extraPython3Packages = ps: map (x: ps.${x}) vimOptions.python3Packages;
|
extraPython3Packages = ps: map (x: ps.${x}) vimOptions.python3Packages;
|
||||||
|
|
||||||
# Wrap the user's desired (unwrapped) Neovim package with arguments that'll be used to
|
extraWrapperArgs =
|
||||||
# generate a wrapped Neovim package.
|
concatStringsSep " " (optional (vimOptions.extraPackages != []) ''--prefix PATH : "${makeBinPath vimOptions.extraPackages}"'');
|
||||||
neovim-wrapped = inputs.mnw.lib.wrap pkgs {
|
|
||||||
neovim = vimOptions.package;
|
|
||||||
plugins = builtStartPlugins ++ builtOptPlugins;
|
|
||||||
appName = "nvf";
|
|
||||||
extraBinPath = vimOptions.extraPackages;
|
|
||||||
initLua = vimOptions.builtLuaConfigRC;
|
|
||||||
luaFiles = vimOptions.extraLuaFiles;
|
|
||||||
|
|
||||||
|
# wrap user's desired neovim package with the desired neovim configuration
|
||||||
|
# using wrapNeovimUnstable and makeNeovimConfig from nixpkgs.
|
||||||
|
# the makeNeovimConfig function takes the following arguments:
|
||||||
|
# - withPython (bool)
|
||||||
|
# - extraPython3Packages (lambda)
|
||||||
|
# - withNodeJs (bool)
|
||||||
|
# - withRuby (bool)
|
||||||
|
# - extraLuaPackages (lambda)
|
||||||
|
# - plugins (list)
|
||||||
|
# - customRC (string)
|
||||||
|
# and returns the wrapped package
|
||||||
|
neovimConfigured = makeNeovimConfig {
|
||||||
inherit (vimOptions) viAlias vimAlias withRuby withNodeJs withPython3;
|
inherit (vimOptions) viAlias vimAlias withRuby withNodeJs withPython3;
|
||||||
inherit extraLuaPackages extraPython3Packages;
|
inherit plugins extraLuaPackages extraPython3Packages;
|
||||||
|
customRC = vimOptions.builtConfigRC;
|
||||||
};
|
};
|
||||||
|
|
||||||
dummyInit = pkgs.writeText "nvf-init.lua" vimOptions.builtLuaConfigRC;
|
neovim-wrapped = wrapNeovimUnstable vimOptions.package (recursiveUpdate neovimConfigured {
|
||||||
# Additional helper scripts for printing and displaying nvf configuration
|
wrapperArgs = escapeShellArgs neovimConfigured.wrapperArgs + " " + extraWrapperArgs;
|
||||||
# in your commandline.
|
});
|
||||||
printConfig = pkgs.writers.writeDashBin "nvf-print-config" "cat ${dummyInit}";
|
|
||||||
printConfigPath = pkgs.writers.writeDashBin "nvf-print-config-path" "echo -n ${dummyInit}";
|
|
||||||
in {
|
in {
|
||||||
inherit (module) options config;
|
inherit (module) options config;
|
||||||
inherit (module._module.args) pkgs;
|
inherit (module._module.args) pkgs;
|
||||||
|
|
||||||
# Expose wrapped neovim-package for userspace
|
# expose wrapped neovim-package
|
||||||
# or module consumption.
|
neovim = neovim-wrapped;
|
||||||
neovim = pkgs.symlinkJoin {
|
|
||||||
name = "nvf-with-helpers";
|
|
||||||
paths = [neovim-wrapped printConfig printConfigPath];
|
|
||||||
postBuild = "echo Helpers added";
|
|
||||||
|
|
||||||
meta = {
|
|
||||||
description = "Wrapped version of Neovim with additional helper scripts";
|
|
||||||
mainProgram = "nvim";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,18 +0,0 @@
|
||||||
{lib, ...}: let
|
|
||||||
inherit (lib.modules) mkRemovedOptionModule;
|
|
||||||
in {
|
|
||||||
imports = [
|
|
||||||
# 2024-06-06
|
|
||||||
(mkRemovedOptionModule ["vim" "tidal"] ''
|
|
||||||
Tidalcycles language support has been removed as of 2024-06-06 as it was long unmaintained. If
|
|
||||||
you depended on this functionality, please open an issue.
|
|
||||||
'')
|
|
||||||
|
|
||||||
# 2024-07-20
|
|
||||||
(mkRemovedOptionModule ["vim" "lsp" "nvimCodeActionMenu"] ''
|
|
||||||
nvimCodeActionMenu has been deprecated and removed upstream. As of 0.7, fastaction will be
|
|
||||||
available under `vim.ui.fastaction` as a replacement. Simply remove everything under
|
|
||||||
`vim.lsp.nvimCodeActionMenu`, and set `vim.ui.fastaction.enable` to `true`.
|
|
||||||
'')
|
|
||||||
];
|
|
||||||
}
|
|
|
@ -1,72 +1,71 @@
|
||||||
{
|
{
|
||||||
pkgs,
|
pkgs,
|
||||||
lib,
|
lib,
|
||||||
|
check ? true,
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.modules) mkDefault;
|
inherit (lib.modules) mkDefault;
|
||||||
inherit (lib.lists) concatLists;
|
inherit (lib.lists) concatLists;
|
||||||
allModules = let
|
|
||||||
# The core neovim modules.
|
|
||||||
# Contains configuration for core neovim features
|
|
||||||
# such as spellchecking, mappings, and the init script (init.vim).
|
|
||||||
neovim = map (p: ./neovim + "/${p}") [
|
|
||||||
"init"
|
|
||||||
"mappings"
|
|
||||||
];
|
|
||||||
|
|
||||||
# Individual plugin modules, separated by the type of plugin.
|
# The core neovim modules.
|
||||||
# While adding a new type, you must make sure your type is
|
# Contains configuration for core neovim features
|
||||||
# included in the list below.
|
# such as spellchecking, mappings, and the init script (init.vim).
|
||||||
plugins = map (p: ./plugins + "/${p}") [
|
neovim = map (p: ./neovim + "/${p}") [
|
||||||
"assistant"
|
"init"
|
||||||
"autopairs"
|
"mappings"
|
||||||
"comments"
|
];
|
||||||
"completion"
|
|
||||||
"dashboard"
|
|
||||||
"debugger"
|
|
||||||
"filetree"
|
|
||||||
"git"
|
|
||||||
"languages"
|
|
||||||
"lsp"
|
|
||||||
"minimap"
|
|
||||||
"notes"
|
|
||||||
"projects"
|
|
||||||
"rich-presence"
|
|
||||||
"session"
|
|
||||||
"snippets"
|
|
||||||
# "spellcheck" # FIXME: see neovim/init/spellcheck.nix
|
|
||||||
"statusline"
|
|
||||||
"tabline"
|
|
||||||
"terminal"
|
|
||||||
"theme"
|
|
||||||
"treesitter"
|
|
||||||
"ui"
|
|
||||||
"utility"
|
|
||||||
"visuals"
|
|
||||||
];
|
|
||||||
|
|
||||||
# The neovim wrapper, used to build a wrapped neovim package
|
# Individual plugin modules, separated by the type of plugin.
|
||||||
# using the configuration passed in `neovim` and `plugins` modules.
|
# While adding a new type, you must make sure your type is
|
||||||
wrapper = map (p: ./wrapper + "/${p}") [
|
# included in the list below.
|
||||||
"build"
|
plugins = map (p: ./plugins + "/${p}") [
|
||||||
"rc"
|
"assistant"
|
||||||
"warnings"
|
"autopairs"
|
||||||
];
|
"comments"
|
||||||
|
"completion"
|
||||||
|
"dashboard"
|
||||||
|
"debugger"
|
||||||
|
"filetree"
|
||||||
|
"git"
|
||||||
|
"languages"
|
||||||
|
"lsp"
|
||||||
|
"minimap"
|
||||||
|
"notes"
|
||||||
|
"projects"
|
||||||
|
"rich-presence"
|
||||||
|
"session"
|
||||||
|
"snippets"
|
||||||
|
# "spellcheck" # FIXME: see neovim/init/spellcheck.nix
|
||||||
|
"statusline"
|
||||||
|
"tabline"
|
||||||
|
"terminal"
|
||||||
|
"theme"
|
||||||
|
"treesitter"
|
||||||
|
"ui"
|
||||||
|
"utility"
|
||||||
|
"visuals"
|
||||||
|
];
|
||||||
|
|
||||||
# Extra modules, such as deprecation warnings
|
# The neovim wrapper, used to build a wrapped neovim package
|
||||||
# or renames in one place.
|
# using the configuration passed in `neovim` and `plugins` modules.
|
||||||
extra = map (p: ./extra + "/${p}") [
|
wrapper = map (p: ./wrapper + "/${p}") [
|
||||||
"deprecations.nix"
|
"build"
|
||||||
];
|
"rc"
|
||||||
in
|
"warnings"
|
||||||
concatLists [neovim plugins wrapper extra];
|
];
|
||||||
in
|
|
||||||
allModules
|
allModules = concatLists [neovim plugins wrapper];
|
||||||
++ [
|
|
||||||
{
|
pkgsModule = {config, ...}: {
|
||||||
_module.args = {
|
config = {
|
||||||
baseModules = allModules;
|
_module = {
|
||||||
pkgsPath = mkDefault pkgs.path;
|
inherit check;
|
||||||
pkgs = mkDefault pkgs;
|
args = {
|
||||||
|
baseModules = allModules;
|
||||||
|
pkgsPath = mkDefault pkgs.path;
|
||||||
|
pkgs = mkDefault pkgs;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
};
|
||||||
]
|
};
|
||||||
|
in
|
||||||
|
allModules ++ [pkgsModule]
|
||||||
|
|
|
@ -3,21 +3,18 @@
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.options) mkOption mkEnableOption literalExpression literalMD;
|
inherit (lib.options) mkOption literalExpression;
|
||||||
inherit (lib.strings) optionalString;
|
inherit (lib.strings) optionalString;
|
||||||
inherit (lib.types) enum bool str int either;
|
inherit (lib.types) enum bool str int nullOr;
|
||||||
inherit (lib.generators) mkLuaInline;
|
|
||||||
inherit (lib.nvim.dag) entryAfter;
|
inherit (lib.nvim.dag) entryAfter;
|
||||||
inherit (lib.nvim.lua) toLuaObject;
|
|
||||||
inherit (lib.nvim.types) luaInline;
|
|
||||||
|
|
||||||
cfg = config.vim;
|
cfg = config.vim;
|
||||||
in {
|
in {
|
||||||
options.vim = {
|
options.vim = {
|
||||||
leaderKey = mkOption {
|
leaderKey = mkOption {
|
||||||
type = str;
|
type = nullOr str;
|
||||||
default = " ";
|
default = null;
|
||||||
description = "The leader key used for `<leader>` mappings";
|
description = "The leader key to be used internally";
|
||||||
};
|
};
|
||||||
|
|
||||||
colourTerm = mkOption {
|
colourTerm = mkOption {
|
||||||
|
@ -56,6 +53,12 @@ in {
|
||||||
description = "Enable syntax highlighting";
|
description = "Enable syntax highlighting";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
mapLeaderSpace = mkOption {
|
||||||
|
type = bool;
|
||||||
|
default = true;
|
||||||
|
description = "Map the space key to leader key";
|
||||||
|
};
|
||||||
|
|
||||||
useSystemClipboard = mkOption {
|
useSystemClipboard = mkOption {
|
||||||
type = bool;
|
type = bool;
|
||||||
default = false;
|
default = false;
|
||||||
|
@ -160,138 +163,119 @@ in {
|
||||||
default = "sensitive";
|
default = "sensitive";
|
||||||
description = "Set the case sensitivity of search";
|
description = "Set the case sensitivity of search";
|
||||||
};
|
};
|
||||||
|
|
||||||
undoFile = {
|
|
||||||
enable = mkEnableOption "undofile for persistent undo behaviour";
|
|
||||||
path = mkOption {
|
|
||||||
type = either str luaInline;
|
|
||||||
default = mkLuaInline "vim.fn.stdpath('state') .. '/undo'";
|
|
||||||
defaultText = literalMD ''
|
|
||||||
```nix
|
|
||||||
mkLuaInline "vim.fn.stdpath('state') .. '/undo'"
|
|
||||||
```
|
|
||||||
'';
|
|
||||||
example = literalMD ''
|
|
||||||
```nix
|
|
||||||
mkLuaInline "os.getenv('XDG_DATA_HOME') .. '/nvf/undo'"
|
|
||||||
```
|
|
||||||
'';
|
|
||||||
description = "Path to the directory in which undo history will be stored";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
config = {
|
config.vim.configRC.basic = entryAfter ["globalsScript"] ''
|
||||||
vim.luaConfigRC.basic = entryAfter ["globalsScript"] ''
|
" Settings that are set for everything
|
||||||
-- Settings that are set for everything
|
set encoding=utf-8
|
||||||
vim.o.encoding = "utf-8"
|
set hidden
|
||||||
vim.o.hidden = true
|
set shortmess+=c
|
||||||
vim.opt.shortmess:append("c")
|
set expandtab
|
||||||
vim.o.expandtab = true
|
set mouse=${cfg.mouseSupport}
|
||||||
vim.o.mouse = ${toLuaObject cfg.mouseSupport}
|
set tabstop=${toString cfg.tabWidth}
|
||||||
vim.o.tabstop = ${toLuaObject cfg.tabWidth}
|
set shiftwidth=${toString cfg.tabWidth}
|
||||||
vim.o.shiftwidth = ${toLuaObject cfg.tabWidth}
|
set softtabstop=${toString cfg.tabWidth}
|
||||||
vim.o.softtabstop = ${toLuaObject cfg.tabWidth}
|
set cmdheight=${toString cfg.cmdHeight}
|
||||||
vim.o.cmdheight = ${toLuaObject cfg.cmdHeight}
|
set updatetime=${toString cfg.updateTime}
|
||||||
vim.o.updatetime = ${toLuaObject cfg.updateTime}
|
set tm=${toString cfg.mapTimeout}
|
||||||
vim.o.tm = ${toLuaObject cfg.mapTimeout}
|
set cursorlineopt=${toString cfg.cursorlineOpt}
|
||||||
vim.o.cursorlineopt = ${toLuaObject cfg.cursorlineOpt}
|
set scrolloff=${toString cfg.scrollOffset}
|
||||||
vim.o.scrolloff = ${toLuaObject cfg.scrollOffset}
|
|
||||||
vim.g.mapleader = ${toLuaObject cfg.leaderKey}
|
|
||||||
vim.g.maplocalleader = ${toLuaObject cfg.leaderKey}
|
|
||||||
|
|
||||||
${optionalString cfg.undoFile.enable ''
|
${optionalString cfg.splitBelow ''
|
||||||
vim.o.undofile = true
|
set splitbelow
|
||||||
vim.o.undodir = ${toLuaObject cfg.undoFile.path}
|
''}
|
||||||
''}
|
|
||||||
|
|
||||||
${optionalString cfg.splitBelow ''
|
${optionalString cfg.splitRight ''
|
||||||
vim.o.splitbelow = true
|
set splitright
|
||||||
''}
|
''}
|
||||||
|
|
||||||
${optionalString cfg.splitRight ''
|
${optionalString cfg.showSignColumn ''
|
||||||
vim.o.splitright = true
|
set signcolumn=yes
|
||||||
''}
|
''}
|
||||||
|
|
||||||
${optionalString cfg.showSignColumn ''
|
${optionalString cfg.autoIndent ''
|
||||||
vim.o.signcolumn = "yes"
|
set autoindent
|
||||||
''}
|
''}
|
||||||
|
|
||||||
${optionalString cfg.autoIndent ''
|
${optionalString cfg.preventJunkFiles ''
|
||||||
vim.o.autoindent = true
|
set noswapfile
|
||||||
''}
|
set nobackup
|
||||||
|
set nowritebackup
|
||||||
|
''}
|
||||||
|
|
||||||
${optionalString cfg.preventJunkFiles ''
|
${optionalString (cfg.bell == "none") ''
|
||||||
vim.o.swapfile = false
|
set noerrorbells
|
||||||
vim.o.backup = false
|
set novisualbell
|
||||||
vim.o.writebackup = false
|
''}
|
||||||
''}
|
|
||||||
|
|
||||||
${optionalString (cfg.bell == "none") ''
|
${optionalString (cfg.bell == "on") ''
|
||||||
vim.o.errorbells = false
|
set novisualbell
|
||||||
vim.o.visualbell = false
|
''}
|
||||||
''}
|
|
||||||
|
|
||||||
${optionalString (cfg.bell == "on") ''
|
${optionalString (cfg.bell == "visual") ''
|
||||||
vim.o.visualbell = false
|
set noerrorbells
|
||||||
''}
|
''}
|
||||||
|
|
||||||
${optionalString (cfg.bell == "visual") ''
|
${optionalString (cfg.lineNumberMode == "relative") ''
|
||||||
vim.o.errorbells = false
|
set relativenumber
|
||||||
''}
|
''}
|
||||||
|
|
||||||
${optionalString (cfg.lineNumberMode == "relative") ''
|
${optionalString (cfg.lineNumberMode == "number") ''
|
||||||
vim.o.relativenumber = true
|
set number
|
||||||
''}
|
''}
|
||||||
|
|
||||||
${optionalString (cfg.lineNumberMode == "number") ''
|
${optionalString (cfg.lineNumberMode == "relNumber") ''
|
||||||
vim.o.number = true
|
set number relativenumber
|
||||||
''}
|
''}
|
||||||
|
|
||||||
${optionalString (cfg.lineNumberMode == "relNumber") ''
|
${optionalString cfg.useSystemClipboard ''
|
||||||
vim.o.number = true
|
set clipboard+=unnamedplus
|
||||||
vim.o.relativenumber = true
|
''}
|
||||||
''}
|
|
||||||
|
|
||||||
${optionalString cfg.useSystemClipboard ''
|
${optionalString cfg.mapLeaderSpace ''
|
||||||
vim.opt.clipboard:append("unnamedplus")
|
let mapleader=" "
|
||||||
''}
|
let maplocalleader=" "
|
||||||
|
''}
|
||||||
|
|
||||||
${optionalString cfg.syntaxHighlighting ''
|
${optionalString cfg.syntaxHighlighting ''
|
||||||
vim.cmd("syntax on")
|
syntax on
|
||||||
''}
|
''}
|
||||||
|
|
||||||
${optionalString (!cfg.wordWrap) ''
|
${optionalString (!cfg.wordWrap) ''
|
||||||
vim.o.wrap = false
|
set nowrap
|
||||||
''}
|
''}
|
||||||
|
|
||||||
${optionalString cfg.hideSearchHighlight ''
|
${optionalString cfg.hideSearchHighlight ''
|
||||||
vim.o.hlsearch = false
|
set nohlsearch
|
||||||
vim.o.incsearch = true
|
set incsearch
|
||||||
''}
|
''}
|
||||||
|
|
||||||
${optionalString cfg.colourTerm ''
|
${optionalString cfg.colourTerm ''
|
||||||
vim.o.termguicolors = true
|
set termguicolors
|
||||||
''}
|
set t_Co=256
|
||||||
|
''}
|
||||||
|
|
||||||
${optionalString (!cfg.enableEditorconfig) ''
|
${optionalString (!cfg.enableEditorconfig) ''
|
||||||
vim.g.editorconfig = false
|
let g:editorconfig = v:false
|
||||||
''}
|
''}
|
||||||
|
|
||||||
${optionalString (cfg.searchCase == "ignore") ''
|
${optionalString (cfg.leaderKey != null) ''
|
||||||
vim.o.smartcase = false
|
let mapleader = "${toString cfg.leaderKey}"
|
||||||
vim.o.ignorecase = true
|
''}
|
||||||
''}
|
|
||||||
|
|
||||||
${optionalString (cfg.searchCase == "smart") ''
|
${optionalString (cfg.searchCase == "ignore") ''
|
||||||
vim.o.smartcase = true
|
set nosmartcase
|
||||||
vim.o.ignorecase = true
|
set ignorecase
|
||||||
''}
|
''}
|
||||||
|
|
||||||
${optionalString (cfg.searchCase == "sensitive") ''
|
${optionalString (cfg.searchCase == "smart") ''
|
||||||
vim.o.smartcase = false
|
set smartcase
|
||||||
vim.o.ignorecase = false
|
set ignorecase
|
||||||
''}
|
''}
|
||||||
'';
|
|
||||||
};
|
${optionalString (cfg.searchCase == "sensitive") ''
|
||||||
|
set nosmartcase
|
||||||
|
set noignorecase
|
||||||
|
''}
|
||||||
|
'';
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,26 +9,32 @@
|
||||||
in {
|
in {
|
||||||
config = {
|
config = {
|
||||||
vim.maps = {
|
vim.maps = {
|
||||||
normal = mkIf cfg.disableArrows {
|
normal =
|
||||||
"<up>" = {
|
mkIf cfg.disableArrows {
|
||||||
action = "<nop>";
|
"<up>" = {
|
||||||
|
action = "<nop>";
|
||||||
|
|
||||||
noremap = false;
|
noremap = false;
|
||||||
};
|
};
|
||||||
"<down>" = {
|
"<down>" = {
|
||||||
action = "<nop>";
|
action = "<nop>";
|
||||||
|
|
||||||
noremap = false;
|
noremap = false;
|
||||||
|
};
|
||||||
|
"<left>" = {
|
||||||
|
action = "<nop>";
|
||||||
|
noremap = false;
|
||||||
|
};
|
||||||
|
"<right>" = {
|
||||||
|
action = "<nop>";
|
||||||
|
noremap = false;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
// mkIf cfg.mapLeaderSpace {
|
||||||
|
"<space>" = {
|
||||||
|
action = "<nop>";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
"<left>" = {
|
|
||||||
action = "<nop>";
|
|
||||||
noremap = false;
|
|
||||||
};
|
|
||||||
"<right>" = {
|
|
||||||
action = "<nop>";
|
|
||||||
noremap = false;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
insert = mkIf cfg.disableArrows {
|
insert = mkIf cfg.disableArrows {
|
||||||
"<up>" = {
|
"<up>" = {
|
||||||
|
|
|
@ -33,7 +33,7 @@ in {
|
||||||
startPlugins = [
|
startPlugins = [
|
||||||
"chatgpt"
|
"chatgpt"
|
||||||
];
|
];
|
||||||
pluginRC.chagpt = entryAnywhere ''
|
luaConfigRC.chagpt = entryAnywhere ''
|
||||||
require("chatgpt").setup(${toLuaObject cfg.setupOpts})
|
require("chatgpt").setup(${toLuaObject cfg.setupOpts})
|
||||||
'';
|
'';
|
||||||
maps.normal = mkMerge [
|
maps.normal = mkMerge [
|
||||||
|
|
|
@ -30,14 +30,14 @@ in {
|
||||||
"copilot-lua"
|
"copilot-lua"
|
||||||
# cfg.copilotNodePackage
|
# cfg.copilotNodePackage
|
||||||
]
|
]
|
||||||
++ optionals cfg.cmp.enable [
|
++ optionals (cfg.cmp.enable) [
|
||||||
"copilot-cmp"
|
"copilot-cmp"
|
||||||
];
|
];
|
||||||
|
|
||||||
vim.pluginRC.copilot = entryAnywhere ''
|
vim.luaConfigRC.copilot = entryAnywhere ''
|
||||||
require("copilot").setup(${toLuaObject cfg.setupOpts})
|
require("copilot").setup(${toLuaObject cfg.setupOpts})
|
||||||
|
|
||||||
${lib.optionalString cfg.cmp.enable ''
|
${lib.optionalString (cfg.cmp.enable) ''
|
||||||
require("copilot_cmp").setup()
|
require("copilot_cmp").setup()
|
||||||
''}
|
''}
|
||||||
'';
|
'';
|
||||||
|
|
|
@ -4,16 +4,17 @@
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.modules) mkIf;
|
inherit (lib.modules) mkIf;
|
||||||
inherit (lib.trivial) boolToString;
|
inherit (lib.strings) optionalString;
|
||||||
inherit (lib.nvim.dag) entryAnywhere;
|
inherit (lib.nvim.dag) entryAnywhere;
|
||||||
|
inherit (lib.nvim.lua) toLuaObject;
|
||||||
|
|
||||||
cfg = config.vim.autopairs;
|
cfg = config.vim.autopairs;
|
||||||
in {
|
in {
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
vim.startPlugins = ["nvim-autopairs"];
|
vim.startPlugins = ["nvim-autopairs"];
|
||||||
|
|
||||||
vim.pluginRC.autopairs = entryAnywhere ''
|
vim.luaConfigRC.autopairs = entryAnywhere ''
|
||||||
require("nvim-autopairs").setup({ map_cr = ${boolToString (!config.vim.autocomplete.enable)} })
|
require("nvim-autopairs").setup{}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,7 @@ in {
|
||||||
(mkBinding cfg.mappings.toggleSelectedBlock "<Plug>(comment_toggle_blockwise_visual)" mappings.toggleSelectedBlock.description)
|
(mkBinding cfg.mappings.toggleSelectedBlock "<Plug>(comment_toggle_blockwise_visual)" mappings.toggleSelectedBlock.description)
|
||||||
];
|
];
|
||||||
|
|
||||||
vim.pluginRC.comment-nvim = entryAnywhere ''
|
vim.luaConfigRC.comment-nvim = entryAnywhere ''
|
||||||
require('Comment').setup({
|
require('Comment').setup({
|
||||||
mappings = { basic = false, extra = false, },
|
mappings = { basic = false, extra = false, },
|
||||||
})
|
})
|
||||||
|
|
|
@ -61,19 +61,15 @@ in {
|
||||||
(mkSetLuaBinding mappings.complete ''
|
(mkSetLuaBinding mappings.complete ''
|
||||||
require('cmp').complete
|
require('cmp').complete
|
||||||
'')
|
'')
|
||||||
(let
|
(mkSetLuaBinding mappings.confirm ''
|
||||||
defaultKeys =
|
function()
|
||||||
if config.vim.autopairs.enable
|
if not require('cmp').confirm({ select = true }) then
|
||||||
then "require('nvim-autopairs').autopairs_cr()"
|
local termcode = vim.api.nvim_replace_termcodes(${toJSON mappings.confirm.value}, true, false, true)
|
||||||
else "vim.api.nvim_replace_termcodes(${toJSON mappings.confirm.value}, true, false, true)";
|
|
||||||
in
|
vim.fn.feedkeys(termcode, 'n')
|
||||||
mkSetLuaBinding mappings.confirm ''
|
|
||||||
function()
|
|
||||||
if not require('cmp').confirm({ select = true }) then
|
|
||||||
vim.fn.feedkeys(${defaultKeys}, 'n')
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
'')
|
end
|
||||||
|
'')
|
||||||
(mkSetLuaBinding mappings.next ''
|
(mkSetLuaBinding mappings.next ''
|
||||||
function()
|
function()
|
||||||
local has_words_before = function()
|
local has_words_before = function()
|
||||||
|
@ -186,7 +182,7 @@ in {
|
||||||
|
|
||||||
# TODO: alternative snippet engines to vsnip
|
# TODO: alternative snippet engines to vsnip
|
||||||
# https://github.com/hrsh7th/nvim-cmp/blob/main/doc/cmp.txt#L82
|
# https://github.com/hrsh7th/nvim-cmp/blob/main/doc/cmp.txt#L82
|
||||||
vim.pluginRC.completion = mkIf (cfg.type == "nvim-cmp") (dagPlacement ''
|
vim.luaConfigRC.completion = mkIf (cfg.type == "nvim-cmp") (dagPlacement ''
|
||||||
local nvim_cmp_menu_map = function(entry, vim_item)
|
local nvim_cmp_menu_map = function(entry, vim_item)
|
||||||
-- name for each source
|
-- name for each source
|
||||||
vim_item.menu = ({
|
vim_item.menu = ({
|
||||||
|
|
|
@ -16,7 +16,7 @@ in {
|
||||||
|
|
||||||
# the entire credit for this dashboard configuration to https://github.com/Rishabh672003
|
# the entire credit for this dashboard configuration to https://github.com/Rishabh672003
|
||||||
# honestly, excellent work
|
# honestly, excellent work
|
||||||
vim.pluginRC.alpha = entryAnywhere ''
|
vim.luaConfigRC.alpha = entryAnywhere ''
|
||||||
local alpha = require("alpha")
|
local alpha = require("alpha")
|
||||||
local plenary_path = require("plenary.path")
|
local plenary_path = require("plenary.path")
|
||||||
local dashboard = require("alpha.themes.dashboard")
|
local dashboard = require("alpha.themes.dashboard")
|
||||||
|
|
|
@ -5,17 +5,16 @@
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.modules) mkIf;
|
inherit (lib.modules) mkIf;
|
||||||
inherit (lib.nvim.dag) entryAnywhere;
|
inherit (lib.nvim.dag) entryAnywhere;
|
||||||
inherit (lib.nvim.lua) toLuaObject;
|
|
||||||
|
|
||||||
cfg = config.vim.dashboard.dashboard-nvim;
|
cfg = config.vim.dashboard.dashboard-nvim;
|
||||||
in {
|
in {
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
vim = {
|
vim.startPlugins = [
|
||||||
startPlugins = ["dashboard-nvim"];
|
"dashboard-nvim"
|
||||||
|
];
|
||||||
|
|
||||||
pluginRC.dashboard-nvim = entryAnywhere ''
|
vim.luaConfigRC.dashboard-nvim = entryAnywhere ''
|
||||||
require("dashboard").setup(${toLuaObject cfg.setupOpts})
|
require("dashboard").setup{}
|
||||||
'';
|
'';
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
{lib, ...}: let
|
{lib, ...}: let
|
||||||
inherit (lib.options) mkEnableOption;
|
inherit (lib.options) mkEnableOption;
|
||||||
inherit (lib.nvim.types) mkPluginSetupOption;
|
|
||||||
in {
|
in {
|
||||||
options.vim.dashboard.dashboard-nvim = {
|
options.vim.dashboard.dashboard-nvim = {
|
||||||
enable = mkEnableOption "Fancy and Blazing Fast start screen plugin of neovim [dashboard.nvim]";
|
enable = mkEnableOption "Fancy and Blazing Fast start screen plugin of neovim [dashboard.nvim]";
|
||||||
setupOpts = mkPluginSetupOption "dashboard.nvim" {};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.modules) mkIf;
|
inherit (lib.modules) mkIf;
|
||||||
|
inherit (lib.nvim.vim) mkVimBool;
|
||||||
|
|
||||||
cfg = config.vim.dashboard.startify;
|
cfg = config.vim.dashboard.startify;
|
||||||
in {
|
in {
|
||||||
|
@ -22,28 +23,28 @@ in {
|
||||||
else cfg.customFooter;
|
else cfg.customFooter;
|
||||||
"startify_bookmarks" = cfg.bookmarks;
|
"startify_bookmarks" = cfg.bookmarks;
|
||||||
"startify_lists" = cfg.lists;
|
"startify_lists" = cfg.lists;
|
||||||
"startify_change_to_dir" = cfg.changeToDir;
|
"startify_change_to_dir" = mkVimBool cfg.changeToDir;
|
||||||
"startify_change_to_vcs_root" = cfg.changeToVCRoot;
|
"startify_change_to_vcs_root" = mkVimBool cfg.changeToVCRoot;
|
||||||
"startify_change_cmd" = cfg.changeDirCmd;
|
"startify_change_cmd" = cfg.changeDirCmd;
|
||||||
"startify_skiplist" = cfg.skipList;
|
"startify_skiplist" = cfg.skipList;
|
||||||
"startify_update_oldfiles" = cfg.updateOldFiles;
|
"startify_update_oldfiles" = mkVimBool cfg.updateOldFiles;
|
||||||
"startify_session_autoload" = cfg.sessionAutoload;
|
"startify_session_autoload" = mkVimBool cfg.sessionAutoload;
|
||||||
"startify_commands" = cfg.commands;
|
"startify_commands" = cfg.commands;
|
||||||
"startify_files_number" = cfg.filesNumber;
|
"startify_files_number" = cfg.filesNumber;
|
||||||
"startify_custom_indices" = cfg.customIndices;
|
"startify_custom_indices" = cfg.customIndices;
|
||||||
"startify_disable_at_vimenter" = cfg.disableOnStartup;
|
"startify_disable_at_vimenter" = mkVimBool cfg.disableOnStartup;
|
||||||
"startify_enable_unsafe" = cfg.unsafe;
|
"startify_enable_unsafe" = mkVimBool cfg.unsafe;
|
||||||
"startify_padding_left" = cfg.paddingLeft;
|
"startify_padding_left" = cfg.paddingLeft;
|
||||||
"startify_use_env" = cfg.useEnv;
|
"startify_use_env" = mkVimBool cfg.useEnv;
|
||||||
"startify_session_before_save" = cfg.sessionBeforeSave;
|
"startify_session_before_save" = cfg.sessionBeforeSave;
|
||||||
"startify_session_persistence" = cfg.sessionPersistence;
|
"startify_session_persistence" = mkVimBool cfg.sessionPersistence;
|
||||||
"startify_session_delete_buffers" = cfg.sessionDeleteBuffers;
|
"startify_session_delete_buffers" = mkVimBool cfg.sessionDeleteBuffers;
|
||||||
"startify_session_dir" = cfg.sessionDir;
|
"startify_session_dir" = cfg.sessionDir;
|
||||||
"startify_skiplist_server" = cfg.skipListServer;
|
"startify_skiplist_server" = cfg.skipListServer;
|
||||||
"startify_session_remove_lines" = cfg.sessionRemoveLines;
|
"startify_session_remove_lines" = cfg.sessionRemoveLines;
|
||||||
"startify_session_savevars" = cfg.sessionSavevars;
|
"startify_session_savevars" = cfg.sessionSavevars;
|
||||||
"startify_session_savecmds" = cfg.sessionSavecmds;
|
"startify_session_savecmds" = cfg.sessionSavecmds;
|
||||||
"startify_session_sort" = cfg.sessionSort;
|
"startify_session_sort" = mkVimBool cfg.sessionSort;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
{lib, ...}: let
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
inherit (lib.options) mkEnableOption mkOption;
|
inherit (lib.options) mkEnableOption mkOption;
|
||||||
inherit (lib.types) listOf attrs bool enum str oneOf int;
|
inherit (lib.types) listOf attrs bool enum str oneOf int;
|
||||||
in {
|
in {
|
||||||
|
|
|
@ -18,7 +18,7 @@ in {
|
||||||
(mkIf cfg.enable {
|
(mkIf cfg.enable {
|
||||||
vim.startPlugins = ["nvim-dap"];
|
vim.startPlugins = ["nvim-dap"];
|
||||||
|
|
||||||
vim.pluginRC =
|
vim.luaConfigRC =
|
||||||
{
|
{
|
||||||
# TODO customizable keymaps
|
# TODO customizable keymaps
|
||||||
nvim-dap = entryAnywhere ''
|
nvim-dap = entryAnywhere ''
|
||||||
|
@ -51,7 +51,7 @@ in {
|
||||||
(mkIf (cfg.enable && cfg.ui.enable) {
|
(mkIf (cfg.enable && cfg.ui.enable) {
|
||||||
vim.startPlugins = ["nvim-dap-ui" "nvim-nio"];
|
vim.startPlugins = ["nvim-dap-ui" "nvim-nio"];
|
||||||
|
|
||||||
vim.pluginRC.nvim-dap-ui = entryAfter ["nvim-dap"] (''
|
vim.luaConfigRC.nvim-dap-ui = entryAfter ["nvim-dap"] (''
|
||||||
local dapui = require("dapui")
|
local dapui = require("dapui")
|
||||||
dapui.setup()
|
dapui.setup()
|
||||||
''
|
''
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./nvimtree
|
./nvimtree
|
||||||
./neo-tree
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,30 +0,0 @@
|
||||||
{
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
inherit (lib.modules) mkIf;
|
|
||||||
inherit (lib.nvim.dag) entryAnywhere;
|
|
||||||
inherit (lib.nvim.lua) toLuaObject;
|
|
||||||
|
|
||||||
cfg = config.vim.filetree.neo-tree;
|
|
||||||
in {
|
|
||||||
config = mkIf cfg.enable {
|
|
||||||
vim = {
|
|
||||||
startPlugins = [
|
|
||||||
# dependencies
|
|
||||||
"plenary-nvim" # commons library
|
|
||||||
"image-nvim" # optional for image previews
|
|
||||||
"nui-nvim" # ui library
|
|
||||||
# neotree
|
|
||||||
"neo-tree-nvim"
|
|
||||||
];
|
|
||||||
|
|
||||||
visuals.nvimWebDevicons.enable = true;
|
|
||||||
|
|
||||||
pluginRC.neo-tree = entryAnywhere ''
|
|
||||||
require("neo-tree").setup(${toLuaObject cfg.setupOpts})
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,155 +0,0 @@
|
||||||
{lib, ...}: let
|
|
||||||
inherit (lib.types) bool str int submodule enum either listOf;
|
|
||||||
inherit (lib.options) mkOption mkEnableOption literalExpression;
|
|
||||||
inherit (lib.nvim.types) mkPluginSetupOption;
|
|
||||||
in {
|
|
||||||
options.vim.filetree.neo-tree = {
|
|
||||||
enable = mkEnableOption "filetree via neo-tree.nvim";
|
|
||||||
|
|
||||||
# Permalink:
|
|
||||||
# https://github.com/nvim-neo-tree/neo-tree.nvim/blob/22e566aeb075c94f670f34077e05ba95190dfb4a/lua/neo-tree/defaults.lua
|
|
||||||
setupOpts = mkPluginSetupOption "neo-tree" {
|
|
||||||
add_blank_line_at_top = mkOption {
|
|
||||||
type = bool;
|
|
||||||
default = false;
|
|
||||||
description = ''
|
|
||||||
Whether to add a blank line at the top of the tree
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
auto_clean_after_session_restore = mkOption {
|
|
||||||
type = bool;
|
|
||||||
default = false;
|
|
||||||
description = ''
|
|
||||||
Whether to automatically clean up broken neo-tree buffers
|
|
||||||
saved in sessions
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
default_source = mkOption {
|
|
||||||
type = str;
|
|
||||||
default = "filesystem";
|
|
||||||
description = ''
|
|
||||||
You can choose a specific source.
|
|
||||||
|
|
||||||
`last` here which indicates the last used source
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
enable_diagnostics = mkEnableOption "diagnostics" // {default = true;};
|
|
||||||
enable_git_status = mkEnableOption "git status" // {default = true;};
|
|
||||||
enable_modified_markers = mkEnableOption "markers for files with unsaved changes." // {default = true;};
|
|
||||||
enable_opened_markers =
|
|
||||||
mkEnableOption ''
|
|
||||||
tracking of opened files.
|
|
||||||
|
|
||||||
Required for `components.name.highlight_opened_files`
|
|
||||||
''
|
|
||||||
// {default = true;};
|
|
||||||
|
|
||||||
enable_refresh_on_write =
|
|
||||||
mkEnableOption ''
|
|
||||||
Refresh the tree when a file is written.
|
|
||||||
|
|
||||||
Only used if `use_libuv_file_watcher` is false.
|
|
||||||
''
|
|
||||||
// {default = true;};
|
|
||||||
|
|
||||||
enable_cursor_hijack = mkEnableOption ''
|
|
||||||
cursor hijacking.
|
|
||||||
|
|
||||||
If enabled neotree will keep the cursor on the first letter of the filename when moving in the tree
|
|
||||||
'';
|
|
||||||
|
|
||||||
git_status_async = mkEnableOption ''
|
|
||||||
async git status.
|
|
||||||
|
|
||||||
This will make the git status check async and will not block the UI.
|
|
||||||
'';
|
|
||||||
|
|
||||||
/*
|
|
||||||
git_status_async_options = mkOption {
|
|
||||||
description = "These options are for people with VERY large git repos";
|
|
||||||
type = submodule {
|
|
||||||
batch_size = mkOption {
|
|
||||||
type = int;
|
|
||||||
default = 1000;
|
|
||||||
description = "How many lines of git status results to process at a time";
|
|
||||||
};
|
|
||||||
|
|
||||||
batch_delay = mkOption {
|
|
||||||
type = int;
|
|
||||||
default = 10;
|
|
||||||
description = "Delay, in ms, between batches. Spreads out the workload to let other processes run";
|
|
||||||
};
|
|
||||||
|
|
||||||
max_lines = mkOption {
|
|
||||||
type = int;
|
|
||||||
default = 10000;
|
|
||||||
description = ''
|
|
||||||
How many lines of git status results to process.
|
|
||||||
|
|
||||||
Anything after this will be dropped. Anything before this will be used.
|
|
||||||
The last items to be processed are the untracked files.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
*/
|
|
||||||
|
|
||||||
hide_root_node = mkOption {
|
|
||||||
type = bool;
|
|
||||||
default = false;
|
|
||||||
description = ''
|
|
||||||
Whether to hide the root node of the tree
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
retain_hidden_root_indent = mkOption {
|
|
||||||
type = bool;
|
|
||||||
default = false;
|
|
||||||
description = ''
|
|
||||||
Whether to retain the indent of the hidden root node
|
|
||||||
|
|
||||||
IF the root node is hidden, keep the indentation anyhow.
|
|
||||||
This is needed if you use expanders because they render in the indent.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
log_level = mkOption {
|
|
||||||
type = enum ["trace" "debug" "info" "warn" "error" "fatal"];
|
|
||||||
default = "info";
|
|
||||||
description = "Log level for the plugin.";
|
|
||||||
};
|
|
||||||
|
|
||||||
log_to_file = mkOption {
|
|
||||||
type = either bool str;
|
|
||||||
default = false;
|
|
||||||
example = literalExpression "/tmp/neo-tree.log";
|
|
||||||
description = ''
|
|
||||||
Must be either a boolean or a path to your log file.
|
|
||||||
|
|
||||||
Use :NeoTreeLogs to show the file
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
open_files_in_last_window = mkOption {
|
|
||||||
type = bool;
|
|
||||||
default = true;
|
|
||||||
description = ''
|
|
||||||
Whether to open files in the last window
|
|
||||||
|
|
||||||
If disabled, neo-tree will open files in top left window
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
open_files_do_not_replace_types = mkOption {
|
|
||||||
type = listOf str;
|
|
||||||
default = ["terminal" "Trouble" "qf" "edgy"];
|
|
||||||
description = ''
|
|
||||||
A list of filetypes that should not be replaced when opening a file
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -29,7 +29,7 @@ in {
|
||||||
"<leader>t" = "+NvimTree";
|
"<leader>t" = "+NvimTree";
|
||||||
};
|
};
|
||||||
|
|
||||||
vim.pluginRC.nvimtreelua = entryAnywhere ''
|
vim.luaConfigRC.nvimtreelua = entryAnywhere ''
|
||||||
${
|
${
|
||||||
optionalString cfg.setupOpts.disable_netrw ''
|
optionalString cfg.setupOpts.disable_netrw ''
|
||||||
-- disable netrew completely
|
-- disable netrew completely
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{
|
_: {
|
||||||
imports = [
|
imports = [
|
||||||
./config.nix
|
./config.nix
|
||||||
./nvimtree.nix
|
./nvimtree.nix
|
||||||
|
|
|
@ -69,7 +69,7 @@ in {
|
||||||
"<leader>g" = "+Gitsigns";
|
"<leader>g" = "+Gitsigns";
|
||||||
};
|
};
|
||||||
|
|
||||||
pluginRC.gitsigns = entryAnywhere ''
|
luaConfigRC.gitsigns = entryAnywhere ''
|
||||||
require('gitsigns').setup{}
|
require('gitsigns').setup{}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,24 +1,22 @@
|
||||||
{
|
{
|
||||||
config,
|
|
||||||
pkgs,
|
pkgs,
|
||||||
|
config,
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (builtins) attrNames;
|
inherit (builtins) attrNames;
|
||||||
inherit (lib.options) mkOption mkEnableOption literalExpression;
|
inherit (lib.options) mkOption mkEnableOption literalExpression;
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
|
||||||
inherit (lib.lists) isList;
|
inherit (lib.lists) isList;
|
||||||
inherit (lib.types) enum either package listOf str bool;
|
inherit (lib.types) enum either package listOf str bool;
|
||||||
inherit (lib.nvim.languages) diagnosticsToLua;
|
|
||||||
inherit (lib.nvim.types) diagnostics mkGrammarOption;
|
|
||||||
inherit (lib.nvim.lua) expToLua;
|
inherit (lib.nvim.lua) expToLua;
|
||||||
|
inherit (lib.nvim.types) diagnostics mkGrammarOption;
|
||||||
|
|
||||||
cfg = config.vim.languages.bash;
|
cfg = config.vim.languages.bash;
|
||||||
|
|
||||||
defaultServer = "bash-ls";
|
defaultServer = "bash-ls";
|
||||||
servers = {
|
servers = {
|
||||||
bash-ls = {
|
bash-ls = {
|
||||||
package = pkgs.bash-language-server;
|
package = pkgs.nodePackages.bash-language-server;
|
||||||
lspConfig = ''
|
lspConfig = ''
|
||||||
lspconfig.bashls.setup{
|
lspconfig.bashls.setup{
|
||||||
capabilities = capabilities;
|
capabilities = capabilities;
|
||||||
|
@ -57,7 +55,6 @@
|
||||||
ls_sources,
|
ls_sources,
|
||||||
null_ls.builtins.diagnostics.shellcheck.with({
|
null_ls.builtins.diagnostics.shellcheck.with({
|
||||||
command = "${pkg}/bin/shellcheck",
|
command = "${pkg}/bin/shellcheck",
|
||||||
diagnostics_format = "#{m} [#{c}]"
|
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
'';
|
'';
|
||||||
|
@ -85,7 +82,7 @@ in {
|
||||||
description = "bash-language-server package, or the command to run as a list of strings";
|
description = "bash-language-server package, or the command to run as a list of strings";
|
||||||
example = literalExpression ''[lib.getExe pkgs.nodePackages.bash-language-server "start"]'';
|
example = literalExpression ''[lib.getExe pkgs.nodePackages.bash-language-server "start"]'';
|
||||||
type = either package (listOf str);
|
type = either package (listOf str);
|
||||||
default = pkgs.bash-language-server;
|
default = pkgs.nodePackages.bash-language-server;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -117,30 +114,4 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable (mkMerge [
|
|
||||||
(mkIf cfg.treesitter.enable {
|
|
||||||
vim.treesitter.enable = true;
|
|
||||||
vim.treesitter.grammars = [cfg.treesitter.package];
|
|
||||||
})
|
|
||||||
|
|
||||||
(mkIf cfg.lsp.enable {
|
|
||||||
vim.lsp.lspconfig.enable = true;
|
|
||||||
vim.lsp.lspconfig.sources.bash-lsp = servers.${cfg.lsp.server}.lspConfig;
|
|
||||||
})
|
|
||||||
|
|
||||||
(mkIf cfg.format.enable {
|
|
||||||
vim.lsp.null-ls.enable = true;
|
|
||||||
vim.lsp.null-ls.sources.bash-format = formats.${cfg.format.type}.nullConfig;
|
|
||||||
})
|
|
||||||
|
|
||||||
(mkIf cfg.extraDiagnostics.enable {
|
|
||||||
vim.lsp.null-ls.enable = true;
|
|
||||||
vim.lsp.null-ls.sources = diagnosticsToLua {
|
|
||||||
lang = "bash";
|
|
||||||
config = cfg.extraDiagnostics.types;
|
|
||||||
inherit diagnosticsProviders;
|
|
||||||
};
|
|
||||||
})
|
|
||||||
]);
|
|
||||||
}
|
}
|
83
modules/plugins/languages/bash/config.nix
Normal file
83
modules/plugins/languages/bash/config.nix
Normal file
|
@ -0,0 +1,83 @@
|
||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib.lists) isList;
|
||||||
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
|
inherit (lib.nvim.lua) expToLua;
|
||||||
|
inherit (lib.nvim.languages) diagnosticsToLua;
|
||||||
|
|
||||||
|
cfg = config.vim.languages.bash;
|
||||||
|
diagnosticsProviders = {
|
||||||
|
shellcheck = {
|
||||||
|
package = pkgs.shellcheck;
|
||||||
|
nullConfig = pkg: ''
|
||||||
|
table.insert(
|
||||||
|
ls_sources,
|
||||||
|
null_ls.builtins.diagnostics.shellcheck.with({
|
||||||
|
command = "${pkg}/bin/shellcheck",
|
||||||
|
})
|
||||||
|
)
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
formats = {
|
||||||
|
shfmt = {
|
||||||
|
package = pkgs.shfmt;
|
||||||
|
nullConfig = ''
|
||||||
|
table.insert(
|
||||||
|
ls_sources,
|
||||||
|
null_ls.builtins.formatting.shfmt.with({
|
||||||
|
command = "${pkgs.shfmt}/bin/shfmt",
|
||||||
|
})
|
||||||
|
)
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
servers = {
|
||||||
|
bash-ls = {
|
||||||
|
package = pkgs.nodePackages.bash-language-server;
|
||||||
|
lspConfig = ''
|
||||||
|
lspconfig.bashls.setup{
|
||||||
|
capabilities = capabilities;
|
||||||
|
on_attach = default_on_attach;
|
||||||
|
cmd = ${
|
||||||
|
if isList cfg.lsp.package
|
||||||
|
then expToLua cfg.lsp.package
|
||||||
|
else ''{"${cfg.lsp.package}/bin/bash-language-server", "start"}''
|
||||||
|
};
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
config = mkIf cfg.enable (mkMerge [
|
||||||
|
(mkIf cfg.treesitter.enable {
|
||||||
|
vim.treesitter.enable = true;
|
||||||
|
vim.treesitter.grammars = [cfg.treesitter.package];
|
||||||
|
})
|
||||||
|
|
||||||
|
(mkIf cfg.lsp.enable {
|
||||||
|
vim.lsp.lspconfig.enable = true;
|
||||||
|
vim.lsp.lspconfig.sources.bash-lsp = servers.${cfg.lsp.server}.lspConfig;
|
||||||
|
})
|
||||||
|
|
||||||
|
(mkIf cfg.format.enable {
|
||||||
|
vim.lsp.null-ls.enable = true;
|
||||||
|
vim.lsp.null-ls.sources.bash-format = formats.${cfg.format.type}.nullConfig;
|
||||||
|
})
|
||||||
|
|
||||||
|
(mkIf cfg.extraDiagnostics.enable {
|
||||||
|
vim.lsp.null-ls.enable = true;
|
||||||
|
vim.lsp.null-ls.sources = diagnosticsToLua {
|
||||||
|
lang = "bash";
|
||||||
|
config = cfg.extraDiagnostics.types;
|
||||||
|
inherit diagnosticsProviders;
|
||||||
|
};
|
||||||
|
})
|
||||||
|
]);
|
||||||
|
}
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./otter.nix
|
./bash.nix
|
||||||
./config.nix
|
./config.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
|
@ -12,7 +12,7 @@
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
inherit (lib.nvim.lua) expToLua;
|
inherit (lib.nvim.lua) expToLua;
|
||||||
inherit (lib.nvim.types) mkGrammarOption;
|
inherit (lib.nvim.types) mkGrammarOption;
|
||||||
inherit (lib.nvim.dag) entryAfter;
|
inherit (lib.nvim.dag) entryAnywhere;
|
||||||
|
|
||||||
packageToCmd = package: defaultCmd:
|
packageToCmd = package: defaultCmd:
|
||||||
if isList cfg.lsp.package
|
if isList cfg.lsp.package
|
||||||
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
cfg = config.vim.languages.clang;
|
cfg = config.vim.languages.clang;
|
||||||
|
|
||||||
defaultServer = "clangd";
|
defaultServer = "ccls";
|
||||||
servers = {
|
servers = {
|
||||||
ccls = {
|
ccls = {
|
||||||
package = pkgs.ccls;
|
package = pkgs.ccls;
|
||||||
|
@ -35,7 +35,7 @@
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
clangd = {
|
clangd = {
|
||||||
package = pkgs.clang-tools;
|
package = pkgs.clang-tools_16;
|
||||||
lspConfig = ''
|
lspConfig = ''
|
||||||
local clangd_cap = capabilities
|
local clangd_cap = capabilities
|
||||||
-- use same offsetEncoding as null-ls
|
-- use same offsetEncoding as null-ls
|
||||||
|
@ -57,7 +57,7 @@
|
||||||
dapConfig = ''
|
dapConfig = ''
|
||||||
dap.adapters.lldb = {
|
dap.adapters.lldb = {
|
||||||
type = 'executable',
|
type = 'executable',
|
||||||
command = '${cfg.dap.package}/bin/lldb-dap',
|
command = '${cfg.dap.package}/bin/lldb-vscode',
|
||||||
name = 'lldb'
|
name = 'lldb'
|
||||||
}
|
}
|
||||||
dap.configurations.cpp = {
|
dap.configurations.cpp = {
|
||||||
|
@ -141,7 +141,7 @@ in {
|
||||||
|
|
||||||
config = mkIf cfg.enable (mkMerge [
|
config = mkIf cfg.enable (mkMerge [
|
||||||
(mkIf cfg.cHeader {
|
(mkIf cfg.cHeader {
|
||||||
vim.pluginRC.c-header = entryAfter ["basic"] "vim.g.c_syntax_for_h = 1";
|
vim.configRC.c-header = entryAnywhere "let g:c_syntax_for_h = 1";
|
||||||
})
|
})
|
||||||
|
|
||||||
(mkIf cfg.treesitter.enable {
|
(mkIf cfg.treesitter.enable {
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
defaultServer = "vscode-langservers-extracted";
|
defaultServer = "vscode-langservers-extracted";
|
||||||
servers = {
|
servers = {
|
||||||
vscode-langservers-extracted = {
|
vscode-langservers-extracted = {
|
||||||
package = pkgs.vscode-langservers-extracted;
|
package = pkgs.nodePackages.vscode-langservers-extracted;
|
||||||
lspConfig = ''
|
lspConfig = ''
|
||||||
-- enable (broadcasting) snippet capability for completion
|
-- enable (broadcasting) snippet capability for completion
|
||||||
-- see <https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#cssls>
|
-- see <https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#cssls>
|
||||||
|
|
76
modules/plugins/languages/dart/config.nix
Normal file
76
modules/plugins/languages/dart/config.nix
Normal file
|
@ -0,0 +1,76 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib.lists) isList;
|
||||||
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
|
inherit (lib.strings) optionalString;
|
||||||
|
inherit (lib.trivial) boolToString;
|
||||||
|
inherit (lib.nvim.lua) expToLua;
|
||||||
|
inherit (lib.nvim.dag) entryAnywhere;
|
||||||
|
|
||||||
|
cfg = config.vim.languages.dart;
|
||||||
|
ftcfg = cfg.flutter-tools;
|
||||||
|
servers = {
|
||||||
|
dart = {
|
||||||
|
package = pkgs.dart;
|
||||||
|
lspConfig = ''
|
||||||
|
lspconfig.dartls.setup{
|
||||||
|
capabilities = capabilities;
|
||||||
|
on_attach=default_on_attach;
|
||||||
|
cmd = ${
|
||||||
|
if isList cfg.lsp.package
|
||||||
|
then expToLua cfg.lsp.package
|
||||||
|
else ''{"${cfg.lsp.package}/bin/dart", "language-server", "--protocol=lsp"}''
|
||||||
|
};
|
||||||
|
${optionalString (cfg.lsp.opts != null) "init_options = ${cfg.lsp.dartOpts}"}
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
config = mkIf cfg.enable (mkMerge [
|
||||||
|
(mkIf cfg.treesitter.enable {
|
||||||
|
vim.treesitter.enable = true;
|
||||||
|
vim.treesitter.grammars = [cfg.treesitter.package];
|
||||||
|
})
|
||||||
|
|
||||||
|
(mkIf cfg.lsp.enable {
|
||||||
|
vim.lsp.lspconfig.enable = true;
|
||||||
|
|
||||||
|
vim.lsp.lspconfig.sources.dart-lsp = servers.${cfg.lsp.server}.lspConfig;
|
||||||
|
})
|
||||||
|
|
||||||
|
(mkIf ftcfg.enable {
|
||||||
|
vim.startPlugins =
|
||||||
|
if ftcfg.enableNoResolvePatch
|
||||||
|
then ["flutter-tools-patched"]
|
||||||
|
else ["flutter-tools"];
|
||||||
|
|
||||||
|
vim.luaConfigRC.flutter-tools = entryAnywhere ''
|
||||||
|
require('flutter-tools').setup {
|
||||||
|
lsp = {
|
||||||
|
color = { -- show the derived colours for dart variables
|
||||||
|
enabled = ${boolToString ftcfg.color.enable}, -- whether or not to highlight color variables at all, only supported on flutter >= 2.10
|
||||||
|
background = ${boolToString ftcfg.color.highlightBackground}, -- highlight the background
|
||||||
|
foreground = ${boolToString ftcfg.color.highlightForeground}, -- highlight the foreground
|
||||||
|
virtual_text = ${boolToString ftcfg.color.virtualText.enable}, -- show the highlight using virtual text
|
||||||
|
virtual_text_str = ${ftcfg.color.virtualText.character} -- the virtual text character to highlight
|
||||||
|
},
|
||||||
|
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = default_on_attach;
|
||||||
|
flags = lsp_flags,
|
||||||
|
},
|
||||||
|
${optionalString cfg.dap.enable ''
|
||||||
|
debugger = {
|
||||||
|
enabled = true,
|
||||||
|
},
|
||||||
|
''}
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
})
|
||||||
|
]);
|
||||||
|
}
|
|
@ -1,23 +1,18 @@
|
||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
pkgs,
|
|
||||||
lib,
|
lib,
|
||||||
|
pkgs,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (builtins) attrNames;
|
inherit (builtins) attrNames;
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
|
||||||
inherit (lib.trivial) boolToString;
|
|
||||||
inherit (lib.lists) isList;
|
inherit (lib.lists) isList;
|
||||||
inherit (lib.options) mkEnableOption mkOption;
|
inherit (lib.options) mkEnableOption mkOption;
|
||||||
inherit (lib.types) enum either listOf package nullOr str bool;
|
inherit (lib.types) enum either listOf package nullOr str bool;
|
||||||
inherit (lib.strings) optionalString;
|
inherit (lib.strings) optionalString;
|
||||||
inherit (lib.nvim.lua) expToLua;
|
inherit (lib.nvim.lua) expToLua;
|
||||||
inherit (lib.nvim.types) mkGrammarOption;
|
inherit (lib.nvim.types) mkGrammarOption;
|
||||||
inherit (lib.nvim.dag) entryAnywhere;
|
|
||||||
|
|
||||||
cfg = config.vim.languages.dart;
|
cfg = config.vim.languages.dart;
|
||||||
ftcfg = cfg.flutter-tools;
|
|
||||||
|
|
||||||
defaultServer = "dart";
|
defaultServer = "dart";
|
||||||
servers = {
|
servers = {
|
||||||
dart = {
|
dart = {
|
||||||
|
@ -53,16 +48,15 @@ in {
|
||||||
default = defaultServer;
|
default = defaultServer;
|
||||||
};
|
};
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
|
description = "Dart LSP server package, or the command to run as a list of strings";
|
||||||
|
example = ''[lib.getExe pkgs.jdt-language-server "-data" "~/.cache/jdtls/workspace"]'';
|
||||||
type = either package (listOf str);
|
type = either package (listOf str);
|
||||||
default = servers.${cfg.lsp.server}.package;
|
default = servers.${cfg.lsp.server}.package;
|
||||||
example = ''[lib.getExe pkgs.jdt-language-server "-data" "~/.cache/jdtls/workspace"]'';
|
|
||||||
description = "Dart LSP server package, or the command to run as a list of strings";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
opts = mkOption {
|
opts = mkOption {
|
||||||
|
description = "Options to pass to Dart LSP server";
|
||||||
type = nullOr str;
|
type = nullOr str;
|
||||||
default = null;
|
default = null;
|
||||||
description = "Options to pass to Dart LSP server";
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -76,26 +70,23 @@ in {
|
||||||
|
|
||||||
flutter-tools = {
|
flutter-tools = {
|
||||||
enable = mkOption {
|
enable = mkOption {
|
||||||
|
description = "Enable flutter-tools for flutter support";
|
||||||
type = bool;
|
type = bool;
|
||||||
default = config.vim.languages.enableLSP;
|
default = config.vim.languages.enableLSP;
|
||||||
description = "Enable flutter-tools for flutter support";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
enableNoResolvePatch = mkOption {
|
enableNoResolvePatch = mkOption {
|
||||||
|
description = ''
|
||||||
|
Patch flutter-tools so that it doesn't resolve symlinks when detecting flutter path.
|
||||||
|
This is required if you want to use a flutter package built with nix.
|
||||||
|
If you are using a flutter SDK installed from a different source and encounter the error "`dart` missing from PATH", disable this option.
|
||||||
|
'';
|
||||||
type = bool;
|
type = bool;
|
||||||
default = true;
|
default = true;
|
||||||
description = ''
|
|
||||||
Whether to patch flutter-tools so that it doesn't resolve
|
|
||||||
symlinks when detecting flutter path.
|
|
||||||
|
|
||||||
This is required if you want to use a flutter package built with nix.
|
|
||||||
If you are using a flutter SDK installed from a different source
|
|
||||||
and encounter the error "`dart` missing from PATH", disable this option.
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
|
|
||||||
color = {
|
color = {
|
||||||
enable = mkEnableOption "highlighting color variables";
|
enable = mkEnableOption "Whether or mot to highlight color variables at all";
|
||||||
|
|
||||||
highlightBackground = mkOption {
|
highlightBackground = mkOption {
|
||||||
type = bool;
|
type = bool;
|
||||||
|
@ -121,47 +112,4 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable (mkMerge [
|
|
||||||
(mkIf cfg.treesitter.enable {
|
|
||||||
vim.treesitter.enable = true;
|
|
||||||
vim.treesitter.grammars = [cfg.treesitter.package];
|
|
||||||
})
|
|
||||||
|
|
||||||
(mkIf cfg.lsp.enable {
|
|
||||||
vim.lsp.lspconfig.enable = true;
|
|
||||||
|
|
||||||
vim.lsp.lspconfig.sources.dart-lsp = servers.${cfg.lsp.server}.lspConfig;
|
|
||||||
})
|
|
||||||
|
|
||||||
(mkIf ftcfg.enable {
|
|
||||||
vim.startPlugins =
|
|
||||||
if ftcfg.enableNoResolvePatch
|
|
||||||
then ["flutter-tools-patched"]
|
|
||||||
else ["flutter-tools"];
|
|
||||||
|
|
||||||
vim.pluginRC.flutter-tools = entryAnywhere ''
|
|
||||||
require('flutter-tools').setup {
|
|
||||||
lsp = {
|
|
||||||
color = { -- show the derived colours for dart variables
|
|
||||||
enabled = ${boolToString ftcfg.color.enable}, -- whether or not to highlight color variables at all, only supported on flutter >= 2.10
|
|
||||||
background = ${boolToString ftcfg.color.highlightBackground}, -- highlight the background
|
|
||||||
foreground = ${boolToString ftcfg.color.highlightForeground}, -- highlight the foreground
|
|
||||||
virtual_text = ${boolToString ftcfg.color.virtualText.enable}, -- show the highlight using virtual text
|
|
||||||
virtual_text_str = ${ftcfg.color.virtualText.character} -- the virtual text character to highlight
|
|
||||||
},
|
|
||||||
|
|
||||||
capabilities = capabilities,
|
|
||||||
on_attach = default_on_attach;
|
|
||||||
flags = lsp_flags,
|
|
||||||
},
|
|
||||||
${optionalString cfg.dap.enable ''
|
|
||||||
debugger = {
|
|
||||||
enabled = true,
|
|
||||||
},
|
|
||||||
''}
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
})
|
|
||||||
]);
|
|
||||||
}
|
}
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
|
./dart.nix
|
||||||
./config.nix
|
./config.nix
|
||||||
./neo-tree.nix
|
|
||||||
];
|
];
|
||||||
}
|
}
|
|
@ -2,29 +2,28 @@
|
||||||
inherit (lib.nvim.languages) mkEnable;
|
inherit (lib.nvim.languages) mkEnable;
|
||||||
in {
|
in {
|
||||||
imports = [
|
imports = [
|
||||||
./bash.nix
|
./bash
|
||||||
./dart.nix
|
./dart
|
||||||
|
./elixir
|
||||||
|
./markdown
|
||||||
|
./tidal
|
||||||
|
|
||||||
./clang.nix
|
./clang.nix
|
||||||
./css.nix
|
./css.nix
|
||||||
./elixir.nix
|
|
||||||
./go.nix
|
./go.nix
|
||||||
./html.nix
|
./html.nix
|
||||||
./java.nix
|
./java.nix
|
||||||
./lua.nix
|
./lua.nix
|
||||||
./markdown.nix
|
|
||||||
./nim.nix
|
./nim.nix
|
||||||
./nix.nix
|
./nix.nix
|
||||||
./ocaml.nix
|
|
||||||
./php.nix
|
./php.nix
|
||||||
./python.nix
|
./python.nix
|
||||||
./r.nix
|
|
||||||
./rust.nix
|
./rust.nix
|
||||||
./sql.nix
|
./sql.nix
|
||||||
./svelte.nix
|
./svelte.nix
|
||||||
./tailwind.nix
|
./tailwind.nix
|
||||||
./terraform.nix
|
./terraform.nix
|
||||||
./ts.nix
|
./ts.nix
|
||||||
./typst.nix
|
|
||||||
./zig.nix
|
./zig.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -1,138 +0,0 @@
|
||||||
{
|
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
inherit (builtins) attrNames;
|
|
||||||
inherit (lib.options) mkEnableOption mkOption;
|
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
|
||||||
inherit (lib.lists) isList;
|
|
||||||
inherit (lib.types) enum either listOf package str;
|
|
||||||
inherit (lib.nvim.types) mkGrammarOption;
|
|
||||||
inherit (lib.nvim.lua) expToLua;
|
|
||||||
inherit (lib.nvim.dag) entryAnywhere;
|
|
||||||
|
|
||||||
cfg = config.vim.languages.elixir;
|
|
||||||
|
|
||||||
defaultServer = "elixirls";
|
|
||||||
servers = {
|
|
||||||
elixirls = {
|
|
||||||
package = pkgs.elixir-ls;
|
|
||||||
lspConfig = ''
|
|
||||||
-- elixirls setup
|
|
||||||
lspconfig.elixirls.setup {
|
|
||||||
capabilities = capabilities,
|
|
||||||
on_attach = default_on_attach,
|
|
||||||
cmd = ${
|
|
||||||
if isList cfg.lsp.package
|
|
||||||
then expToLua cfg.lsp.package
|
|
||||||
else ''{"${cfg.lsp.package}/bin/elixir-ls"}''
|
|
||||||
}
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
defaultFormat = "mix";
|
|
||||||
formats = {
|
|
||||||
mix = {
|
|
||||||
package = pkgs.elixir;
|
|
||||||
nullConfig = ''
|
|
||||||
table.insert(
|
|
||||||
ls_sources,
|
|
||||||
null_ls.builtins.formatting.mix.with({
|
|
||||||
command = "${cfg.format.package}/bin/mix",
|
|
||||||
})
|
|
||||||
)
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
in {
|
|
||||||
options.vim.languages.elixir = {
|
|
||||||
enable = mkEnableOption "Elixir language support";
|
|
||||||
|
|
||||||
treesitter = {
|
|
||||||
enable = mkEnableOption "Elixir treesitter" // {default = config.vim.languages.enableTreesitter;};
|
|
||||||
package = mkGrammarOption pkgs "elixir";
|
|
||||||
};
|
|
||||||
|
|
||||||
lsp = {
|
|
||||||
enable = mkEnableOption "Elixir LSP support" // {default = config.vim.languages.enableLSP;};
|
|
||||||
|
|
||||||
server = mkOption {
|
|
||||||
description = "Elixir LSP server to use";
|
|
||||||
type = enum (attrNames servers);
|
|
||||||
default = defaultServer;
|
|
||||||
};
|
|
||||||
|
|
||||||
package = mkOption {
|
|
||||||
description = "Elixir LSP server package, or the command to run as a list of strings";
|
|
||||||
example = ''[lib.getExe pkgs.jdt-language-server " - data " " ~/.cache/jdtls/workspace "]'';
|
|
||||||
type = either package (listOf str);
|
|
||||||
default = servers.${cfg.lsp.server}.package;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
format = {
|
|
||||||
enable = mkEnableOption "Elixir formatting" // {default = config.vim.languages.enableFormat;};
|
|
||||||
|
|
||||||
type = mkOption {
|
|
||||||
description = "Elixir formatter to use";
|
|
||||||
type = enum (attrNames formats);
|
|
||||||
default = defaultFormat;
|
|
||||||
};
|
|
||||||
|
|
||||||
package = mkOption {
|
|
||||||
description = "Elixir formatter package";
|
|
||||||
type = package;
|
|
||||||
default = formats.${cfg.format.type}.package;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
elixir-tools = {
|
|
||||||
enable = mkEnableOption "Elixir tools";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = mkIf cfg.enable (mkMerge [
|
|
||||||
(mkIf cfg.treesitter.enable {
|
|
||||||
vim.treesitter.enable = true;
|
|
||||||
vim.treesitter.grammars = [cfg.treesitter.package];
|
|
||||||
})
|
|
||||||
|
|
||||||
(mkIf cfg.lsp.enable {
|
|
||||||
vim.lsp.lspconfig.enable = true;
|
|
||||||
vim.lsp.lspconfig.sources.elixir-lsp = servers.${cfg.lsp.server}.lspConfig;
|
|
||||||
})
|
|
||||||
|
|
||||||
(mkIf cfg.format.enable {
|
|
||||||
vim.lsp.null-ls.enable = true;
|
|
||||||
vim.lsp.null-ls.sources.elixir-format = formats.${cfg.format.type}.nullConfig;
|
|
||||||
})
|
|
||||||
|
|
||||||
(mkIf cfg.elixir-tools.enable {
|
|
||||||
vim.startPlugins = ["elixir-tools"];
|
|
||||||
vim.pluginRC.elixir-tools = entryAnywhere ''
|
|
||||||
local elixir = require("elixir")
|
|
||||||
local elixirls = require("elixir.elixirls")
|
|
||||||
|
|
||||||
-- disable imperative insstallations of various
|
|
||||||
-- elixir related tools installed by elixir-tools
|
|
||||||
elixir.setup {
|
|
||||||
nextls = {
|
|
||||||
enable = false -- defaults to false
|
|
||||||
},
|
|
||||||
|
|
||||||
credo = {
|
|
||||||
enable = false -- defaults to true
|
|
||||||
},
|
|
||||||
|
|
||||||
elixirls = {
|
|
||||||
enable = false, -- defaults to true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
})
|
|
||||||
]);
|
|
||||||
}
|
|
67
modules/plugins/languages/elixir/config.nix
Normal file
67
modules/plugins/languages/elixir/config.nix
Normal file
|
@ -0,0 +1,67 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib.modules) mkIf;
|
||||||
|
inherit (lib.meta) getExe;
|
||||||
|
inherit (lib.nvim.dag) entryAnywhere;
|
||||||
|
|
||||||
|
cfg = config.vim.languages.elixir;
|
||||||
|
in {
|
||||||
|
config = mkIf (cfg.enable) {
|
||||||
|
vim.startPlugins = [
|
||||||
|
"elixir-tools"
|
||||||
|
];
|
||||||
|
|
||||||
|
vim.luaConfigRC.elixir-tools = entryAnywhere ''
|
||||||
|
local elixir = require("elixir")
|
||||||
|
local elixirls = require("elixir.elixirls")
|
||||||
|
|
||||||
|
elixir.setup {
|
||||||
|
elixirls = {
|
||||||
|
-- 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"}`
|
||||||
|
cmd = "${getExe pkgs.elixir-ls}",
|
||||||
|
|
||||||
|
-- default settings, use the `settings` function to override settings
|
||||||
|
settings = elixirls.settings {
|
||||||
|
dialyzerEnabled = true,
|
||||||
|
fetchDeps = false,
|
||||||
|
enableTestLenses = false,
|
||||||
|
suggestSpecs = false,
|
||||||
|
},
|
||||||
|
|
||||||
|
on_attach = function(client, bufnr)
|
||||||
|
local map_opts = { buffer = true, noremap = true}
|
||||||
|
|
||||||
|
-- run the codelens under the cursor
|
||||||
|
vim.keymap.set("n", "<space>r", vim.lsp.codelens.run, map_opts)
|
||||||
|
-- remove the pipe operator
|
||||||
|
vim.keymap.set("n", "<space>fp", ":ElixirFromPipe<cr>", map_opts)
|
||||||
|
-- add the pipe operator
|
||||||
|
vim.keymap.set("n", "<space>tp", ":ElixirToPipe<cr>", map_opts)
|
||||||
|
vim.keymap.set("v", "<space>em", ":ElixirExpandMacro<cr>", map_opts)
|
||||||
|
|
||||||
|
-- bindings for standard LSP functions.
|
||||||
|
vim.keymap.set("n", "<space>df", "<cmd>lua vim.lsp.buf.format()<cr>", map_opts)
|
||||||
|
vim.keymap.set("n", "<space>gd", "<cmd>lua vim.diagnostic.open_float()<cr>", map_opts)
|
||||||
|
vim.keymap.set("n", "<space>dt", "<cmd>lua vim.lsp.buf.definition()<cr>", map_opts)
|
||||||
|
vim.keymap.set("n", "<space>K", "<cmd>lua vim.lsp.buf.hover()<cr>", map_opts)
|
||||||
|
vim.keymap.set("n", "<space>gD","<cmd>lua vim.lsp.buf.implementation()<cr>", map_opts)
|
||||||
|
vim.keymap.set("n", "<space>1gD","<cmd>lua vim.lsp.buf.type_definition()<cr>", map_opts)
|
||||||
|
|
||||||
|
-- keybinds for fzf-lsp.nvim: https://github.com/gfanto/fzf-lsp.nvim
|
||||||
|
-- you could also use telescope.nvim: https://github.com/nvim-telescope/telescope.nvim
|
||||||
|
-- there are also core vim.lsp functions that put the same data in the loclist
|
||||||
|
vim.keymap.set("n", "<space>gr", ":References<cr>", map_opts)
|
||||||
|
vim.keymap.set("n", "<space>g0", ":DocumentSymbols<cr>", map_opts)
|
||||||
|
vim.keymap.set("n", "<space>gW", ":WorkspaceSymbols<cr>", map_opts)
|
||||||
|
vim.keymap.set("n", "<leader>d", ":Diagnostics<cr>", map_opts)
|
||||||
|
end
|
||||||
|
}
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./precognition.nix
|
|
||||||
./config.nix
|
./config.nix
|
||||||
|
./elixir-tools.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
7
modules/plugins/languages/elixir/elixir-tools.nix
Normal file
7
modules/plugins/languages/elixir/elixir-tools.nix
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
{lib, ...}: let
|
||||||
|
inherit (lib.options) mkEnableOption;
|
||||||
|
in {
|
||||||
|
options.vim.languages.elixir = {
|
||||||
|
enable = mkEnableOption "Elixir language support";
|
||||||
|
};
|
||||||
|
}
|
|
@ -12,7 +12,6 @@
|
||||||
inherit (lib.types) bool enum either listOf package str;
|
inherit (lib.types) bool enum either listOf package str;
|
||||||
inherit (lib.nvim.types) mkGrammarOption;
|
inherit (lib.nvim.types) mkGrammarOption;
|
||||||
inherit (lib.nvim.lua) expToLua;
|
inherit (lib.nvim.lua) expToLua;
|
||||||
inherit (lib.nvim.dag) entryAfter;
|
|
||||||
|
|
||||||
cfg = config.vim.languages.go;
|
cfg = config.vim.languages.go;
|
||||||
|
|
||||||
|
@ -38,6 +37,40 @@
|
||||||
debuggers = {
|
debuggers = {
|
||||||
delve = {
|
delve = {
|
||||||
package = pkgs.delve;
|
package = pkgs.delve;
|
||||||
|
dapConfig = ''
|
||||||
|
dap.adapters.delve = {
|
||||||
|
type = "server",
|
||||||
|
port = "''${port}",
|
||||||
|
executable = {
|
||||||
|
command = "${getExe cfg.dap.package}",
|
||||||
|
args = { "dap", "-l", "127.0.0.1:''${port}" },
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
dap.configurations.go = {
|
||||||
|
{
|
||||||
|
type = "delve",
|
||||||
|
name = "Debug",
|
||||||
|
request = "launch",
|
||||||
|
program = "''${file}",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type = "delve",
|
||||||
|
name = "Debug test", -- configuration for debugging test files
|
||||||
|
request = "launch",
|
||||||
|
mode = "test",
|
||||||
|
program = "''${file}",
|
||||||
|
},
|
||||||
|
-- works with go.mod packages and sub packages
|
||||||
|
{
|
||||||
|
type = "delve",
|
||||||
|
name = "Debug test (go.mod)",
|
||||||
|
request = "launch",
|
||||||
|
mode = "test",
|
||||||
|
program = "./''${relativeFileDirname}",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
|
@ -69,17 +102,15 @@ in {
|
||||||
|
|
||||||
dap = {
|
dap = {
|
||||||
enable = mkOption {
|
enable = mkOption {
|
||||||
description = "Enable Go Debug Adapter via nvim-dap-go plugin";
|
description = "Enable Go Debug Adapter";
|
||||||
type = bool;
|
type = bool;
|
||||||
default = config.vim.languages.enableDAP;
|
default = config.vim.languages.enableDAP;
|
||||||
};
|
};
|
||||||
|
|
||||||
debugger = mkOption {
|
debugger = mkOption {
|
||||||
description = "Go debugger to use";
|
description = "Go debugger to use";
|
||||||
type = enum (attrNames debuggers);
|
type = enum (attrNames debuggers);
|
||||||
default = defaultDebugger;
|
default = defaultDebugger;
|
||||||
};
|
};
|
||||||
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
description = "Go debugger package.";
|
description = "Go debugger package.";
|
||||||
type = package;
|
type = package;
|
||||||
|
@ -100,17 +131,8 @@ in {
|
||||||
})
|
})
|
||||||
|
|
||||||
(mkIf cfg.dap.enable {
|
(mkIf cfg.dap.enable {
|
||||||
vim = {
|
vim.debugger.nvim-dap.enable = true;
|
||||||
startPlugins = ["nvim-dap-go"];
|
vim.debugger.nvim-dap.sources.go-debugger = debuggers.${cfg.dap.debugger}.dapConfig;
|
||||||
pluginRC.nvim-dap-go = entryAfter ["nvim-dap"] ''
|
|
||||||
require('dap-go').setup {
|
|
||||||
delve = {
|
|
||||||
path = '${getExe cfg.dap.package}',
|
|
||||||
}
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
debugger.nvim-dap.enable = true;
|
|
||||||
};
|
|
||||||
})
|
})
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,7 @@ in {
|
||||||
grammars = [cfg.treesitter.package];
|
grammars = [cfg.treesitter.package];
|
||||||
};
|
};
|
||||||
|
|
||||||
pluginRC.html-autotag = mkIf cfg.treesitter.autotagHtml (entryAnywhere ''
|
luaConfigRC.html-autotag = mkIf cfg.treesitter.autotagHtml (entryAnywhere ''
|
||||||
require('nvim-ts-autotag').setup()
|
require('nvim-ts-autotag').setup()
|
||||||
'');
|
'');
|
||||||
};
|
};
|
||||||
|
|
|
@ -61,7 +61,7 @@ in {
|
||||||
|
|
||||||
(mkIf cfg.lsp.neodev.enable {
|
(mkIf cfg.lsp.neodev.enable {
|
||||||
vim.startPlugins = ["neodev-nvim"];
|
vim.startPlugins = ["neodev-nvim"];
|
||||||
vim.pluginRC.neodev = entryBefore ["lua-lsp"] ''
|
vim.luaConfigRC.neodev = entryBefore ["lua-lsp"] ''
|
||||||
require("neodev").setup({})
|
require("neodev").setup({})
|
||||||
'';
|
'';
|
||||||
})
|
})
|
||||||
|
|
40
modules/plugins/languages/markdown/config.nix
Normal file
40
modules/plugins/languages/markdown/config.nix
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib.nvim.lua) expToLua;
|
||||||
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
|
inherit (lib.lists) isList;
|
||||||
|
|
||||||
|
cfg = config.vim.languages.markdown;
|
||||||
|
servers = {
|
||||||
|
marksman = {
|
||||||
|
package = pkgs.marksman;
|
||||||
|
lspConfig = ''
|
||||||
|
lspconfig.marksman.setup{
|
||||||
|
capabilities = capabilities;
|
||||||
|
on_attach = default_on_attach;
|
||||||
|
cmd = ${
|
||||||
|
if isList cfg.lsp.package
|
||||||
|
then expToLua cfg.lsp.package
|
||||||
|
else ''{"${cfg.lsp.package}/bin/marksman", "server"}''
|
||||||
|
},
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
config = mkIf cfg.enable (mkMerge [
|
||||||
|
(mkIf cfg.treesitter.enable {
|
||||||
|
vim.treesitter.enable = true;
|
||||||
|
vim.treesitter.grammars = [cfg.treesitter.mdPackage cfg.treesitter.mdInlinePackage];
|
||||||
|
})
|
||||||
|
|
||||||
|
(mkIf cfg.lsp.enable {
|
||||||
|
vim.lsp.lspconfig.enable = true;
|
||||||
|
vim.lsp.lspconfig.sources.markdown-lsp = servers.${cfg.lsp.server}.lspConfig;
|
||||||
|
})
|
||||||
|
]);
|
||||||
|
}
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{...}: {
|
||||||
imports = [
|
imports = [
|
||||||
./fastaction-nvim.nix
|
|
||||||
./config.nix
|
./config.nix
|
||||||
|
./markdown.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
|
@ -4,8 +4,7 @@
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (builtins) attrNames concatLists;
|
inherit (builtins) attrNames;
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
|
||||||
inherit (lib.options) mkEnableOption mkOption;
|
inherit (lib.options) mkEnableOption mkOption;
|
||||||
inherit (lib.lists) isList;
|
inherit (lib.lists) isList;
|
||||||
inherit (lib.types) bool enum either package listOf str;
|
inherit (lib.types) bool enum either package listOf str;
|
||||||
|
@ -30,31 +29,15 @@
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
defaultFormat = "denofmt";
|
|
||||||
formats = {
|
|
||||||
denofmt = {
|
|
||||||
package = pkgs.deno;
|
|
||||||
nullConfig = ''
|
|
||||||
table.insert(
|
|
||||||
ls_sources,
|
|
||||||
null_ls.builtins.formatting.deno_fmt.with({
|
|
||||||
filetypes = ${expToLua (concatLists [cfg.format.extraFiletypes ["markdown"]])},
|
|
||||||
command = "${cfg.format.package}/bin/deno",
|
|
||||||
})
|
|
||||||
)
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
in {
|
in {
|
||||||
options.vim.languages.markdown = {
|
options.vim.languages.markdown = {
|
||||||
enable = mkEnableOption "Markdown markup language support";
|
enable = mkEnableOption "Markdown markup language support";
|
||||||
|
|
||||||
treesitter = {
|
treesitter = {
|
||||||
enable = mkOption {
|
enable = mkOption {
|
||||||
|
description = "Enable Markdown treesitter";
|
||||||
type = bool;
|
type = bool;
|
||||||
default = config.vim.languages.enableTreesitter;
|
default = config.vim.languages.enableTreesitter;
|
||||||
description = "Enable Markdown treesitter";
|
|
||||||
};
|
};
|
||||||
mdPackage = mkGrammarOption pkgs "markdown";
|
mdPackage = mkGrammarOption pkgs "markdown";
|
||||||
mdInlinePackage = mkGrammarOption pkgs "markdown-inline";
|
mdInlinePackage = mkGrammarOption pkgs "markdown-inline";
|
||||||
|
@ -64,56 +47,17 @@ in {
|
||||||
enable = mkEnableOption "Enable Markdown LSP support" // {default = config.vim.languages.enableLSP;};
|
enable = mkEnableOption "Enable Markdown LSP support" // {default = config.vim.languages.enableLSP;};
|
||||||
|
|
||||||
server = mkOption {
|
server = mkOption {
|
||||||
|
description = "Markdown LSP server to use";
|
||||||
type = enum (attrNames servers);
|
type = enum (attrNames servers);
|
||||||
default = defaultServer;
|
default = defaultServer;
|
||||||
description = "Markdown LSP server to use";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
|
description = "Markdown LSP server package, or the command to run as a list of strings";
|
||||||
|
example = ''[lib.getExe pkgs.jdt-language-server " - data " " ~/.cache/jdtls/workspace "]'';
|
||||||
type = either package (listOf str);
|
type = either package (listOf str);
|
||||||
default = servers.${cfg.lsp.server}.package;
|
default = servers.${cfg.lsp.server}.package;
|
||||||
example = ''[lib.getExe pkgs.jdt-language-server " - data " " ~/.cache/jdtls/workspace "]'';
|
|
||||||
description = "Markdown LSP server package, or the command to run as a list of strings";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
format = {
|
|
||||||
enable = mkEnableOption "Markdown formatting" // {default = config.vim.languages.enableFormat;};
|
|
||||||
|
|
||||||
type = mkOption {
|
|
||||||
type = enum (attrNames formats);
|
|
||||||
default = defaultFormat;
|
|
||||||
description = "Markdown formatter to use";
|
|
||||||
};
|
|
||||||
|
|
||||||
package = mkOption {
|
|
||||||
type = package;
|
|
||||||
default = formats.${cfg.format.type}.package;
|
|
||||||
description = "Markdown formatter package";
|
|
||||||
};
|
|
||||||
|
|
||||||
extraFiletypes = mkOption {
|
|
||||||
type = listOf str;
|
|
||||||
default = [];
|
|
||||||
description = "Extra filetypes to format with the Markdown formatter";
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable (mkMerge [
|
|
||||||
(mkIf cfg.treesitter.enable {
|
|
||||||
vim.treesitter.enable = true;
|
|
||||||
vim.treesitter.grammars = [cfg.treesitter.mdPackage cfg.treesitter.mdInlinePackage];
|
|
||||||
})
|
|
||||||
|
|
||||||
(mkIf cfg.lsp.enable {
|
|
||||||
vim.lsp.lspconfig.enable = true;
|
|
||||||
vim.lsp.lspconfig.sources.markdown-lsp = servers.${cfg.lsp.server}.lspConfig;
|
|
||||||
})
|
|
||||||
|
|
||||||
(mkIf cfg.format.enable {
|
|
||||||
vim.lsp.null-ls.enable = true;
|
|
||||||
vim.lsp.null-ls.sources.markdown-format = formats.${cfg.format.type}.nullConfig;
|
|
||||||
})
|
|
||||||
]);
|
|
||||||
}
|
}
|
|
@ -11,6 +11,7 @@
|
||||||
inherit (lib.strings) optionalString;
|
inherit (lib.strings) optionalString;
|
||||||
inherit (lib.types) enum either listOf package str;
|
inherit (lib.types) enum either listOf package str;
|
||||||
inherit (lib.nvim.types) mkGrammarOption diagnostics;
|
inherit (lib.nvim.types) mkGrammarOption diagnostics;
|
||||||
|
inherit (lib.nvim.dag) entryAnywhere;
|
||||||
inherit (lib.nvim.lua) expToLua;
|
inherit (lib.nvim.lua) expToLua;
|
||||||
inherit (lib.nvim.languages) diagnosticsToLua;
|
inherit (lib.nvim.languages) diagnosticsToLua;
|
||||||
|
|
||||||
|
@ -175,16 +176,8 @@ in {
|
||||||
|
|
||||||
config = mkIf cfg.enable (mkMerge [
|
config = mkIf cfg.enable (mkMerge [
|
||||||
{
|
{
|
||||||
vim.pluginRC.nix = ''
|
vim.configRC.nix = entryAnywhere ''
|
||||||
vim.api.nvim_create_autocmd("FileType", {
|
autocmd filetype nix setlocal tabstop=2 shiftwidth=2 softtabstop=2
|
||||||
pattern = "nix",
|
|
||||||
callback = function(opts)
|
|
||||||
local bo = vim.bo[opts.buf]
|
|
||||||
bo.tabstop = 2
|
|
||||||
bo.shiftwidth = 2
|
|
||||||
bo.softtabstop = 2
|
|
||||||
end
|
|
||||||
})
|
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,105 +0,0 @@
|
||||||
{
|
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
inherit (builtins) attrNames;
|
|
||||||
inherit (lib.options) mkEnableOption mkOption;
|
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
|
||||||
inherit (lib.meta) getExe;
|
|
||||||
inherit (lib.lists) isList;
|
|
||||||
inherit (lib.types) either enum listOf package str;
|
|
||||||
inherit (lib.nvim.types) mkGrammarOption;
|
|
||||||
inherit (lib.nvim.lua) expToLua;
|
|
||||||
|
|
||||||
cfg = config.vim.languages.ocaml;
|
|
||||||
|
|
||||||
defaultServer = "ocaml-lsp";
|
|
||||||
servers = {
|
|
||||||
ocaml-lsp = {
|
|
||||||
package = pkgs.ocamlPackages.ocaml-lsp;
|
|
||||||
lspConfig = ''
|
|
||||||
lspconfig.ocamllsp.setup {
|
|
||||||
capabilities = capabilities,
|
|
||||||
on_attach = default_on_attach,
|
|
||||||
cmd = ${
|
|
||||||
if isList cfg.lsp.package
|
|
||||||
then expToLua cfg.lsp.package
|
|
||||||
else ''{"${getExe cfg.lsp.package}"}''
|
|
||||||
};
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
defaultFormat = "ocamlformat";
|
|
||||||
formats = {
|
|
||||||
ocamlformat = {
|
|
||||||
package = pkgs.ocamlPackages.ocamlformat;
|
|
||||||
nullConfig = ''
|
|
||||||
table.insert(
|
|
||||||
ls_sources,
|
|
||||||
null_ls.builtins.formatting.ocamlformat.with({
|
|
||||||
command = "${cfg.format.package}/bin/ocamlformat",
|
|
||||||
})
|
|
||||||
)
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
in {
|
|
||||||
options.vim.languages.ocaml = {
|
|
||||||
enable = mkEnableOption "OCaml language support";
|
|
||||||
|
|
||||||
treesitter = {
|
|
||||||
enable = mkEnableOption "OCaml treesitter" // {default = config.vim.languages.enableTreesitter;};
|
|
||||||
package = mkGrammarOption pkgs "ocaml";
|
|
||||||
};
|
|
||||||
|
|
||||||
lsp = {
|
|
||||||
enable = mkEnableOption "OCaml LSP support (ocaml-lsp)" // {default = config.vim.languages.enableLSP;};
|
|
||||||
server = mkOption {
|
|
||||||
description = "OCaml LSP server to user";
|
|
||||||
type = enum (attrNames servers);
|
|
||||||
default = defaultServer;
|
|
||||||
};
|
|
||||||
package = mkOption {
|
|
||||||
description = "OCaml language server package, or the command to run as a list of strings";
|
|
||||||
type = either package (listOf str);
|
|
||||||
default = servers.${cfg.lsp.server}.package;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
format = {
|
|
||||||
enable = mkEnableOption "OCaml formatting support (ocamlformat)" // {default = config.vim.languages.enableFormat;};
|
|
||||||
type = mkOption {
|
|
||||||
description = "OCaml formatter to use";
|
|
||||||
type = enum (attrNames formats);
|
|
||||||
default = defaultFormat;
|
|
||||||
};
|
|
||||||
package = mkOption {
|
|
||||||
description = "OCaml formatter package";
|
|
||||||
type = package;
|
|
||||||
default = formats.${cfg.format.type}.package;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = mkIf cfg.enable (mkMerge [
|
|
||||||
(mkIf cfg.lsp.enable {
|
|
||||||
vim.lsp.lspconfig.enable = true;
|
|
||||||
vim.lsp.lspconfig.sources.ocaml-lsp = servers.${cfg.lsp.server}.lspConfig;
|
|
||||||
})
|
|
||||||
|
|
||||||
(mkIf cfg.treesitter.enable {
|
|
||||||
vim.treesitter.enable = true;
|
|
||||||
vim.treesitter.grammars = [cfg.treesitter.package];
|
|
||||||
})
|
|
||||||
|
|
||||||
(mkIf cfg.format.enable {
|
|
||||||
vim.lsp.null-ls.enable = true;
|
|
||||||
vim.lsp.null-ls.sources.ocamlformat = formats.${cfg.format.type}.nullConfig;
|
|
||||||
vim.extraPackages = [formats.${cfg.format.type}.package];
|
|
||||||
})
|
|
||||||
]);
|
|
||||||
}
|
|
|
@ -14,10 +14,10 @@
|
||||||
|
|
||||||
cfg = config.vim.languages.python;
|
cfg = config.vim.languages.python;
|
||||||
|
|
||||||
defaultServer = "basedpyright";
|
defaultServer = "pyright";
|
||||||
servers = {
|
servers = {
|
||||||
pyright = {
|
pyright = {
|
||||||
package = pkgs.pyright;
|
package = pkgs.nodePackages.pyright;
|
||||||
lspConfig = ''
|
lspConfig = ''
|
||||||
lspconfig.pyright.setup{
|
lspconfig.pyright.setup{
|
||||||
capabilities = capabilities;
|
capabilities = capabilities;
|
||||||
|
@ -30,36 +30,6 @@
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
basedpyright = {
|
|
||||||
package = pkgs.basedpyright;
|
|
||||||
lspConfig = ''
|
|
||||||
lspconfig.basedpyright.setup{
|
|
||||||
capabilities = capabilities;
|
|
||||||
on_attach = default_on_attach;
|
|
||||||
cmd = ${
|
|
||||||
if isList cfg.lsp.package
|
|
||||||
then expToLua cfg.lsp.package
|
|
||||||
else ''{"${cfg.lsp.package}/bin/basedpyright-langserver", "--stdio"}''
|
|
||||||
}
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
python-lsp-server = {
|
|
||||||
package = pkgs.python-lsp-server;
|
|
||||||
lspConfig = ''
|
|
||||||
lspconfig.pylsp.setup{
|
|
||||||
capabilities = capabilities;
|
|
||||||
on_attach = default_on_attach;
|
|
||||||
cmd = ${
|
|
||||||
if isList cfg.lsp.package
|
|
||||||
then expToLua cfg.lsp.package
|
|
||||||
else ''{"${cfg.lsp.package}/bin/pylsp"}''
|
|
||||||
}
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
defaultFormat = "black";
|
defaultFormat = "black";
|
||||||
|
@ -91,12 +61,11 @@
|
||||||
black-and-isort = {
|
black-and-isort = {
|
||||||
package = pkgs.writeShellApplication {
|
package = pkgs.writeShellApplication {
|
||||||
name = "black";
|
name = "black";
|
||||||
runtimeInputs = [pkgs.black pkgs.isort];
|
|
||||||
text = ''
|
text = ''
|
||||||
black --quiet - "$@" | isort --profile black -
|
black --quiet - "$@" | isort --profile black -
|
||||||
'';
|
'';
|
||||||
|
runtimeInputs = [pkgs.black pkgs.isort];
|
||||||
};
|
};
|
||||||
|
|
||||||
nullConfig = ''
|
nullConfig = ''
|
||||||
table.insert(
|
table.insert(
|
||||||
ls_sources,
|
ls_sources,
|
||||||
|
|
|
@ -1,78 +0,0 @@
|
||||||
{
|
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
inherit (builtins) attrNames;
|
|
||||||
inherit (lib.options) mkEnableOption mkOption literalExpression;
|
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
|
||||||
inherit (lib.lists) isList;
|
|
||||||
inherit (lib.types) enum either listOf package str;
|
|
||||||
inherit (lib.nvim.lua) expToLua;
|
|
||||||
inherit (lib.nvim.types) mkGrammarOption;
|
|
||||||
|
|
||||||
cfg = config.vim.languages.r;
|
|
||||||
|
|
||||||
r-with-languageserver = pkgs.rWrapper.override {
|
|
||||||
packages = with pkgs.rPackages; [languageserver];
|
|
||||||
};
|
|
||||||
|
|
||||||
defaultServer = "r_language_server";
|
|
||||||
servers = {
|
|
||||||
r_language_server = {
|
|
||||||
package = pkgs.writeShellScriptBin "r_lsp" ''
|
|
||||||
${r-with-languageserver}/bin/R --slave -e "languageserver::run()"
|
|
||||||
'';
|
|
||||||
lspConfig = ''
|
|
||||||
lspconfig.r_language_server.setup{
|
|
||||||
capabilities = capabilities;
|
|
||||||
on_attach = default_on_attach;
|
|
||||||
cmd = ${
|
|
||||||
if isList cfg.lsp.package
|
|
||||||
then expToLua cfg.lsp.package
|
|
||||||
else ''{"${lib.getExe cfg.lsp.package}"}''
|
|
||||||
}
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
in {
|
|
||||||
options.vim.languages.r = {
|
|
||||||
enable = mkEnableOption "R language support";
|
|
||||||
|
|
||||||
treesitter = {
|
|
||||||
enable = mkEnableOption "R treesitter" // {default = config.vim.languages.enableTreesitter;};
|
|
||||||
package = mkGrammarOption pkgs "r";
|
|
||||||
};
|
|
||||||
|
|
||||||
lsp = {
|
|
||||||
enable = mkEnableOption "R LSP support" // {default = config.vim.languages.enableLSP;};
|
|
||||||
|
|
||||||
server = mkOption {
|
|
||||||
description = "R LSP server to use";
|
|
||||||
type = enum (attrNames servers);
|
|
||||||
default = defaultServer;
|
|
||||||
};
|
|
||||||
|
|
||||||
package = mkOption {
|
|
||||||
description = "R LSP server package, or the command to run as a list of strings";
|
|
||||||
example = literalExpression "[ (lib.getExe pkgs.jdt-language-server) \"-data\" \"~/.cache/jdtls/workspace\" ]";
|
|
||||||
type = either package (listOf str);
|
|
||||||
default = servers.${cfg.lsp.server}.package;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = mkIf cfg.enable (mkMerge [
|
|
||||||
(mkIf cfg.treesitter.enable {
|
|
||||||
vim.treesitter.enable = true;
|
|
||||||
vim.treesitter.grammars = [cfg.treesitter.package];
|
|
||||||
})
|
|
||||||
|
|
||||||
(mkIf cfg.lsp.enable {
|
|
||||||
vim.lsp.lspconfig.enable = true;
|
|
||||||
vim.lsp.lspconfig.sources.r-lsp = servers.${cfg.lsp.server}.lspConfig;
|
|
||||||
})
|
|
||||||
]);
|
|
||||||
}
|
|
|
@ -4,33 +4,17 @@
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (builtins) attrNames;
|
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
inherit (lib.options) mkOption mkEnableOption;
|
inherit (lib.options) mkOption mkEnableOption;
|
||||||
inherit (lib.strings) optionalString;
|
inherit (lib.strings) optionalString;
|
||||||
inherit (lib.trivial) boolToString;
|
inherit (lib.trivial) boolToString;
|
||||||
inherit (lib.lists) isList optionals;
|
inherit (lib.lists) isList optionals;
|
||||||
inherit (lib.types) bool package str listOf either enum;
|
inherit (lib.types) bool package str listOf either;
|
||||||
inherit (lib.nvim.types) mkGrammarOption;
|
inherit (lib.nvim.types) mkGrammarOption;
|
||||||
inherit (lib.nvim.lua) expToLua;
|
inherit (lib.nvim.lua) expToLua;
|
||||||
inherit (lib.nvim.dag) entryAnywhere;
|
inherit (lib.nvim.dag) entryAnywhere;
|
||||||
|
|
||||||
cfg = config.vim.languages.rust;
|
cfg = config.vim.languages.rust;
|
||||||
|
|
||||||
defaultFormat = "rustfmt";
|
|
||||||
formats = {
|
|
||||||
rustfmt = {
|
|
||||||
package = pkgs.rustfmt;
|
|
||||||
nullConfig = ''
|
|
||||||
table.insert(
|
|
||||||
ls_sources,
|
|
||||||
null_ls.builtins.formatting.rustfmt.with({
|
|
||||||
command = "${cfg.format.package}/bin/rustfmt",
|
|
||||||
})
|
|
||||||
)
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
in {
|
in {
|
||||||
options.vim.languages.rust = {
|
options.vim.languages.rust = {
|
||||||
enable = mkEnableOption "Rust language support";
|
enable = mkEnableOption "Rust language support";
|
||||||
|
@ -65,22 +49,6 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
format = {
|
|
||||||
enable = mkEnableOption "Rust formatting" // {default = config.vim.languages.enableFormat;};
|
|
||||||
|
|
||||||
type = mkOption {
|
|
||||||
description = "Rust formatter to use";
|
|
||||||
type = enum (attrNames formats);
|
|
||||||
default = defaultFormat;
|
|
||||||
};
|
|
||||||
|
|
||||||
package = mkOption {
|
|
||||||
description = "Rust formatter package";
|
|
||||||
type = package;
|
|
||||||
default = formats.${cfg.format.type}.package;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
dap = {
|
dap = {
|
||||||
enable = mkOption {
|
enable = mkOption {
|
||||||
description = "Rust Debug Adapter support";
|
description = "Rust Debug Adapter support";
|
||||||
|
@ -102,7 +70,7 @@ in {
|
||||||
startPlugins = ["crates-nvim"];
|
startPlugins = ["crates-nvim"];
|
||||||
lsp.null-ls.enable = mkIf cfg.crates.codeActions true;
|
lsp.null-ls.enable = mkIf cfg.crates.codeActions true;
|
||||||
autocomplete.sources = {"crates" = "[Crates]";};
|
autocomplete.sources = {"crates" = "[Crates]";};
|
||||||
pluginRC.rust-crates = entryAnywhere ''
|
luaConfigRC.rust-crates = entryAnywhere ''
|
||||||
require('crates').setup {
|
require('crates').setup {
|
||||||
null_ls = {
|
null_ls = {
|
||||||
enabled = ${boolToString cfg.crates.codeActions},
|
enabled = ${boolToString cfg.crates.codeActions},
|
||||||
|
@ -118,68 +86,74 @@ in {
|
||||||
vim.treesitter.grammars = [cfg.treesitter.package];
|
vim.treesitter.grammars = [cfg.treesitter.package];
|
||||||
})
|
})
|
||||||
|
|
||||||
(mkIf cfg.format.enable {
|
|
||||||
vim.lsp.null-ls.enable = true;
|
|
||||||
vim.lsp.null-ls.sources.rust-format = formats.${cfg.format.type}.nullConfig;
|
|
||||||
})
|
|
||||||
|
|
||||||
(mkIf (cfg.lsp.enable || cfg.dap.enable) {
|
(mkIf (cfg.lsp.enable || cfg.dap.enable) {
|
||||||
vim = {
|
vim = {
|
||||||
startPlugins = ["rustaceanvim"];
|
startPlugins = ["rust-tools"] ++ optionals cfg.dap.enable [cfg.dap.package];
|
||||||
|
|
||||||
luaConfigRC.rustaceanvim = entryAnywhere ''
|
lsp.lspconfig = {
|
||||||
vim.g.rustaceanvim = {
|
enable = true;
|
||||||
${optionalString cfg.lsp.enable ''
|
sources.rust-lsp = ''
|
||||||
-- LSP
|
local rt = require('rust-tools')
|
||||||
tools = {
|
rust_on_attach = function(client, bufnr)
|
||||||
hover_actions = {
|
default_on_attach(client, bufnr)
|
||||||
replace_builtin_hover = false
|
local opts = { noremap=true, silent=true, buffer = bufnr }
|
||||||
|
vim.keymap.set("n", "<leader>ris", rt.inlay_hints.set, opts)
|
||||||
|
vim.keymap.set("n", "<leader>riu", rt.inlay_hints.unset, opts)
|
||||||
|
vim.keymap.set("n", "<leader>rr", rt.runnables.runnables, opts)
|
||||||
|
vim.keymap.set("n", "<leader>rp", rt.parent_module.parent_module, opts)
|
||||||
|
vim.keymap.set("n", "<leader>rm", rt.expand_macro.expand_macro, opts)
|
||||||
|
vim.keymap.set("n", "<leader>rc", rt.open_cargo_toml.open_cargo_toml, opts)
|
||||||
|
vim.keymap.set("n", "<leader>rg", function() rt.crate_graph.view_crate_graph("x11", nil) end, opts)
|
||||||
|
${optionalString cfg.dap.enable ''
|
||||||
|
vim.keymap.set("n", "<leader>rd", ":RustDebuggables<cr>", opts)
|
||||||
|
vim.keymap.set(
|
||||||
|
"n", "${config.vim.debugger.nvim-dap.mappings.continue}",
|
||||||
|
function()
|
||||||
|
local dap = require("dap")
|
||||||
|
if dap.status() == "" then
|
||||||
|
vim.cmd "RustDebuggables"
|
||||||
|
else
|
||||||
|
dap.continue()
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
opts
|
||||||
|
)
|
||||||
|
''}
|
||||||
|
end
|
||||||
|
local rustopts = {
|
||||||
|
tools = {
|
||||||
|
autoSetHints = true,
|
||||||
|
hover_with_actions = false,
|
||||||
|
inlay_hints = {
|
||||||
|
only_current_line = false,
|
||||||
|
}
|
||||||
},
|
},
|
||||||
},
|
server = {
|
||||||
server = {
|
capabilities = capabilities,
|
||||||
cmd = ${
|
on_attach = rust_on_attach,
|
||||||
|
cmd = ${
|
||||||
if isList cfg.lsp.package
|
if isList cfg.lsp.package
|
||||||
then expToLua cfg.lsp.package
|
then expToLua cfg.lsp.package
|
||||||
else ''{"${cfg.lsp.package}/bin/rust-analyzer"}''
|
else ''{"${cfg.lsp.package}/bin/rust-analyzer"}''
|
||||||
},
|
},
|
||||||
on_attach = function(client, bufnr)
|
settings = {
|
||||||
default_on_attach(client, bufnr)
|
${cfg.lsp.opts}
|
||||||
local opts = { noremap=true, silent=true, buffer = bufnr }
|
}
|
||||||
vim.keymap.set("n", "<leader>rr", ":RustLsp runnables<CR>", opts)
|
|
||||||
vim.keymap.set("n", "<leader>rp", ":RustLsp parentModule<CR>", opts)
|
|
||||||
vim.keymap.set("n", "<leader>rm", ":RustLsp expandMacro<CR>", opts)
|
|
||||||
vim.keymap.set("n", "<leader>rc", ":RustLsp openCargo", opts)
|
|
||||||
vim.keymap.set("n", "<leader>rg", ":RustLsp crateGraph x11", opts)
|
|
||||||
${optionalString cfg.dap.enable ''
|
|
||||||
vim.keymap.set("n", "<leader>rd", ":RustLsp debuggables<cr>", opts)
|
|
||||||
vim.keymap.set(
|
|
||||||
"n", "${config.vim.debugger.nvim-dap.mappings.continue}",
|
|
||||||
function()
|
|
||||||
local dap = require("dap")
|
|
||||||
if dap.status() == "" then
|
|
||||||
vim.cmd "RustLsp debuggables"
|
|
||||||
else
|
|
||||||
dap.continue()
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
opts
|
|
||||||
)
|
|
||||||
''}
|
|
||||||
end
|
|
||||||
},
|
|
||||||
''}
|
|
||||||
|
|
||||||
${optionalString cfg.dap.enable ''
|
|
||||||
dap = {
|
|
||||||
adapter = {
|
|
||||||
type = "executable",
|
|
||||||
command = "${cfg.dap.package}/bin/lldb-dap",
|
|
||||||
name = "rustacean_lldb",
|
|
||||||
},
|
},
|
||||||
},
|
|
||||||
''}
|
${optionalString cfg.dap.enable ''
|
||||||
}
|
dap = {
|
||||||
'';
|
adapter = {
|
||||||
|
type = "executable",
|
||||||
|
command = "${cfg.dap.package}/bin/lldb-vscode",
|
||||||
|
name = "rt_lldb",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
''}
|
||||||
|
}
|
||||||
|
rt.setup(rustopts)
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
]);
|
]);
|
||||||
|
|
|
@ -54,7 +54,7 @@
|
||||||
defaultDiagnosticsProvider = ["eslint_d"];
|
defaultDiagnosticsProvider = ["eslint_d"];
|
||||||
diagnosticsProviders = {
|
diagnosticsProviders = {
|
||||||
eslint_d = {
|
eslint_d = {
|
||||||
package = pkgs.eslint_d;
|
package = pkgs.nodePackages.eslint_d;
|
||||||
nullConfig = pkg: ''
|
nullConfig = pkg: ''
|
||||||
table.insert(
|
table.insert(
|
||||||
ls_sources,
|
ls_sources,
|
||||||
|
|
23
modules/plugins/languages/tidal/config.nix
Normal file
23
modules/plugins/languages/tidal/config.nix
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib.modules) mkIf;
|
||||||
|
|
||||||
|
cfg = config.vim.tidal;
|
||||||
|
in {
|
||||||
|
config = mkIf (cfg.enable) {
|
||||||
|
vim.startPlugins = [
|
||||||
|
# From tidalcycles flake
|
||||||
|
pkgs.vimPlugins.vim-tidal
|
||||||
|
];
|
||||||
|
|
||||||
|
vim.globals = {
|
||||||
|
"tidal_target" = "terminal";
|
||||||
|
"tidal_flash_duration" = 150;
|
||||||
|
"tidal_sc_enable" = cfg.openSC;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
6
modules/plugins/languages/tidal/default.nix
Normal file
6
modules/plugins/languages/tidal/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{...}: {
|
||||||
|
imports = [
|
||||||
|
./tidal.nix
|
||||||
|
./config.nix
|
||||||
|
];
|
||||||
|
}
|
24
modules/plugins/languages/tidal/tidal.nix
Normal file
24
modules/plugins/languages/tidal/tidal.nix
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib.options) mkEnableOption mkOption;
|
||||||
|
inherit (lib.types) int bool;
|
||||||
|
in {
|
||||||
|
options.vim.tidal = {
|
||||||
|
enable = mkEnableOption "tidalcycles tools and plugins";
|
||||||
|
|
||||||
|
flash = mkOption {
|
||||||
|
description = ''When sending a paragraph or a single line, vim-tidal will "flash" the selection for some milliseconds'';
|
||||||
|
type = int;
|
||||||
|
default = 150;
|
||||||
|
};
|
||||||
|
|
||||||
|
openSC = mkOption {
|
||||||
|
description = "Automatically run the supercollider CLI, sclang, alongside the Tidal GHCI terminal.";
|
||||||
|
type = bool;
|
||||||
|
default = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -9,20 +9,19 @@
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
inherit (lib.lists) isList;
|
inherit (lib.lists) isList;
|
||||||
inherit (lib.meta) getExe;
|
inherit (lib.meta) getExe;
|
||||||
inherit (lib.types) enum either listOf package str bool;
|
inherit (lib.types) enum either listOf package str;
|
||||||
inherit (lib.nvim.lua) expToLua toLuaObject;
|
inherit (lib.nvim.lua) expToLua;
|
||||||
inherit (lib.nvim.types) mkGrammarOption diagnostics mkPluginSetupOption;
|
inherit (lib.nvim.types) mkGrammarOption diagnostics;
|
||||||
inherit (lib.nvim.languages) diagnosticsToLua;
|
inherit (lib.nvim.languages) diagnosticsToLua;
|
||||||
inherit (lib.nvim.dag) entryAnywhere;
|
|
||||||
|
|
||||||
cfg = config.vim.languages.ts;
|
cfg = config.vim.languages.ts;
|
||||||
|
|
||||||
defaultServer = "ts_ls";
|
defaultServer = "tsserver";
|
||||||
servers = {
|
servers = {
|
||||||
ts_ls = {
|
tsserver = {
|
||||||
package = pkgs.typescript-language-server;
|
package = pkgs.nodePackages.typescript-language-server;
|
||||||
lspConfig = ''
|
lspConfig = ''
|
||||||
lspconfig.ts_ls.setup {
|
lspconfig.tsserver.setup {
|
||||||
capabilities = capabilities;
|
capabilities = capabilities;
|
||||||
on_attach = attach_keymaps,
|
on_attach = attach_keymaps,
|
||||||
cmd = ${
|
cmd = ${
|
||||||
|
@ -33,7 +32,6 @@
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
denols = {
|
denols = {
|
||||||
package = pkgs.deno;
|
package = pkgs.deno;
|
||||||
lspConfig = ''
|
lspConfig = ''
|
||||||
|
@ -49,24 +47,6 @@
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
# Here for backwards compatibility. Still consider tsserver a valid
|
|
||||||
# configuration in the enum, but assert if it's set to *properly*
|
|
||||||
# redirect the user to the correct server.
|
|
||||||
tsserver = {
|
|
||||||
package = pkgs.typescript-language-server;
|
|
||||||
lspConfig = ''
|
|
||||||
lspconfig.ts_ls.setup {
|
|
||||||
capabilities = capabilities;
|
|
||||||
on_attach = attach_keymaps,
|
|
||||||
cmd = ${
|
|
||||||
if isList cfg.lsp.package
|
|
||||||
then expToLua cfg.lsp.package
|
|
||||||
else ''{"${cfg.lsp.package}/bin/typescript-language-server", "--stdio"}''
|
|
||||||
}
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# TODO: specify packages
|
# TODO: specify packages
|
||||||
|
@ -83,7 +63,6 @@
|
||||||
)
|
)
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
prettierd = {
|
prettierd = {
|
||||||
package = pkgs.prettierd;
|
package = pkgs.prettierd;
|
||||||
nullConfig = ''
|
nullConfig = ''
|
||||||
|
@ -101,7 +80,7 @@
|
||||||
defaultDiagnosticsProvider = ["eslint_d"];
|
defaultDiagnosticsProvider = ["eslint_d"];
|
||||||
diagnosticsProviders = {
|
diagnosticsProviders = {
|
||||||
eslint_d = {
|
eslint_d = {
|
||||||
package = pkgs.eslint_d;
|
package = pkgs.nodePackages.eslint_d;
|
||||||
nullConfig = pkg: ''
|
nullConfig = pkg: ''
|
||||||
table.insert(
|
table.insert(
|
||||||
ls_sources,
|
ls_sources,
|
||||||
|
@ -113,7 +92,6 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
_file = ./ts.nix;
|
|
||||||
options.vim.languages.ts = {
|
options.vim.languages.ts = {
|
||||||
enable = mkEnableOption "Typescript/Javascript language support";
|
enable = mkEnableOption "Typescript/Javascript language support";
|
||||||
|
|
||||||
|
@ -165,24 +143,6 @@ in {
|
||||||
inherit defaultDiagnosticsProvider;
|
inherit defaultDiagnosticsProvider;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
extensions = {
|
|
||||||
ts-error-translator = {
|
|
||||||
enable = mkEnableOption ''
|
|
||||||
Typescript error translation with
|
|
||||||
[ts-error-translator.nvim](github.com/dmmulroy/ts-error-translator.nvim)
|
|
||||||
'';
|
|
||||||
|
|
||||||
setupOpts = mkPluginSetupOption "ts-error-translator" {
|
|
||||||
# This is the default configuration behaviour.
|
|
||||||
auto_override_publish_diagnostics = mkOption {
|
|
||||||
description = "Automatically override the publish_diagnostics handler";
|
|
||||||
type = bool;
|
|
||||||
default = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable (mkMerge [
|
config = mkIf cfg.enable (mkMerge [
|
||||||
|
@ -209,33 +169,5 @@ in {
|
||||||
inherit diagnosticsProviders;
|
inherit diagnosticsProviders;
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
|
|
||||||
# Extensions
|
|
||||||
(mkIf cfg.extensions."ts-error-translator".enable {
|
|
||||||
vim.startPlugins = ["ts-error-translator"];
|
|
||||||
vim.pluginRC.ts-error-translator = entryAnywhere ''
|
|
||||||
require("ts-error-translator").setup(${toLuaObject cfg.extensions.ts-error-translator.setupOpts})
|
|
||||||
'';
|
|
||||||
})
|
|
||||||
|
|
||||||
# Warn the user if they have set the default server name to tsserver to match upstream (us)
|
|
||||||
# The name "tsserver" has been deprecated in lspconfig, and now should be called ts_ls. This
|
|
||||||
# is a purely cosmetic change, but emits a warning if not accounted for.
|
|
||||||
{
|
|
||||||
assertions = [
|
|
||||||
{
|
|
||||||
assertion = cfg.lsp.enable -> cfg.lsp.server != "tsserver";
|
|
||||||
message = ''
|
|
||||||
As of a recent lspconfig update, the `tsserver` configuration has been renamed
|
|
||||||
to `ts_ls` to match upstream behaviour of `lspconfig`, and the name `tsserver`
|
|
||||||
is no longer considered valid by nvf. Please set `vim.languages.ts.lsp.server`
|
|
||||||
to `"ts_ls"` instead of to `${cfg.lsp.server}`
|
|
||||||
|
|
||||||
Please see <https://github.com/neovim/nvim-lspconfig/pull/3232> for more details
|
|
||||||
about this change.
|
|
||||||
'';
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,100 +0,0 @@
|
||||||
{
|
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
inherit (lib.options) mkEnableOption mkOption;
|
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
|
||||||
inherit (lib.lists) isList;
|
|
||||||
inherit (lib.types) enum either listOf package str;
|
|
||||||
inherit (lib.attrsets) attrNames;
|
|
||||||
inherit (lib.nvim.lua) expToLua;
|
|
||||||
inherit (lib.nvim.types) mkGrammarOption;
|
|
||||||
|
|
||||||
cfg = config.vim.languages.typst;
|
|
||||||
|
|
||||||
defaultFormat = "typstfmt";
|
|
||||||
formats = {
|
|
||||||
typstfmt = {
|
|
||||||
package = pkgs.typstfmt;
|
|
||||||
nullConfig = ''
|
|
||||||
table.insert(
|
|
||||||
ls_sources,
|
|
||||||
null_ls.builtins.formatting.typstfmt.with({
|
|
||||||
command = "${cfg.format.package}/bin/typstfmt",
|
|
||||||
})
|
|
||||||
)
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
# https://github.com/Enter-tainer/typstyle
|
|
||||||
typstyle = {
|
|
||||||
package = pkgs.typstyle;
|
|
||||||
nullConfig = ''
|
|
||||||
table.insert(
|
|
||||||
ls_sources,
|
|
||||||
null_ls.builtins.formatting.typstfmt.with({
|
|
||||||
command = "${cfg.format.package}/bin/typstyle",
|
|
||||||
})
|
|
||||||
)
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
in {
|
|
||||||
options.vim.languages.typst = {
|
|
||||||
enable = mkEnableOption "Typst language support";
|
|
||||||
|
|
||||||
treesitter = {
|
|
||||||
enable = mkEnableOption "Typst treesitter" // {default = config.vim.languages.enableTreesitter;};
|
|
||||||
package = mkGrammarOption pkgs "typst";
|
|
||||||
};
|
|
||||||
|
|
||||||
lsp = {
|
|
||||||
enable = mkEnableOption "Typst LSP support (typst-lsp)" // {default = config.vim.languages.enableLSP;};
|
|
||||||
|
|
||||||
package = mkOption {
|
|
||||||
description = "typst-lsp package, or the command to run as a list of strings";
|
|
||||||
example = ''[lib.getExe pkgs.jdt-language-server "-data" "~/.cache/jdtls/workspace"]'';
|
|
||||||
type = either package (listOf str);
|
|
||||||
default = pkgs.typst-lsp;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
format = {
|
|
||||||
enable = mkEnableOption "Typst document formatting" // {default = config.vim.languages.enableFormat;};
|
|
||||||
|
|
||||||
type = mkOption {
|
|
||||||
description = "Typst formatter to use";
|
|
||||||
type = enum (attrNames formats);
|
|
||||||
default = defaultFormat;
|
|
||||||
};
|
|
||||||
|
|
||||||
package = mkOption {
|
|
||||||
description = "Typst formatter package";
|
|
||||||
type = package;
|
|
||||||
default = formats.${cfg.format.type}.package;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
config = mkIf cfg.enable (mkMerge [
|
|
||||||
(mkIf cfg.treesitter.enable {
|
|
||||||
vim.treesitter.enable = true;
|
|
||||||
vim.treesitter.grammars = [cfg.treesitter.package];
|
|
||||||
})
|
|
||||||
|
|
||||||
(mkIf cfg.lsp.enable {
|
|
||||||
vim.lsp.lspconfig.enable = true;
|
|
||||||
vim.lsp.lspconfig.sources.typst-lsp = ''
|
|
||||||
lspconfig.typst_lsp.setup {
|
|
||||||
capabilities = capabilities,
|
|
||||||
on_attach=default_on_attach,
|
|
||||||
cmd = ${
|
|
||||||
if isList cfg.lsp.package
|
|
||||||
then expToLua cfg.lsp.package
|
|
||||||
else ''{"${cfg.lsp.package}/bin/typst-lsp"}''
|
|
||||||
},
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
})
|
|
||||||
]);
|
|
||||||
}
|
|
|
@ -16,10 +16,7 @@
|
||||||
|
|
||||||
mappingDefinitions = self.options.vim.lsp.mappings;
|
mappingDefinitions = self.options.vim.lsp.mappings;
|
||||||
mappings = addDescriptionsToMappings cfg.mappings mappingDefinitions;
|
mappings = addDescriptionsToMappings cfg.mappings mappingDefinitions;
|
||||||
mkBinding = binding: action:
|
mkBinding = binding: action: "vim.api.nvim_buf_set_keymap(bufnr, 'n', '${binding.value}', '<cmd>lua ${action}<CR>', {noremap=true, silent=true, desc='${binding.description}'})";
|
||||||
if binding.value != null
|
|
||||||
then "vim.api.nvim_buf_set_keymap(bufnr, 'n', '${binding.value}', '<cmd>lua ${action}<CR>', {noremap=true, silent=true, desc='${binding.description}'})"
|
|
||||||
else "";
|
|
||||||
in {
|
in {
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
vim = {
|
vim = {
|
||||||
|
@ -27,7 +24,7 @@ in {
|
||||||
|
|
||||||
autocomplete.sources = {"nvim_lsp" = "[LSP]";};
|
autocomplete.sources = {"nvim_lsp" = "[LSP]";};
|
||||||
|
|
||||||
pluginRC.lsp-setup = ''
|
luaConfigRC.lsp-setup = ''
|
||||||
vim.g.formatsave = ${boolToString cfg.formatOnSave};
|
vim.g.formatsave = ${boolToString cfg.formatOnSave};
|
||||||
|
|
||||||
local attach_keymaps = function(client, bufnr)
|
local attach_keymaps = function(client, bufnr)
|
||||||
|
@ -103,11 +100,11 @@ in {
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
${optionalString config.vim.ui.breadcrumbs.enable ''local navic = require("nvim-navic")''}
|
${optionalString (config.vim.ui.breadcrumbs.enable) ''local navic = require("nvim-navic")''}
|
||||||
default_on_attach = function(client, bufnr)
|
default_on_attach = function(client, bufnr)
|
||||||
attach_keymaps(client, bufnr)
|
attach_keymaps(client, bufnr)
|
||||||
format_callback(client, bufnr)
|
format_callback(client, bufnr)
|
||||||
${optionalString config.vim.ui.breadcrumbs.enable ''
|
${optionalString (config.vim.ui.breadcrumbs.enable) ''
|
||||||
-- let navic attach to buffers
|
-- let navic attach to buffers
|
||||||
if client.server_capabilities.documentSymbolProvider then
|
if client.server_capabilities.documentSymbolProvider then
|
||||||
navic.attach(client, bufnr)
|
navic.attach(client, bufnr)
|
||||||
|
|
|
@ -10,10 +10,10 @@
|
||||||
|
|
||||||
# lsp plugins
|
# lsp plugins
|
||||||
./lspsaga
|
./lspsaga
|
||||||
|
./nvim-code-action-menu
|
||||||
./trouble
|
./trouble
|
||||||
./lsp-signature
|
./lsp-signature
|
||||||
./lightbulb
|
./lightbulb
|
||||||
./otter
|
|
||||||
./lspkind
|
./lspkind
|
||||||
./lsplines
|
./lsplines
|
||||||
./nvim-docs-view
|
./nvim-docs-view
|
||||||
|
|
|
@ -12,7 +12,7 @@ in {
|
||||||
vim = {
|
vim = {
|
||||||
startPlugins = ["nvim-lightbulb"];
|
startPlugins = ["nvim-lightbulb"];
|
||||||
|
|
||||||
pluginRC.lightbulb = entryAnywhere ''
|
luaConfigRC.lightbulb = entryAnywhere ''
|
||||||
vim.api.nvim_command('autocmd CursorHold,CursorHoldI * lua require\'nvim-lightbulb\'.update_lightbulb()')
|
vim.api.nvim_command('autocmd CursorHold,CursorHoldI * lua require\'nvim-lightbulb\'.update_lightbulb()')
|
||||||
|
|
||||||
-- Enable trouble diagnostics viewer
|
-- Enable trouble diagnostics viewer
|
||||||
|
|
|
@ -20,7 +20,7 @@ in {
|
||||||
handler_opts.border = config.vim.ui.borders.plugins.lsp-signature.style;
|
handler_opts.border = config.vim.ui.borders.plugins.lsp-signature.style;
|
||||||
};
|
};
|
||||||
|
|
||||||
pluginRC.lsp-signature = entryAnywhere ''
|
luaConfigRC.lsp-signature = entryAnywhere ''
|
||||||
-- Enable lsp signature viewer
|
-- Enable lsp signature viewer
|
||||||
require("lsp_signature").setup(${toLuaObject cfg.lspSignature.setupOpts})
|
require("lsp_signature").setup(${toLuaObject cfg.lspSignature.setupOpts})
|
||||||
'';
|
'';
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue