mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2025-01-10 01:59:49 +01:00
Compare commits
No commits in common. "6e8bb14567a16b1a9250cc86ad62f1321cf4184d" and "eb76f5fbd5b383438f93a7cfa5026518b780471e" have entirely different histories.
6e8bb14567
...
eb76f5fbd5
417 changed files with 8935 additions and 12992 deletions
225
.github/README.md
vendored
225
.github/README.md
vendored
|
@ -1,55 +1,55 @@
|
||||||
<div align="center">
|
<div align="center">
|
||||||
<img src="assets/nvf-logo-work.svg" alt="nvf Logo" width="200">
|
<img src="../assets/neovim-flake-logo-work.svg" alt="neovim-flake Logo" width="200">
|
||||||
<h1 ❄️ nvf</h1>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div align="center">
|
<h1 align="center">❄️ neovim-flake</h1>
|
||||||
<p>
|
|
||||||
<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" />
|
|
||||||
</a>
|
|
||||||
<a href="https://github.com/NotAShelf/nvf/pulse">
|
|
||||||
<img alt="Last commit" src="https://img.shields.io/github/last-commit/NotAShelf/nvf?style=for-the-badge&logo=starship&color=8bd5ca&logoColor=D9E0EE&labelColor=302D41"/>
|
|
||||||
</a>
|
|
||||||
<a href="https://github.com/NotAShelf/nvf/blob/main/LICENSE">
|
|
||||||
<img alt="License" src="https://img.shields.io/github/license/NotAShelf/nvf?style=for-the-badge&logo=nixos&color=ee999f&logoColor=D9E0EE&labelColor=302D41" />
|
|
||||||
</a>
|
|
||||||
<a href="https://github.com/NotAShelf/nvf/stargazers">
|
|
||||||
<img alt="Stars" src="https://img.shields.io/github/stars/NotAShelf/nvf?style=for-the-badge&logo=nixos&color=c69ff5&logoColor=D9E0EE&labelColor=302D41" />
|
|
||||||
</a>
|
|
||||||
<a href="https://github.com/NotAShelf/nvf/issues">
|
|
||||||
<img alt="Issues" src="https://img.shields.io/github/issues/NotAShelf/nvf?style=for-the-badge&logo=bilibili&color=F5E0DC&logoColor=D9E0EE&labelColor=302D41" />
|
|
||||||
</a>
|
|
||||||
<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" />
|
|
||||||
</a>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<p align="center">
|
|
||||||
<img src="https://stars.medv.io/NotAShelf/nvf.svg", title="stars"/>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<div align="center">
|
<div align="center">
|
||||||
<a>
|
<a>
|
||||||
A highly modular, configurable, extensible and easy to use Neovim configuration
|
A highly modular, configurable, extensible and easy to use Neovim configuration wrapper written in Nix. Designed for flexibility and ease of use and with code quality in mind.
|
||||||
framework in Nix. Designed for flexibility and ease of use, this flake
|
|
||||||
allows you to easily configure your Neovim instance with a few lines of
|
|
||||||
Nix code.
|
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
<br/>
|
||||||
|
|
||||||
|
<div align="center">
|
||||||
|
<p>
|
||||||
|
<a href="https://github.com/NotAShelf/neovim-flake/releases/latest">
|
||||||
|
<img alt="Latest release" src="https://img.shields.io/github/v/release/NotAShelf/neovim-flake?style=for-the-badge&logo=nixos&color=C9CBFF&logoColor=D9E0EE&labelColor=302D41" />
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/NotAShelf/neovim-flake/pulse">
|
||||||
|
<img alt="Last commit" src="https://img.shields.io/github/last-commit/NotAShelf/neovim-flake?style=for-the-badge&logo=starship&color=8bd5ca&logoColor=D9E0EE&labelColor=302D41"/>
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/NotAShelf/neovim-flake/blob/main/LICENSE">
|
||||||
|
<img alt="License" src="https://img.shields.io/github/license/NotAShelf/neovim-flake?style=for-the-badge&logo=nixos&color=ee999f&logoColor=D9E0EE&labelColor=302D41" />
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/NotAShelf/neovim-flake/stargazers">
|
||||||
|
<img alt="Stars" src="https://img.shields.io/github/stars/NotAShelf/neovim-flake?style=for-the-badge&logo=nixos&color=c69ff5&logoColor=D9E0EE&labelColor=302D41" />
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/NotAShelf/neovim-flake/issues">
|
||||||
|
<img alt="Issues" src="https://img.shields.io/github/issues/NotAShelf/neovim-flake?style=for-the-badge&logo=bilibili&color=F5E0DC&logoColor=D9E0EE&labelColor=302D41" />
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/NotAShelf/neovim-flake">
|
||||||
|
<img alt="Repo Size" src="https://img.shields.io/github/repo-size/NotAShelf/neovim-flake?color=%23DDB6F2&label=SIZE&logo=codesandbox&style=for-the-badge&logoColor=D9E0EE&labelColor=302D41" />
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p align="center">
|
||||||
|
<img src="https://stars.medv.io/NotAShelf/neovim-flake.svg", title="stars"/>
|
||||||
|
</p>
|
||||||
|
</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>
|
||||||
|
|
||||||
[Get Started]: #get-started
|
|
||||||
[Documentation]: #documentation
|
|
||||||
[Help]: #help
|
|
||||||
[Contribute]: #contributing
|
|
||||||
[FAQ]: #faq
|
|
||||||
[Credits]: #credits
|
|
||||||
|
|
||||||
**[<kbd> <br> Get Started <br> </kbd>][Get Started]**
|
**[<kbd> <br> Get Started <br> </kbd>][Get Started]**
|
||||||
**[<kbd> <br> Documentation <br> </kbd>][Documentation]**
|
**[<kbd> <br> Documentation <br> </kbd>][Documentation]**
|
||||||
**[<kbd> <br> Help <br> </kbd>][Help]**
|
**[<kbd> <br> Help <br> </kbd>][Help]**
|
||||||
|
@ -59,97 +59,122 @@
|
||||||
|
|
||||||
</p></div>
|
</p></div>
|
||||||
|
|
||||||
|
[Get Started]: #get-started
|
||||||
|
[Documentation]: #documentation
|
||||||
|
[Help]: #help
|
||||||
|
[Contribute]: #contributing
|
||||||
|
[FAQ]: #faq
|
||||||
|
[Credits]: #credits
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Get Started
|
## Get Started
|
||||||
|
|
||||||
### Using `nix` CLI
|
### Using `nix` CLI
|
||||||
|
|
||||||
If you would like to try out the configuration before even thinking about
|
If you would like to try out the configuration before even thinking about installing it, you can run the following command
|
||||||
installing it, you can run the following command
|
|
||||||
|
|
||||||
```console
|
```console
|
||||||
nix run github:notashelf/nvf
|
nix run github:notashelf/neovim-flake
|
||||||
```
|
```
|
||||||
|
|
||||||
This will get you a feel for the base configuration and UI design.
|
This will get you a feel for the base configuration and UI design. The flake exposes `#nix` as the default package, providing minimal language support and various
|
||||||
The flake exposes `#nix` as the default package, providing minimal
|
utilities.You may also use `#nix`, `#tidal` or `#maximal` to get try out different configurations.
|
||||||
language support and various utilities.You may also use `#nix`,
|
|
||||||
`#tidal` or `#maximal` to get try out different configurations.
|
|
||||||
|
|
||||||
It is as simple as changing the target output to get a different
|
It is as simple as changing the target output to get a different configuration. For example, to get a configuration with `tidal` support, run:
|
||||||
configuration. For example, to get a configuration with `tidal` support, run:
|
|
||||||
|
|
||||||
```console
|
```console
|
||||||
nix run github:notashelf/nvf#tidal
|
nix run github:notashelf/neovim-flake#tidal
|
||||||
```
|
```
|
||||||
|
|
||||||
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 _massive_ and will 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` or `tidal`
|
> To get a feel for the configuration, use the default `nix` or `tidal` configurations.
|
||||||
> configurations. Should you choose to try out the `maximal` configuration,
|
> Should you choose to try out the `maximal` configuration, using the binary cache as described
|
||||||
> using the binary cache as described in the manual is _strongly_ recommended.
|
> in the manual is _strongly_ recommended.
|
||||||
|
|
||||||
|
### Docker
|
||||||
|
|
||||||
|
As of version 0.5, an image for the `nix` output is published to Dockerhub and GitHub packages with each tagged release. If you do not have Docker installed
|
||||||
|
on your system, you may run neovim within a container using your favorite tool. You are still recommended to use `nix` instead of Docker.
|
||||||
|
|
||||||
|
The following command will open the current directory in neovim with necessary tools bootstrapped.
|
||||||
|
|
||||||
|
```console
|
||||||
|
docker run -v `pwd`:/home/neovim/demo --rm -it notashelf/neovim-flake:latest
|
||||||
|
```
|
||||||
|
|
||||||
|
The available registeres are `ghcr.io` and `dockerhub` for the time being. Adjust to your liking.
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
See the [**nvf** Manual](https://notashelf.github.io/nvf/) for
|
See the [neovim-flake Manual](https://notashelf.github.io/neovim-flake/) for detailed installation guides, configurations, available options, release notes
|
||||||
detailed installation guides, configurations, available options, release notes
|
and more.
|
||||||
and more. Tips for installing userspace plugins is also contained in the
|
|
||||||
documentation.
|
|
||||||
|
|
||||||
If you want to dive right into trying **nvf** you can get a fully
|
If you want to dive right into trying **neovim-flake** you can get a fully featured configuration with `nix`
|
||||||
featured configuration with `nix` language support by running:
|
language support by running:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
nix run github:notashelf/nvf#nix
|
nix run github:notashelf/neovim-flake
|
||||||
```
|
```
|
||||||
|
|
||||||
[Issues]: https://github.com/NotAShelf/nvf/issues
|
Please create an issue on the [issue tracker](../../../issues) if you find the documentation lacking or confusing.
|
||||||
|
I also appreciate any contributions to the documentation.
|
||||||
Please create an issue on the [issue tracker](issues) if you find
|
|
||||||
the documentation lacking or confusing. I also appreciate any contributions
|
|
||||||
to the documentation.
|
|
||||||
|
|
||||||
## Help
|
## Help
|
||||||
|
|
||||||
You can create an issue on the [issue tracker](issues) to ask questions
|
You can create an issue on the [issue tracker](../../../issues) to ask questions or report bugs.
|
||||||
or report bugs. I am not yet on spaces like matrix or IRC, so please use the issue
|
I am not yet on spaces like matrix or IRC, so please use the issue tracker for 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
|
||||||
to contribute, please read the [contributing guide](CONTRIBUTING.md) before
|
the [contributing guide](CONTRIBUTING.md) before submitting a pull request. You can also create an
|
||||||
submitting a pull request. You can also create an issue on the
|
issue on the [issue tracker](../../../issues) before submitting a pull request if you would like to discuss
|
||||||
[issue tracker](issues) before submitting a pull request if you would
|
a feature or bug fix.
|
||||||
like to discuss a feature or bug fix.
|
|
||||||
|
## Philosophy
|
||||||
|
|
||||||
|
The philosophy behind this flake configuration is to create an easily configurable and reproducible Neovim environment.
|
||||||
|
While it does sacrifice in size (which I know some users will find _disagreeable_), it offers a lot of flexibility and customizability in
|
||||||
|
exchange for the large size of the flake inputs. The "KISS" (Keep it simple, stupid) principle has mostly been abandoned here, however, you _can_
|
||||||
|
ultimately leverage the flexibility of this flake to declare a configuration that follows KISS principles, as it is very easy to bring your
|
||||||
|
own plugins and configurations from non-nix. What this flake is meant to be does eventually fall into your hands. Whether you are a
|
||||||
|
developer, writer, or live coder, you can quickly craft a config that suits every project's need. Think of it like a distribution of Neovim that you have
|
||||||
|
full control over. A distribution that takes advantage of pinning vim plugins and third party dependencies (such as tree-sitter grammars, language servers, and more).
|
||||||
|
|
||||||
|
One should never get a broken config when setting options. If setting multiple options results in a broken Neovim, file an issue!
|
||||||
|
Each plugin knows when another plugin which allows for smart configuration of keybindings and automatic setup of things
|
||||||
|
like completion sources and languages.
|
||||||
|
|
||||||
## FAQ
|
## FAQ
|
||||||
|
|
||||||
|
**Q**: Why is this flake so big?
|
||||||
|
<br/>
|
||||||
|
**A**: I have sacrificed in size in order to provide a highly configurable and reproducible Neovim environment. A binary cache is provided to
|
||||||
|
eleminate the need to build the flake from source, but it is still a large flake. If you do not need all the features, you can use the default `nix` output
|
||||||
|
instead of the `maximal` output. This will reduce size by a lot, but you will lose some language specific features.
|
||||||
|
<br/><br/>
|
||||||
|
|
||||||
|
**Q**: Will you try to make this flake smaller?
|
||||||
|
<br/>
|
||||||
|
**A**: Yes. As a matter of fact, I am actively working on making this flake smaller. Unfortunately the process of providing everything
|
||||||
|
possible by itself makes the flake large. Best I can do is to optimize the flake as much as possible by selecting plugins that
|
||||||
|
are small and fast. And the binary cache, so at least you don't have to build it from source.
|
||||||
|
<br/><br/>
|
||||||
|
|
||||||
|
**Q**: Will you use a plugin manager/language server installer?
|
||||||
|
<br/>
|
||||||
|
**A**: No. If you feel the need to ask that question, then you have missed the whole point of using nix and ultimately this flake.
|
||||||
|
The whole reason we use nix is to be able to handle EVERYTHING declaratively, well including the LSP and plugin installations.
|
||||||
|
<br/><br/>
|
||||||
|
|
||||||
**Q**: Can you add _X_?
|
**Q**: Can you add _X_?
|
||||||
<br/>
|
<br/>
|
||||||
**A**: Maybe! It is not one of our goals to support each and every Neovim
|
**A**: Maybe. Open an issue using the appropriate template and I will consider it. I do not intend to
|
||||||
plugin, however, I am always open to new modules and plugin setup additions
|
add _every plugin that is in existence_, but I will consider it, should it offer something useful to the flake.
|
||||||
to **nvf**. Use the [appropritate issue template](issues/new/choose) and I will
|
|
||||||
consider a module addition.
|
|
||||||
|
|
||||||
**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
|
|
||||||
plugin configurations! Please see the documentation on how you may do
|
|
||||||
this.
|
|
||||||
|
|
||||||
**Q**: Main branch is awfully silent, is the project dead?
|
|
||||||
<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 available to the end user. If you have
|
|
||||||
not noticed any activity on the main branch, consider taking a look at the [list
|
|
||||||
of branches](https://github.com/NotAShelf/nvf/branches=) or the [list of open
|
|
||||||
pull requests](https://github.com/NotAShelf/nvf)
|
|
||||||
|
|
||||||
## Credits
|
## Credits
|
||||||
|
|
||||||
|
@ -161,31 +186,23 @@ Special thanks to
|
||||||
- [@FlafyDev](https://github.com/FlafyDev) - For getting the home-manager to work
|
- [@FlafyDev](https://github.com/FlafyDev) - For getting the home-manager to work
|
||||||
- [@n3oney](https://github.com/n3oney) - For making custom keybinds finally possible
|
- [@n3oney](https://github.com/n3oney) - For making custom keybinds finally possible
|
||||||
- [@horriblename](https://github.com/horriblename) - For actively implementing planned features and quality of life updates
|
- [@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 neovim-flake logo
|
||||||
- [@FrothyMarrow](https://github.com/FrothyMarrow) - For seeing mistakes that I could not
|
- [@FrothyMarrow](https://github.com/FrothyMarrow) - For seeing mistakes that I could not
|
||||||
|
|
||||||
and everyone who has submitted issues or pull requests!
|
and everyone who has submitted issues or pull requests!
|
||||||
|
|
||||||
### Inspiration
|
### Inspiration
|
||||||
|
|
||||||
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) [neovim-flake](https://github.com/jordanisaacs/neovim-flake) that this flake is originally based on.
|
- [@jordanisaacs's](https://github.com/jordanisaacs) [neovim-flake](https://github.com/jordanisaacs/neovim-flake) that this flake is originally based on.
|
||||||
- [@sioodmy's](https://github.com/sioodmy) [dotfiles](https://github.com/sioodmy/dotfiles) that inspired the design choices.
|
- [@sioodmy's](https://github.com/sioodmy) [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.
|
- [@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.
|
- [@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.
|
|
||||||
<br/>
|
<br/>
|
||||||
|
|
||||||
## License
|
|
||||||
|
|
||||||
Following the [original neovim-flake](https://github.com/jordanisaacs/neovim-flake)
|
|
||||||
**nvf** has been made available under the **MIT License**. However, all assets
|
|
||||||
and documentation are published under the [CC BY License].
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
<div align="right">
|
<div align="right">
|
||||||
|
|
395
.github/assets/LICENSE
vendored
395
.github/assets/LICENSE
vendored
|
@ -1,395 +0,0 @@
|
||||||
Attribution 4.0 International
|
|
||||||
|
|
||||||
=======================================================================
|
|
||||||
|
|
||||||
Creative Commons Corporation ("Creative Commons") is not a law firm and
|
|
||||||
does not provide legal services or legal advice. Distribution of
|
|
||||||
Creative Commons public licenses does not create a lawyer-client or
|
|
||||||
other relationship. Creative Commons makes its licenses and related
|
|
||||||
information available on an "as-is" basis. Creative Commons gives no
|
|
||||||
warranties regarding its licenses, any material licensed under their
|
|
||||||
terms and conditions, or any related information. Creative Commons
|
|
||||||
disclaims all liability for damages resulting from their use to the
|
|
||||||
fullest extent possible.
|
|
||||||
|
|
||||||
Using Creative Commons Public Licenses
|
|
||||||
|
|
||||||
Creative Commons public licenses provide a standard set of terms and
|
|
||||||
conditions that creators and other rights holders may use to share
|
|
||||||
original works of authorship and other material subject to copyright
|
|
||||||
and certain other rights specified in the public license below. The
|
|
||||||
following considerations are for informational purposes only, are not
|
|
||||||
exhaustive, and do not form part of our licenses.
|
|
||||||
|
|
||||||
Considerations for licensors: Our public licenses are
|
|
||||||
intended for use by those authorized to give the public
|
|
||||||
permission to use material in ways otherwise restricted by
|
|
||||||
copyright and certain other rights. Our licenses are
|
|
||||||
irrevocable. Licensors should read and understand the terms
|
|
||||||
and conditions of the license they choose before applying it.
|
|
||||||
Licensors should also secure all rights necessary before
|
|
||||||
applying our licenses so that the public can reuse the
|
|
||||||
material as expected. Licensors should clearly mark any
|
|
||||||
material not subject to the license. This includes other CC-
|
|
||||||
licensed material, or material used under an exception or
|
|
||||||
limitation to copyright. More considerations for licensors:
|
|
||||||
wiki.creativecommons.org/Considerations_for_licensors
|
|
||||||
|
|
||||||
Considerations for the public: By using one of our public
|
|
||||||
licenses, a licensor grants the public permission to use the
|
|
||||||
licensed material under specified terms and conditions. If
|
|
||||||
the licensor's permission is not necessary for any reason--for
|
|
||||||
example, because of any applicable exception or limitation to
|
|
||||||
copyright--then that use is not regulated by the license. Our
|
|
||||||
licenses grant only permissions under copyright and certain
|
|
||||||
other rights that a licensor has authority to grant. Use of
|
|
||||||
the licensed material may still be restricted for other
|
|
||||||
reasons, including because others have copyright or other
|
|
||||||
rights in the material. A licensor may make special requests,
|
|
||||||
such as asking that all changes be marked or described.
|
|
||||||
Although not required by our licenses, you are encouraged to
|
|
||||||
respect those requests where reasonable. More considerations
|
|
||||||
for the public:
|
|
||||||
wiki.creativecommons.org/Considerations_for_licensees
|
|
||||||
|
|
||||||
=======================================================================
|
|
||||||
|
|
||||||
Creative Commons Attribution 4.0 International Public License
|
|
||||||
|
|
||||||
By exercising the Licensed Rights (defined below), You accept and agree
|
|
||||||
to be bound by the terms and conditions of this Creative Commons
|
|
||||||
Attribution 4.0 International Public License ("Public License"). To the
|
|
||||||
extent this Public License may be interpreted as a contract, You are
|
|
||||||
granted the Licensed Rights in consideration of Your acceptance of
|
|
||||||
these terms and conditions, and the Licensor grants You such rights in
|
|
||||||
consideration of benefits the Licensor receives from making the
|
|
||||||
Licensed Material available under these terms and conditions.
|
|
||||||
|
|
||||||
|
|
||||||
Section 1 -- Definitions.
|
|
||||||
|
|
||||||
a. Adapted Material means material subject to Copyright and Similar
|
|
||||||
Rights that is derived from or based upon the Licensed Material
|
|
||||||
and in which the Licensed Material is translated, altered,
|
|
||||||
arranged, transformed, or otherwise modified in a manner requiring
|
|
||||||
permission under the Copyright and Similar Rights held by the
|
|
||||||
Licensor. For purposes of this Public License, where the Licensed
|
|
||||||
Material is a musical work, performance, or sound recording,
|
|
||||||
Adapted Material is always produced where the Licensed Material is
|
|
||||||
synched in timed relation with a moving image.
|
|
||||||
|
|
||||||
b. Adapter's License means the license You apply to Your Copyright
|
|
||||||
and Similar Rights in Your contributions to Adapted Material in
|
|
||||||
accordance with the terms and conditions of this Public License.
|
|
||||||
|
|
||||||
c. Copyright and Similar Rights means copyright and/or similar rights
|
|
||||||
closely related to copyright including, without limitation,
|
|
||||||
performance, broadcast, sound recording, and Sui Generis Database
|
|
||||||
Rights, without regard to how the rights are labeled or
|
|
||||||
categorized. For purposes of this Public License, the rights
|
|
||||||
specified in Section 2(b)(1)-(2) are not Copyright and Similar
|
|
||||||
Rights.
|
|
||||||
|
|
||||||
d. Effective Technological Measures means those measures that, in the
|
|
||||||
absence of proper authority, may not be circumvented under laws
|
|
||||||
fulfilling obligations under Article 11 of the WIPO Copyright
|
|
||||||
Treaty adopted on December 20, 1996, and/or similar international
|
|
||||||
agreements.
|
|
||||||
|
|
||||||
e. Exceptions and Limitations means fair use, fair dealing, and/or
|
|
||||||
any other exception or limitation to Copyright and Similar Rights
|
|
||||||
that applies to Your use of the Licensed Material.
|
|
||||||
|
|
||||||
f. Licensed Material means the artistic or literary work, database,
|
|
||||||
or other material to which the Licensor applied this Public
|
|
||||||
License.
|
|
||||||
|
|
||||||
g. Licensed Rights means the rights granted to You subject to the
|
|
||||||
terms and conditions of this Public License, which are limited to
|
|
||||||
all Copyright and Similar Rights that apply to Your use of the
|
|
||||||
Licensed Material and that the Licensor has authority to license.
|
|
||||||
|
|
||||||
h. Licensor means the individual(s) or entity(ies) granting rights
|
|
||||||
under this Public License.
|
|
||||||
|
|
||||||
i. Share means to provide material to the public by any means or
|
|
||||||
process that requires permission under the Licensed Rights, such
|
|
||||||
as reproduction, public display, public performance, distribution,
|
|
||||||
dissemination, communication, or importation, and to make material
|
|
||||||
available to the public including in ways that members of the
|
|
||||||
public may access the material from a place and at a time
|
|
||||||
individually chosen by them.
|
|
||||||
|
|
||||||
j. Sui Generis Database Rights means rights other than copyright
|
|
||||||
resulting from Directive 96/9/EC of the European Parliament and of
|
|
||||||
the Council of 11 March 1996 on the legal protection of databases,
|
|
||||||
as amended and/or succeeded, as well as other essentially
|
|
||||||
equivalent rights anywhere in the world.
|
|
||||||
|
|
||||||
k. You means the individual or entity exercising the Licensed Rights
|
|
||||||
under this Public License. Your has a corresponding meaning.
|
|
||||||
|
|
||||||
|
|
||||||
Section 2 -- Scope.
|
|
||||||
|
|
||||||
a. License grant.
|
|
||||||
|
|
||||||
1. Subject to the terms and conditions of this Public License,
|
|
||||||
the Licensor hereby grants You a worldwide, royalty-free,
|
|
||||||
non-sublicensable, non-exclusive, irrevocable license to
|
|
||||||
exercise the Licensed Rights in the Licensed Material to:
|
|
||||||
|
|
||||||
a. reproduce and Share the Licensed Material, in whole or
|
|
||||||
in part; and
|
|
||||||
|
|
||||||
b. produce, reproduce, and Share Adapted Material.
|
|
||||||
|
|
||||||
2. Exceptions and Limitations. For the avoidance of doubt, where
|
|
||||||
Exceptions and Limitations apply to Your use, this Public
|
|
||||||
License does not apply, and You do not need to comply with
|
|
||||||
its terms and conditions.
|
|
||||||
|
|
||||||
3. Term. The term of this Public License is specified in Section
|
|
||||||
6(a).
|
|
||||||
|
|
||||||
4. Media and formats; technical modifications allowed. The
|
|
||||||
Licensor authorizes You to exercise the Licensed Rights in
|
|
||||||
all media and formats whether now known or hereafter created,
|
|
||||||
and to make technical modifications necessary to do so. The
|
|
||||||
Licensor waives and/or agrees not to assert any right or
|
|
||||||
authority to forbid You from making technical modifications
|
|
||||||
necessary to exercise the Licensed Rights, including
|
|
||||||
technical modifications necessary to circumvent Effective
|
|
||||||
Technological Measures. For purposes of this Public License,
|
|
||||||
simply making modifications authorized by this Section 2(a)
|
|
||||||
(4) never produces Adapted Material.
|
|
||||||
|
|
||||||
5. Downstream recipients.
|
|
||||||
|
|
||||||
a. Offer from the Licensor -- Licensed Material. Every
|
|
||||||
recipient of the Licensed Material automatically
|
|
||||||
receives an offer from the Licensor to exercise the
|
|
||||||
Licensed Rights under the terms and conditions of this
|
|
||||||
Public License.
|
|
||||||
|
|
||||||
b. No downstream restrictions. You may not offer or impose
|
|
||||||
any additional or different terms or conditions on, or
|
|
||||||
apply any Effective Technological Measures to, the
|
|
||||||
Licensed Material if doing so restricts exercise of the
|
|
||||||
Licensed Rights by any recipient of the Licensed
|
|
||||||
Material.
|
|
||||||
|
|
||||||
6. No endorsement. Nothing in this Public License constitutes or
|
|
||||||
may be construed as permission to assert or imply that You
|
|
||||||
are, or that Your use of the Licensed Material is, connected
|
|
||||||
with, or sponsored, endorsed, or granted official status by,
|
|
||||||
the Licensor or others designated to receive attribution as
|
|
||||||
provided in Section 3(a)(1)(A)(i).
|
|
||||||
|
|
||||||
b. Other rights.
|
|
||||||
|
|
||||||
1. Moral rights, such as the right of integrity, are not
|
|
||||||
licensed under this Public License, nor are publicity,
|
|
||||||
privacy, and/or other similar personality rights; however, to
|
|
||||||
the extent possible, the Licensor waives and/or agrees not to
|
|
||||||
assert any such rights held by the Licensor to the limited
|
|
||||||
extent necessary to allow You to exercise the Licensed
|
|
||||||
Rights, but not otherwise.
|
|
||||||
|
|
||||||
2. Patent and trademark rights are not licensed under this
|
|
||||||
Public License.
|
|
||||||
|
|
||||||
3. To the extent possible, the Licensor waives any right to
|
|
||||||
collect royalties from You for the exercise of the Licensed
|
|
||||||
Rights, whether directly or through a collecting society
|
|
||||||
under any voluntary or waivable statutory or compulsory
|
|
||||||
licensing scheme. In all other cases the Licensor expressly
|
|
||||||
reserves any right to collect such royalties.
|
|
||||||
|
|
||||||
|
|
||||||
Section 3 -- License Conditions.
|
|
||||||
|
|
||||||
Your exercise of the Licensed Rights is expressly made subject to the
|
|
||||||
following conditions.
|
|
||||||
|
|
||||||
a. Attribution.
|
|
||||||
|
|
||||||
1. If You Share the Licensed Material (including in modified
|
|
||||||
form), You must:
|
|
||||||
|
|
||||||
a. retain the following if it is supplied by the Licensor
|
|
||||||
with the Licensed Material:
|
|
||||||
|
|
||||||
i. identification of the creator(s) of the Licensed
|
|
||||||
Material and any others designated to receive
|
|
||||||
attribution, in any reasonable manner requested by
|
|
||||||
the Licensor (including by pseudonym if
|
|
||||||
designated);
|
|
||||||
|
|
||||||
ii. a copyright notice;
|
|
||||||
|
|
||||||
iii. a notice that refers to this Public License;
|
|
||||||
|
|
||||||
iv. a notice that refers to the disclaimer of
|
|
||||||
warranties;
|
|
||||||
|
|
||||||
v. a URI or hyperlink to the Licensed Material to the
|
|
||||||
extent reasonably practicable;
|
|
||||||
|
|
||||||
b. indicate if You modified the Licensed Material and
|
|
||||||
retain an indication of any previous modifications; and
|
|
||||||
|
|
||||||
c. indicate the Licensed Material is licensed under this
|
|
||||||
Public License, and include the text of, or the URI or
|
|
||||||
hyperlink to, this Public License.
|
|
||||||
|
|
||||||
2. You may satisfy the conditions in Section 3(a)(1) in any
|
|
||||||
reasonable manner based on the medium, means, and context in
|
|
||||||
which You Share the Licensed Material. For example, it may be
|
|
||||||
reasonable to satisfy the conditions by providing a URI or
|
|
||||||
hyperlink to a resource that includes the required
|
|
||||||
information.
|
|
||||||
|
|
||||||
3. If requested by the Licensor, You must remove any of the
|
|
||||||
information required by Section 3(a)(1)(A) to the extent
|
|
||||||
reasonably practicable.
|
|
||||||
|
|
||||||
4. If You Share Adapted Material You produce, the Adapter's
|
|
||||||
License You apply must not prevent recipients of the Adapted
|
|
||||||
Material from complying with this Public License.
|
|
||||||
|
|
||||||
|
|
||||||
Section 4 -- Sui Generis Database Rights.
|
|
||||||
|
|
||||||
Where the Licensed Rights include Sui Generis Database Rights that
|
|
||||||
apply to Your use of the Licensed Material:
|
|
||||||
|
|
||||||
a. for the avoidance of doubt, Section 2(a)(1) grants You the right
|
|
||||||
to extract, reuse, reproduce, and Share all or a substantial
|
|
||||||
portion of the contents of the database;
|
|
||||||
|
|
||||||
b. if You include all or a substantial portion of the database
|
|
||||||
contents in a database in which You have Sui Generis Database
|
|
||||||
Rights, then the database in which You have Sui Generis Database
|
|
||||||
Rights (but not its individual contents) is Adapted Material; and
|
|
||||||
|
|
||||||
c. You must comply with the conditions in Section 3(a) if You Share
|
|
||||||
all or a substantial portion of the contents of the database.
|
|
||||||
|
|
||||||
For the avoidance of doubt, this Section 4 supplements and does not
|
|
||||||
replace Your obligations under this Public License where the Licensed
|
|
||||||
Rights include other Copyright and Similar Rights.
|
|
||||||
|
|
||||||
|
|
||||||
Section 5 -- Disclaimer of Warranties and Limitation of Liability.
|
|
||||||
|
|
||||||
a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
|
|
||||||
EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
|
|
||||||
AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
|
|
||||||
ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
|
|
||||||
IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
|
|
||||||
WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
|
||||||
PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
|
|
||||||
ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
|
|
||||||
KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
|
|
||||||
ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
|
|
||||||
|
|
||||||
b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
|
|
||||||
TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
|
|
||||||
NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
|
|
||||||
INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
|
|
||||||
COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
|
|
||||||
USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
|
|
||||||
ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
|
|
||||||
DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
|
|
||||||
IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
|
|
||||||
|
|
||||||
c. The disclaimer of warranties and limitation of liability provided
|
|
||||||
above shall be interpreted in a manner that, to the extent
|
|
||||||
possible, most closely approximates an absolute disclaimer and
|
|
||||||
waiver of all liability.
|
|
||||||
|
|
||||||
|
|
||||||
Section 6 -- Term and Termination.
|
|
||||||
|
|
||||||
a. This Public License applies for the term of the Copyright and
|
|
||||||
Similar Rights licensed here. However, if You fail to comply with
|
|
||||||
this Public License, then Your rights under this Public License
|
|
||||||
terminate automatically.
|
|
||||||
|
|
||||||
b. Where Your right to use the Licensed Material has terminated under
|
|
||||||
Section 6(a), it reinstates:
|
|
||||||
|
|
||||||
1. automatically as of the date the violation is cured, provided
|
|
||||||
it is cured within 30 days of Your discovery of the
|
|
||||||
violation; or
|
|
||||||
|
|
||||||
2. upon express reinstatement by the Licensor.
|
|
||||||
|
|
||||||
For the avoidance of doubt, this Section 6(b) does not affect any
|
|
||||||
right the Licensor may have to seek remedies for Your violations
|
|
||||||
of this Public License.
|
|
||||||
|
|
||||||
c. For the avoidance of doubt, the Licensor may also offer the
|
|
||||||
Licensed Material under separate terms or conditions or stop
|
|
||||||
distributing the Licensed Material at any time; however, doing so
|
|
||||||
will not terminate this Public License.
|
|
||||||
|
|
||||||
d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
|
|
||||||
License.
|
|
||||||
|
|
||||||
|
|
||||||
Section 7 -- Other Terms and Conditions.
|
|
||||||
|
|
||||||
a. The Licensor shall not be bound by any additional or different
|
|
||||||
terms or conditions communicated by You unless expressly agreed.
|
|
||||||
|
|
||||||
b. Any arrangements, understandings, or agreements regarding the
|
|
||||||
Licensed Material not stated herein are separate from and
|
|
||||||
independent of the terms and conditions of this Public License.
|
|
||||||
|
|
||||||
|
|
||||||
Section 8 -- Interpretation.
|
|
||||||
|
|
||||||
a. For the avoidance of doubt, this Public License does not, and
|
|
||||||
shall not be interpreted to, reduce, limit, restrict, or impose
|
|
||||||
conditions on any use of the Licensed Material that could lawfully
|
|
||||||
be made without permission under this Public License.
|
|
||||||
|
|
||||||
b. To the extent possible, if any provision of this Public License is
|
|
||||||
deemed unenforceable, it shall be automatically reformed to the
|
|
||||||
minimum extent necessary to make it enforceable. If the provision
|
|
||||||
cannot be reformed, it shall be severed from this Public License
|
|
||||||
without affecting the enforceability of the remaining terms and
|
|
||||||
conditions.
|
|
||||||
|
|
||||||
c. No term or condition of this Public License will be waived and no
|
|
||||||
failure to comply consented to unless expressly agreed to by the
|
|
||||||
Licensor.
|
|
||||||
|
|
||||||
d. Nothing in this Public License constitutes or may be interpreted
|
|
||||||
as a limitation upon, or waiver of, any privileges and immunities
|
|
||||||
that apply to the Licensor or You, including from the legal
|
|
||||||
processes of any jurisdiction or authority.
|
|
||||||
|
|
||||||
|
|
||||||
=======================================================================
|
|
||||||
|
|
||||||
Creative Commons is not a party to its public licenses.
|
|
||||||
Notwithstanding, Creative Commons may elect to apply one of its public
|
|
||||||
licenses to material it publishes and in those instances will be
|
|
||||||
considered the “Licensor.” The text of the Creative Commons public
|
|
||||||
licenses is dedicated to the public domain under the CC0 Public Domain
|
|
||||||
Dedication. Except for the limited purpose of indicating that material
|
|
||||||
is shared under a Creative Commons public license or as otherwise
|
|
||||||
permitted by the Creative Commons policies published at
|
|
||||||
creativecommons.org/policies, Creative Commons does not authorize the
|
|
||||||
use of the trademark "Creative Commons" or any other trademark or logo
|
|
||||||
of Creative Commons without its prior written consent including,
|
|
||||||
without limitation, in connection with any unauthorized modifications
|
|
||||||
to any of its public licenses or any other arrangements,
|
|
||||||
understandings, or agreements concerning use of licensed material. For
|
|
||||||
the avoidance of doubt, this paragraph does not form part of the public
|
|
||||||
licenses.
|
|
||||||
|
|
||||||
Creative Commons may be contacted at creativecommons.org.
|
|
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/
|
||||||
|
|
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
|
2
.github/workflows/manual.yml
vendored
2
.github/workflows/manual.yml
vendored
|
@ -33,7 +33,7 @@ jobs:
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
nix build '.#docs'
|
nix build '.#docs'
|
||||||
cp -r result/share/doc/nvf public
|
cp -r result/share/doc/neovim-flake public
|
||||||
|
|
||||||
- name: Deploy
|
- name: Deploy
|
||||||
uses: peaceiris/actions-gh-pages@v4
|
uses: peaceiris/actions-gh-pages@v4
|
||||||
|
|
2
LICENSE
2
LICENSE
|
@ -1,6 +1,6 @@
|
||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2023-2024 NotAShelf
|
Copyright (c) 2023 NotAShelf
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 44 KiB |
|
@ -7,11 +7,9 @@ inputs: let
|
||||||
lib ? pkgs.lib,
|
lib ? pkgs.lib,
|
||||||
check ? true,
|
check ? true,
|
||||||
extraSpecialArgs ? {},
|
extraSpecialArgs ? {},
|
||||||
extraModules ? [],
|
|
||||||
...
|
|
||||||
}:
|
}:
|
||||||
modulesWithInputs {
|
modulesWithInputs {
|
||||||
inherit pkgs lib check extraSpecialArgs extraModules;
|
inherit pkgs lib check extraSpecialArgs;
|
||||||
configuration.imports = modules;
|
configuration.imports = modules;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -20,20 +18,18 @@ inputs: let
|
||||||
};
|
};
|
||||||
|
|
||||||
mainConfig = isMaximal: {
|
mainConfig = isMaximal: {
|
||||||
config.vim = {
|
config = {
|
||||||
viAlias = true;
|
vim = {
|
||||||
vimAlias = true;
|
viAlias = true;
|
||||||
debugMode = {
|
vimAlias = true;
|
||||||
enable = false;
|
debugMode = {
|
||||||
level = 16;
|
enable = false;
|
||||||
logFile = "/tmp/nvim.log";
|
level = 20;
|
||||||
|
logFile = "/tmp/nvim.log";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
spellcheck = {
|
vim.lsp = {
|
||||||
enable = isMaximal;
|
|
||||||
};
|
|
||||||
|
|
||||||
lsp = {
|
|
||||||
formatOnSave = true;
|
formatOnSave = true;
|
||||||
lspkind.enable = false;
|
lspkind.enable = false;
|
||||||
lightbulb.enable = true;
|
lightbulb.enable = true;
|
||||||
|
@ -45,14 +41,14 @@ inputs: let
|
||||||
nvim-docs-view.enable = isMaximal;
|
nvim-docs-view.enable = isMaximal;
|
||||||
};
|
};
|
||||||
|
|
||||||
debugger = {
|
vim.debugger = {
|
||||||
nvim-dap = {
|
nvim-dap = {
|
||||||
enable = true;
|
enable = true;
|
||||||
ui.enable = true;
|
ui.enable = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
languages = {
|
vim.languages = {
|
||||||
enableLSP = true;
|
enableLSP = true;
|
||||||
enableFormat = true;
|
enableFormat = true;
|
||||||
enableTreesitter = true;
|
enableTreesitter = true;
|
||||||
|
@ -85,7 +81,7 @@ inputs: let
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
visuals = {
|
vim.visuals = {
|
||||||
enable = true;
|
enable = true;
|
||||||
nvimWebDevicons.enable = true;
|
nvimWebDevicons.enable = true;
|
||||||
scrollBar.enable = true;
|
scrollBar.enable = true;
|
||||||
|
@ -109,71 +105,70 @@ inputs: let
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
statusline = {
|
vim.statusline = {
|
||||||
lualine = {
|
lualine = {
|
||||||
enable = true;
|
enable = true;
|
||||||
theme = "catppuccin";
|
theme = "catppuccin";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
theme = {
|
vim.theme = {
|
||||||
enable = true;
|
enable = true;
|
||||||
name = "catppuccin";
|
name = "catppuccin";
|
||||||
style = "mocha";
|
style = "mocha";
|
||||||
transparent = false;
|
transparent = false;
|
||||||
};
|
};
|
||||||
|
vim.autopairs.enable = true;
|
||||||
|
|
||||||
autopairs.enable = true;
|
vim.autocomplete = {
|
||||||
|
|
||||||
autocomplete = {
|
|
||||||
enable = true;
|
enable = true;
|
||||||
type = "nvim-cmp";
|
type = "nvim-cmp";
|
||||||
};
|
};
|
||||||
|
|
||||||
filetree = {
|
vim.filetree = {
|
||||||
nvimTree = {
|
nvimTree = {
|
||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
tabline = {
|
vim.tabline = {
|
||||||
nvimBufferline.enable = true;
|
nvimBufferline.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
treesitter.context.enable = true;
|
vim.treesitter.context.enable = true;
|
||||||
|
|
||||||
binds = {
|
vim.binds = {
|
||||||
whichKey.enable = true;
|
whichKey.enable = true;
|
||||||
cheatsheet.enable = true;
|
cheatsheet.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
telescope.enable = true;
|
vim.telescope.enable = true;
|
||||||
|
|
||||||
git = {
|
vim.git = {
|
||||||
enable = true;
|
enable = true;
|
||||||
gitsigns.enable = true;
|
gitsigns.enable = true;
|
||||||
gitsigns.codeActions.enable = false; # throws an annoying debug message
|
gitsigns.codeActions = false; # throws an annoying debug message
|
||||||
};
|
};
|
||||||
|
|
||||||
minimap = {
|
vim.minimap = {
|
||||||
minimap-vim.enable = false;
|
minimap-vim.enable = false;
|
||||||
codewindow.enable = isMaximal; # lighter, faster, and uses lua for configuration
|
codewindow.enable = isMaximal; # lighter, faster, and uses lua for configuration
|
||||||
};
|
};
|
||||||
|
|
||||||
dashboard = {
|
vim.dashboard = {
|
||||||
dashboard-nvim.enable = false;
|
dashboard-nvim.enable = false;
|
||||||
alpha.enable = isMaximal;
|
alpha.enable = isMaximal;
|
||||||
};
|
};
|
||||||
|
|
||||||
notify = {
|
vim.notify = {
|
||||||
nvim-notify.enable = true;
|
nvim-notify.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
projects = {
|
vim.projects = {
|
||||||
project-nvim.enable = isMaximal;
|
project-nvim.enable = isMaximal;
|
||||||
};
|
};
|
||||||
|
|
||||||
utility = {
|
vim.utility = {
|
||||||
ccc.enable = isMaximal;
|
ccc.enable = isMaximal;
|
||||||
vim-wakatime.enable = isMaximal;
|
vim-wakatime.enable = isMaximal;
|
||||||
icon-picker.enable = isMaximal;
|
icon-picker.enable = isMaximal;
|
||||||
|
@ -183,27 +178,23 @@ inputs: let
|
||||||
hop.enable = true;
|
hop.enable = true;
|
||||||
leap.enable = true;
|
leap.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
images = {
|
|
||||||
image-nvim.enable = false;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
notes = {
|
vim.notes = {
|
||||||
obsidian.enable = false; # FIXME: neovim fails to build if obsidian is enabled
|
obsidian.enable = false; # FIXME neovim fails to build if obsidian is enabled
|
||||||
orgmode.enable = false;
|
orgmode.enable = false;
|
||||||
mind-nvim.enable = isMaximal;
|
mind-nvim.enable = isMaximal;
|
||||||
todo-comments.enable = true;
|
todo-comments.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
terminal = {
|
vim.terminal = {
|
||||||
toggleterm = {
|
toggleterm = {
|
||||||
enable = true;
|
enable = true;
|
||||||
lazygit.enable = true;
|
lazygit.enable = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
ui = {
|
vim.ui = {
|
||||||
borders.enable = true;
|
borders.enable = true;
|
||||||
noice.enable = true;
|
noice.enable = true;
|
||||||
colorizer.enable = true;
|
colorizer.enable = true;
|
||||||
|
@ -215,7 +206,7 @@ inputs: let
|
||||||
};
|
};
|
||||||
smartcolumn = {
|
smartcolumn = {
|
||||||
enable = true;
|
enable = true;
|
||||||
setupOpts.custom_colorcolumn = {
|
columnAt.languages = {
|
||||||
# this is a freeform module, it's `buftype = int;` for configuring column position
|
# this is a freeform module, it's `buftype = int;` for configuring column position
|
||||||
nix = 110;
|
nix = 110;
|
||||||
ruby = 120;
|
ruby = 120;
|
||||||
|
@ -225,28 +216,27 @@ inputs: let
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
assistant = {
|
vim.assistant = {
|
||||||
chatgpt.enable = false;
|
|
||||||
copilot = {
|
copilot = {
|
||||||
enable = false;
|
enable = isMaximal;
|
||||||
cmp.enable = isMaximal;
|
cmp.enable = isMaximal;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
session = {
|
vim.session = {
|
||||||
nvim-session-manager.enable = false;
|
nvim-session-manager.enable = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
gestures = {
|
vim.gestures = {
|
||||||
gesture-nvim.enable = false;
|
gesture-nvim.enable = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
comments = {
|
vim.comments = {
|
||||||
comment-nvim.enable = true;
|
comment-nvim.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
presence = {
|
vim.presence = {
|
||||||
neocord.enable = false;
|
neocord.enable = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
132
docs/default.nix
132
docs/default.nix
|
@ -1,46 +1,21 @@
|
||||||
{
|
{
|
||||||
inputs,
|
|
||||||
pkgs,
|
pkgs,
|
||||||
lib ? import ../lib/stdlib-extended.nix pkgs.lib inputs,
|
lib ? import ../lib/stdlib-extended.nix pkgs.lib,
|
||||||
manpageUrls ? pkgs.path + "/doc/manpage-urls.json",
|
nmdSrc,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.modules) mkForce evalModules;
|
nmd = import nmdSrc {
|
||||||
inherit (lib.strings) hasPrefix removePrefix;
|
inherit lib;
|
||||||
inherit (lib.attrsets) isAttrs mapAttrs optionalAttrs recursiveUpdate isDerivation;
|
# The DocBook output of `nixos-render-docs` doesn't have the change
|
||||||
inherit (builtins) fromJSON readFile;
|
# `nmd` uses to work around the broken stylesheets in
|
||||||
|
# `docbook-xsl-ns`, so we restore the patched version here.
|
||||||
# release data
|
pkgs =
|
||||||
release-config = fromJSON (readFile ../release.json);
|
pkgs
|
||||||
revision = release-config.release;
|
// {
|
||||||
|
docbook-xsl-ns =
|
||||||
# From home-manager:
|
pkgs.docbook-xsl-ns.override {withManOptDedupPatch = true;};
|
||||||
#
|
};
|
||||||
# Recursively replace each derivation in the given attribute set
|
};
|
||||||
# with the same derivation but with the `outPath` attribute set to
|
|
||||||
# the string `"\${pkgs.attribute.path}"`. This allows the
|
|
||||||
# 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
|
|
||||||
# cases.
|
|
||||||
#
|
|
||||||
# Caveat: even if the package is reached by a different means, the
|
|
||||||
# path above will be shown and not e.g.
|
|
||||||
# `${config.services.foo.package}`.
|
|
||||||
scrubDerivations = prefixPath: attrs: let
|
|
||||||
scrubDerivation = name: value: let
|
|
||||||
pkgAttrName = prefixPath + "." + name;
|
|
||||||
in
|
|
||||||
if isAttrs value
|
|
||||||
then
|
|
||||||
scrubDerivations pkgAttrName value
|
|
||||||
// optionalAttrs (isDerivation value) {
|
|
||||||
outPath = "\${${pkgAttrName}}";
|
|
||||||
}
|
|
||||||
else value;
|
|
||||||
in
|
|
||||||
mapAttrs scrubDerivation attrs;
|
|
||||||
|
|
||||||
# Make sure the used package is scrubbed to avoid actually
|
# Make sure the used package is scrubbed to avoid actually
|
||||||
# instantiating derivations.
|
# instantiating derivations.
|
||||||
|
@ -48,51 +23,46 @@
|
||||||
imports = [
|
imports = [
|
||||||
{
|
{
|
||||||
_module.args = {
|
_module.args = {
|
||||||
pkgs = mkForce (scrubDerivations "pkgs" pkgs);
|
pkgs = lib.mkForce (nmd.scrubDerivations "pkgs" pkgs);
|
||||||
pkgs_i686 = mkForce {};
|
pkgs_i686 = lib.mkForce {};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
# Specify the path to the module entrypoint
|
dontCheckDefinitions = {_module.check = false;};
|
||||||
|
|
||||||
|
githubDeclaration = user: repo: subpath: let
|
||||||
|
urlRef = "main";
|
||||||
|
in {
|
||||||
|
url = "https://github.com/${user}/${repo}/blob/${urlRef}/${subpath}";
|
||||||
|
name = "<${repo}/${subpath}>";
|
||||||
|
};
|
||||||
|
|
||||||
nvimPath = toString ./..;
|
nvimPath = toString ./..;
|
||||||
|
|
||||||
buildOptionsDocs = args @ {
|
buildOptionsDocs = args @ {
|
||||||
modules,
|
modules,
|
||||||
includeModuleSystemOptions ? true,
|
includeModuleSystemOptions ? true,
|
||||||
warningsAreErrors ? true,
|
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit ((evalModules {inherit modules;})) options;
|
inherit ((lib.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
|
in
|
||||||
pkgs.buildPackages.nixosOptionsDoc ({
|
pkgs.buildPackages.nixosOptionsDoc ({
|
||||||
inherit warningsAreErrors;
|
|
||||||
|
|
||||||
options =
|
options =
|
||||||
if includeModuleSystemOptions
|
if includeModuleSystemOptions
|
||||||
then options
|
then options
|
||||||
else builtins.removeAttrs options ["_module"];
|
else builtins.removeAttrs options ["_module"];
|
||||||
|
|
||||||
transformOptions = opt:
|
transformOptions = opt:
|
||||||
recursiveUpdate opt {
|
opt
|
||||||
# Clean up declaration sites to not refer to the nvf
|
// {
|
||||||
|
# Clean up declaration sites to not refer to the Home Manager
|
||||||
# source tree.
|
# source tree.
|
||||||
declarations = map (decl:
|
declarations = map (decl:
|
||||||
if hasPrefix nvimPath (toString decl)
|
if lib.hasPrefix nvimPath (toString decl)
|
||||||
then
|
then
|
||||||
githubDeclaration "notashelf" "nvf"
|
githubDeclaration "notashelf" "neovim-flake"
|
||||||
(removePrefix "/" (removePrefix nvimPath (toString decl)))
|
(lib.removePrefix "/" (lib.removePrefix nvimPath (toString decl)))
|
||||||
else if decl == "lib/modules.nix"
|
else if decl == "lib/modules.nix"
|
||||||
then
|
then
|
||||||
# TODO: handle this in a better way (may require upstream
|
# TODO: handle this in a better way (may require upstream
|
||||||
|
@ -105,65 +75,61 @@
|
||||||
// builtins.removeAttrs args ["modules" "includeModuleSystemOptions"]);
|
// builtins.removeAttrs args ["modules" "includeModuleSystemOptions"]);
|
||||||
|
|
||||||
nvimModuleDocs = buildOptionsDocs {
|
nvimModuleDocs = buildOptionsDocs {
|
||||||
variablelistId = "nvf-options";
|
|
||||||
|
|
||||||
modules =
|
modules =
|
||||||
import ../modules/modules.nix {
|
import ../modules/modules.nix {
|
||||||
inherit lib pkgs;
|
inherit lib pkgs;
|
||||||
check = false;
|
check = false;
|
||||||
}
|
}
|
||||||
++ [scrubbedPkgsModule];
|
++ [scrubbedPkgsModule];
|
||||||
|
variablelistId = "neovim-flake-options";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
release-config = builtins.fromJSON (builtins.readFile ../release.json);
|
||||||
|
revision = "release-${release-config.release}";
|
||||||
# Generate the `man home-configuration.nix` package
|
# Generate the `man home-configuration.nix` package
|
||||||
nvf-configuration-manual =
|
nvf-configuration-manual =
|
||||||
pkgs.runCommand "nvf-reference-manpage" {
|
pkgs.runCommand "neovim-flake-reference-manpage" {
|
||||||
nativeBuildInputs = [pkgs.buildPackages.installShellFiles pkgs.nixos-render-docs];
|
nativeBuildInputs = [pkgs.buildPackages.installShellFiles pkgs.nixos-render-docs];
|
||||||
allowedReferences = ["out"];
|
allowedReferences = ["out"];
|
||||||
} ''
|
} ''
|
||||||
# Generate manpages.
|
# Generate manpages.
|
||||||
mkdir -p $out/share/man/man5
|
mkdir -p $out/share/man/man5
|
||||||
mkdir -p $out/share/man/man1
|
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 ${revision} \
|
--revision ${revision} \
|
||||||
--header ${./man/header.5} \
|
|
||||||
--footer ${./man/footer.5} \
|
|
||||||
${nvimModuleDocs.optionsJSON}/share/doc/nixos/options.json \
|
${nvimModuleDocs.optionsJSON}/share/doc/nixos/options.json \
|
||||||
$out/share/man/man5/nvf.5
|
$out/share/man/man5/neovim-flake.5
|
||||||
|
cp ${./neovim-flake.1} $out/share/man/man1/neovim-flake.1
|
||||||
cp ${./man/nvf.1} $out/share/man/man1/nvf.1
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# Generate the HTML manual pages
|
# Generate the HTML manual pages
|
||||||
nvf-manual = pkgs.callPackage ./manual.nix {
|
neovim-flake-manual = pkgs.callPackage ./manual.nix {
|
||||||
inherit revision manpageUrls;
|
inherit revision;
|
||||||
outputPath = "share/doc/nvf";
|
outputPath = "share/doc/neovim-flake";
|
||||||
|
nmd = nmdSrc;
|
||||||
options = {
|
options = {
|
||||||
nvf = nvimModuleDocs.optionsJSON;
|
neovim-flake = nvimModuleDocs.optionsJSON;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
html = neovim-flake-manual;
|
||||||
html = nvf-manual;
|
|
||||||
htmlOpenTool = pkgs.callPackage ./html-open-tool.nix {} {inherit html;};
|
htmlOpenTool = pkgs.callPackage ./html-open-tool.nix {} {inherit html;};
|
||||||
in {
|
in {
|
||||||
inherit (inputs) nmd;
|
inherit nmdSrc;
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
# TODO: Use `hmOptionsDocs.optionsJSON` directly once upstream
|
# TODO: Use `hmOptionsDocs.optionsJSON` directly once upstream
|
||||||
# `nixosOptionsDoc` is more customizable.
|
# `nixosOptionsDoc` is more customizable.
|
||||||
json =
|
json =
|
||||||
pkgs.runCommand "options.json" {
|
pkgs.runCommand "options.json" {
|
||||||
meta.description = "List of nvf options in JSON format";
|
meta.description = "List of Home Manager options in JSON format";
|
||||||
} ''
|
} ''
|
||||||
mkdir -p $out/{share/doc,nix-support}
|
mkdir -p $out/{share/doc,nix-support}
|
||||||
cp -a ${nvimModuleDocs.optionsJSON}/share/doc/nixos $out/share/doc/nvf
|
cp -a ${nvimModuleDocs.optionsJSON}/share/doc/nixos $out/share/doc/neovim-flake
|
||||||
substitute \
|
substitute \
|
||||||
${nvimModuleDocs.optionsJSON}/nix-support/hydra-build-products \
|
${nvimModuleDocs.optionsJSON}/nix-support/hydra-build-products \
|
||||||
$out/nix-support/hydra-build-products \
|
$out/nix-support/hydra-build-products \
|
||||||
--replace \
|
--replace \
|
||||||
'${nvimModuleDocs.optionsJSON}/share/doc/nixos' \
|
'${nvimModuleDocs.optionsJSON}/share/doc/nixos' \
|
||||||
"$out/share/doc/nvf"
|
"$out/share/doc/neovim-flake"
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
3
docs/footer.5
Normal file
3
docs/footer.5
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
.SH "AUTHORS"
|
||||||
|
.PP
|
||||||
|
neovim-flake contributors
|
|
@ -1,4 +1,4 @@
|
||||||
.TH "nvf" "5" "01/01/1980" "nvf"
|
.TH "neovim-flake" "5" "01/01/1980" "neovim-flake"
|
||||||
.\" disable hyphenation
|
.\" disable hyphenation
|
||||||
.nh
|
.nh
|
||||||
.\" disable justification (adjust text to left margin only)
|
.\" disable justification (adjust text to left margin only)
|
||||||
|
@ -6,8 +6,9 @@
|
||||||
.\" enable line breaks after slashes
|
.\" enable line breaks after slashes
|
||||||
.cflags 4 /
|
.cflags 4 /
|
||||||
.SH "NAME"
|
.SH "NAME"
|
||||||
nvf configuration specification
|
neovim-flake configuration specification
|
||||||
.SH "OPTIONS"
|
.SH "OPTIONS"
|
||||||
.PP
|
.PP
|
||||||
You can use the following options to configure nvf:
|
You can use the following options in
|
||||||
|
home\-configuration\&.nix:
|
||||||
.PP
|
.PP
|
8
docs/highlight-style.css
Normal file
8
docs/highlight-style.css
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
pre {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
pre code.hljs {
|
||||||
|
border: none;
|
||||||
|
margin: 0;
|
||||||
|
}
|
|
@ -4,7 +4,7 @@
|
||||||
symlinkJoin,
|
symlinkJoin,
|
||||||
}: {
|
}: {
|
||||||
html,
|
html,
|
||||||
pathName ? "nvf",
|
pathName ? "neovim-flake",
|
||||||
projectName ? pathName,
|
projectName ? pathName,
|
||||||
name ? "${pathName}-help",
|
name ? "${pathName}-help",
|
||||||
}: let
|
}: let
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
.SH "AUTHORS"
|
|
||||||
.PP
|
|
||||||
nvf contributors
|
|
|
@ -1,57 +1,54 @@
|
||||||
{
|
{
|
||||||
|
stdenv,
|
||||||
lib,
|
lib,
|
||||||
stdenvNoCC,
|
|
||||||
# build inputs
|
|
||||||
nixos-render-docs,
|
|
||||||
documentation-highlighter,
|
documentation-highlighter,
|
||||||
# nrd configuration
|
nmd,
|
||||||
manpageUrls,
|
|
||||||
revision,
|
revision,
|
||||||
|
outputPath ? "share/doc/neovim-flake",
|
||||||
options,
|
options,
|
||||||
outputPath ? "share/doc/nvf",
|
nixos-render-docs,
|
||||||
}:
|
}:
|
||||||
stdenvNoCC.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
name = "nvf-manual";
|
name = "neovim-flake-manual";
|
||||||
src = builtins.path {
|
src = ./manual;
|
||||||
path = lib.sourceFilesBySuffices ./manual [".md"];
|
|
||||||
name = "nvf-manual";
|
|
||||||
};
|
|
||||||
|
|
||||||
nativeBuildInputs = [nixos-render-docs];
|
nativeBuildInputs = [nixos-render-docs];
|
||||||
|
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
mkdir -p out/{highlightjs,media}
|
mkdir -p out/media
|
||||||
|
|
||||||
cp -vt out/highlightjs \
|
mkdir -p out/highlightjs
|
||||||
|
cp -t 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 \
|
||||||
${documentation-highlighter}/loader.js
|
${documentation-highlighter}/loader.js
|
||||||
|
|
||||||
substituteInPlace ./options.md \
|
substituteInPlace ./options.md \
|
||||||
--subst-var-by \
|
--replace \
|
||||||
OPTIONS_JSON \
|
'@OPTIONS_JSON@' \
|
||||||
${options.nvf}/share/doc/nixos/options.json
|
${options.neovim-flake}/share/doc/nixos/options.json
|
||||||
|
|
||||||
substituteInPlace ./manual.md \
|
substituteInPlace ./manual.md \
|
||||||
--subst-var-by \
|
--replace \
|
||||||
NVF_VERSION \
|
'@VERSION@' \
|
||||||
${revision}
|
${revision}
|
||||||
|
|
||||||
# copy stylesheet
|
cp -v ${nmd}/static/style.css out/style.css
|
||||||
cp ${./static/style.css} out/style.css
|
cp -vt out/highlightjs ${nmd}/static/highlightjs/tomorrow-night.min.css
|
||||||
|
cp -v ${./highlight-style.css} out/highlightjs/highlight-style.css
|
||||||
|
|
||||||
# copy release notes
|
|
||||||
cp -vr ${./release-notes} release-notes
|
cp -vr ${./release-notes} release-notes
|
||||||
|
|
||||||
# generate manual from
|
|
||||||
nixos-render-docs manual html \
|
nixos-render-docs manual html \
|
||||||
--manpage-urls ${manpageUrls} \
|
--manpage-urls ./manpage-urls.json \
|
||||||
--revision ${lib.trivial.revisionWithDefault revision} \
|
--revision ${lib.trivial.revisionWithDefault revision} \
|
||||||
--stylesheet style.css \
|
--stylesheet style.css \
|
||||||
|
--stylesheet highlightjs/tomorrow-night.min.css \
|
||||||
|
--stylesheet highlightjs/highlight-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 1 \
|
||||||
--section-toc-depth 1 \
|
--section-toc-depth 1 \
|
||||||
manual.md \
|
manual.md \
|
||||||
out/index.xhtml
|
out/index.xhtml
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
# Configuring nvf {#ch-configuring}
|
|
||||||
|
|
||||||
```{=include=} chapters
|
|
||||||
configuring/custom-package.md
|
|
||||||
configuring/custom-plugins.md
|
|
||||||
configuring/languages.md
|
|
||||||
configuring/dags.md
|
|
||||||
```
|
|
|
@ -1,22 +0,0 @@
|
||||||
# Custom Neovim Package {#ch-custom-package}
|
|
||||||
|
|
||||||
As of v0.5, you may now specify the Neovim package that will be wrapped with
|
|
||||||
your configuration. This is done with the `vim.package` option.
|
|
||||||
|
|
||||||
```nix
|
|
||||||
{inputs, pkgs, ...}: {
|
|
||||||
# using the neovim-nightly overlay
|
|
||||||
vim.package = inputs.neovim-overlay.packages.${pkgs.system}.neovim;
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
The neovim-nightly-overlay always exposes an unwrapped package. If using a
|
|
||||||
different source, you are highly recommended to get an "unwrapped" version of
|
|
||||||
the neovim package, similar to `neovim-unwrapped` in nixpkgs.
|
|
||||||
|
|
||||||
```nix
|
|
||||||
{ pkgs, ...}: {
|
|
||||||
# using the neovim-nightly overlay
|
|
||||||
vim.package = pkgs.neovim-unwrapped;
|
|
||||||
}
|
|
||||||
```
|
|
|
@ -1,25 +0,0 @@
|
||||||
# Custom Plugins {#ch-custom-plugins}
|
|
||||||
|
|
||||||
**nvf**, by default, exposes a wide variety of plugins as module options
|
|
||||||
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
|
|
||||||
request to **nvf** to include it as a module or you may add it to your
|
|
||||||
configuration locally.
|
|
||||||
|
|
||||||
## Adding Plugins {#ch-adding-plugins}
|
|
||||||
|
|
||||||
There are multiple ways of adding custom plugins to your **nvf** configuration.
|
|
||||||
|
|
||||||
You can use custom plugins, before they are implemented in the flake. To add a
|
|
||||||
plugin to the runtime, you need to add it to the `vim.startPlugins` list in
|
|
||||||
your configuration.
|
|
||||||
|
|
||||||
Adding a plugin to `startPlugins` will not allow you to configure the plugin
|
|
||||||
that you have adeed, but **nvf** provides multiple way of configuring any
|
|
||||||
custom plugins that you might have added to your configuration.
|
|
||||||
|
|
||||||
```{=include=} sections
|
|
||||||
custom-plugins/configuring.md
|
|
||||||
custom-plugins/new-method.md
|
|
||||||
custom-plugins/old-method.md
|
|
||||||
```
|
|
|
@ -1,26 +0,0 @@
|
||||||
# Configuring {#sec-configuring-plugins}
|
|
||||||
|
|
||||||
Just making the plugin to your Neovim configuration available might not always
|
|
||||||
be enough. In that case, you can write custom vimscript or lua config, using
|
|
||||||
either `config.vim.configRC` or `config.vim.luaConfigRC` respectively. Both of
|
|
||||||
these options are attribute sets, and you need to give the configuration you're
|
|
||||||
adding some name, like this:
|
|
||||||
|
|
||||||
```nix
|
|
||||||
{
|
|
||||||
# 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
|
|
||||||
config.vim.configRC.aquarium = "colorscheme aquiarum";
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
:::{.note}
|
|
||||||
If your configuration needs to be put in a specific place in the config, you
|
|
||||||
can use functions from `inputs.nvf.lib.nvim.dag` to order it. Refer to
|
|
||||||
https://github.com/nix-community/home-manager/blob/master/modules/lib/dag.nix
|
|
||||||
to find out more about the DAG system.
|
|
||||||
:::
|
|
||||||
|
|
||||||
If you successfully made your plugin work, please feel free to create a PR to
|
|
||||||
add it to **nvf** or open an issue with your findings so that we can make it
|
|
||||||
available for everyone easily.
|
|
|
@ -1,35 +0,0 @@
|
||||||
# Old Method {#sec-old-method}
|
|
||||||
|
|
||||||
Prior to version 0.5, the method of adding new plugins was adding the plugin
|
|
||||||
package to `vim.startPlugins` and add its configuration as a DAG under one of
|
|
||||||
`vim.configRC` or `vim.luaConfigRC`. Users who have not yet updated to 0.5, or
|
|
||||||
prefer a more hands-on approach may use the old method where the load order of
|
|
||||||
the plugins is determined by DAGs.
|
|
||||||
|
|
||||||
## Adding plugins {#sec-adding-plugins}
|
|
||||||
|
|
||||||
To add a plugin to **nvf**'s runtime, you may add it
|
|
||||||
|
|
||||||
```nix
|
|
||||||
{pkgs, ...}: {
|
|
||||||
# add a package from nixpkgs to startPlugins
|
|
||||||
vim.startPlugins = [
|
|
||||||
pkgs.vimPlugins.aerial-nvim ];
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
And to configure the added plugin, you can use the `luaConfigRC` option to
|
|
||||||
provide configuration as a DAG using the **nvf** extended library.
|
|
||||||
|
|
||||||
```nix
|
|
||||||
{inputs, ...}: let
|
|
||||||
# assuming you have an input called nvf pointing at the nvf repository
|
|
||||||
inherit (inputs.nvf.lib.nvim.dag) entryAnywhere;
|
|
||||||
in {
|
|
||||||
vim.luaConfigRC.aerial-nvim= entryAnywhere ''
|
|
||||||
require('aerial').setup {
|
|
||||||
-- your configuration here
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
}
|
|
||||||
```
|
|
|
@ -1,185 +0,0 @@
|
||||||
# Using DAGs {#ch-using-dags}
|
|
||||||
|
|
||||||
We conform to the NixOS options types for the most part, however, a noteworthy
|
|
||||||
addition for certain options is the [**DAG
|
|
||||||
(Directed acyclic graph)**](https://en.wikipedia.org/wiki/Directed_acyclic_graph)
|
|
||||||
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
|
|
||||||
entries to express dependency relations among themselves. This can, for
|
|
||||||
example, be used to control the order of configuration sections in your
|
|
||||||
`configRC` or `luaConfigRC`.
|
|
||||||
|
|
||||||
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)
|
|
||||||
explains in more detail the overall usage logic of the DAG type.
|
|
||||||
|
|
||||||
## entryAnywhere {#sec-types-dag-entryAnywhere}
|
|
||||||
|
|
||||||
> `lib.dag.entryAnywhere (value: T) : DagEntry<T>`
|
|
||||||
|
|
||||||
Indicates that `value` can be placed anywhere within the DAG.
|
|
||||||
This is also the default for plain attribute set entries, that
|
|
||||||
is
|
|
||||||
|
|
||||||
```nix
|
|
||||||
foo.bar = {
|
|
||||||
a = lib.dag.entryAnywhere 0;
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
and
|
|
||||||
|
|
||||||
```nix
|
|
||||||
foo.bar = {
|
|
||||||
a = 0;
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
are equivalent.
|
|
||||||
|
|
||||||
## entryAfter {#ch-types-dag-entryAfter}
|
|
||||||
|
|
||||||
> `lib.dag.entryAfter (afters: list string) (value: T) : DagEntry<T>`
|
|
||||||
|
|
||||||
Indicates that `value` must be placed _after_ each of the
|
|
||||||
attribute names in the given list. For example
|
|
||||||
|
|
||||||
```nix
|
|
||||||
foo.bar = {
|
|
||||||
a = 0;
|
|
||||||
b = lib.dag.entryAfter [ "a" ] 1;
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
would place `b` after `a` in the graph.
|
|
||||||
|
|
||||||
## entryBefore {#ch-types-dag-entryBefore}
|
|
||||||
|
|
||||||
> `lib.dag.entryBefore (befores: list string) (value: T) : DagEntry<T>`
|
|
||||||
|
|
||||||
Indicates that `value` must be placed _before_ each of the
|
|
||||||
attribute names in the given list. For example
|
|
||||||
|
|
||||||
```nix
|
|
||||||
foo.bar = {
|
|
||||||
b = lib.dag.entryBefore [ "a" ] 1;
|
|
||||||
a = 0;
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
would place `b` before `a` in the graph.
|
|
||||||
|
|
||||||
## entryBetween {#sec-types-dag-entryBetween}
|
|
||||||
|
|
||||||
> `lib.dag.entryBetween (befores: list string) (afters: list string) (value: T) : DagEntry<T>`
|
|
||||||
|
|
||||||
Indicates that `value` must be placed _before_ the attribute
|
|
||||||
names in the first list and _after_ the attribute names in the
|
|
||||||
second list. For example
|
|
||||||
|
|
||||||
```nix
|
|
||||||
foo.bar = {
|
|
||||||
a = 0;
|
|
||||||
c = lib.dag.entryBetween [ "b" ] [ "a" ] 2;
|
|
||||||
b = 1;
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
would place `c` before `b` and after `a` in the graph.
|
|
||||||
|
|
||||||
There are also a set of functions that generate a DAG from a list.
|
|
||||||
These are convenient when you just want to have a linear list of DAG
|
|
||||||
entries, without having to manually enter the relationship between
|
|
||||||
each entry. Each of these functions take a `tag` as argument and the
|
|
||||||
DAG entries will be named `${tag}-${index}`.
|
|
||||||
|
|
||||||
## entriesAnywhere {#sec-types-dag-entriesAnywhere}
|
|
||||||
|
|
||||||
> `lib.dag.entriesAnywhere (tag: string) (values: [T]) : Dag<T>`
|
|
||||||
|
|
||||||
Creates a DAG with the given values with each entry labeled
|
|
||||||
using the given tag. For example
|
|
||||||
|
|
||||||
```nix
|
|
||||||
foo.bar = lib.dag.entriesAnywhere "a" [ 0 1 ];
|
|
||||||
```
|
|
||||||
|
|
||||||
is equivalent to
|
|
||||||
|
|
||||||
```nix
|
|
||||||
foo.bar = {
|
|
||||||
a-0 = 0;
|
|
||||||
a-1 = lib.dag.entryAfter [ "a-0" ] 1;
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
## entriesAfter {#sec-types-dag-entriesAfter}
|
|
||||||
|
|
||||||
> `lib.dag.entriesAfter (tag: string) (afters: list string) (values: [T]) : Dag<T>`
|
|
||||||
|
|
||||||
Creates a DAG with the given values with each entry labeled
|
|
||||||
using the given tag. The list of values are placed are placed
|
|
||||||
_after_ each of the attribute names in `afters`. For example
|
|
||||||
|
|
||||||
```nix
|
|
||||||
foo.bar =
|
|
||||||
{ b = 0; } // lib.dag.entriesAfter "a" [ "b" ] [ 1 2 ];
|
|
||||||
```
|
|
||||||
|
|
||||||
is equivalent to
|
|
||||||
|
|
||||||
```nix
|
|
||||||
foo.bar = {
|
|
||||||
b = 0;
|
|
||||||
a-0 = lib.dag.entryAfter [ "b" ] 1;
|
|
||||||
a-1 = lib.dag.entryAfter [ "a-0" ] 2;
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
## entriesBefore {#sec-types-dag-entriesBefore}
|
|
||||||
|
|
||||||
> `lib.dag.entriesBefore (tag: string) (befores: list string) (values: [T]) : Dag<T>`
|
|
||||||
|
|
||||||
Creates a DAG with the given values with each entry labeled
|
|
||||||
using the given tag. The list of values are placed _before_ each
|
|
||||||
of the attribute names in `befores`. For example
|
|
||||||
|
|
||||||
```nix
|
|
||||||
foo.bar =
|
|
||||||
{ b = 0; } // lib.dag.entriesBefore "a" [ "b" ] [ 1 2 ];
|
|
||||||
```
|
|
||||||
|
|
||||||
is equivalent to
|
|
||||||
|
|
||||||
```nix
|
|
||||||
foo.bar = {
|
|
||||||
b = 0;
|
|
||||||
a-0 = 1;
|
|
||||||
a-1 = lib.dag.entryBetween [ "b" ] [ "a-0" ] 2;
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
## entriesBetween {#sec-types-dag-entriesBetween}
|
|
||||||
|
|
||||||
> `lib.dag.entriesBetween (tag: string) (befores: list string) (afters: list string) (values: [T]) : Dag<T>`
|
|
||||||
|
|
||||||
Creates a DAG with the given values with each entry labeled
|
|
||||||
using the given tag. The list of values are placed _before_ each
|
|
||||||
of the attribute names in `befores` and _after_ each of the
|
|
||||||
attribute names in `afters`. For example
|
|
||||||
|
|
||||||
```nix
|
|
||||||
foo.bar =
|
|
||||||
{ b = 0; c = 3; } // lib.dag.entriesBetween "a" [ "b" ] [ "c" ] [ 1 2 ];
|
|
||||||
```
|
|
||||||
|
|
||||||
is equivalent to
|
|
||||||
|
|
||||||
```nix
|
|
||||||
foo.bar = {
|
|
||||||
b = 0;
|
|
||||||
c = 3;
|
|
||||||
a-0 = lib.dag.entryAfter [ "c" ] 1;
|
|
||||||
a-1 = lib.dag.entryBetween [ "b" ] [ "a-0" ] 2;
|
|
||||||
}
|
|
||||||
```
|
|
|
@ -1,18 +0,0 @@
|
||||||
# LSP Custom Packages/Command {#sec-languages-custom-lsp-packages}
|
|
||||||
|
|
||||||
In any of the `opt.languages.<language>.lsp.package` options you can provide
|
|
||||||
your own LSP package, or provide the command to launch the language server, as
|
|
||||||
a list of strings. You can use this to skip automatic installation of a language
|
|
||||||
server, and instead use the one found in your `$PATH` during runtime, for
|
|
||||||
example:
|
|
||||||
|
|
||||||
```nix
|
|
||||||
vim.languages.java = {
|
|
||||||
lsp = {
|
|
||||||
enable = true;
|
|
||||||
# this expects jdt-language-server to be in your PATH
|
|
||||||
# or in `vim.extraPackages`
|
|
||||||
package = ["jdt-language-server" "-data" "~/.cache/jdtls/workspace"];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
```
|
|
63
docs/manual/custom-configs.md
Normal file
63
docs/manual/custom-configs.md
Normal file
|
@ -0,0 +1,63 @@
|
||||||
|
# Custom Configuration {#ch-custom-configuration}
|
||||||
|
|
||||||
|
Custom configuration is done with the `neovimConfiguration` while using the flake as a standalone package.
|
||||||
|
It takes in the configuration as a module. The output of the configuration function is an attrset.
|
||||||
|
|
||||||
|
```nix
|
||||||
|
{
|
||||||
|
options = "The options that were available to configure";
|
||||||
|
config = "The outputted configuration";
|
||||||
|
pkgs = "The package set used to evaluate the module";
|
||||||
|
neovim = "The built neovim package";
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
The following is an example of a barebones vim configuration with the default theme enabled.
|
||||||
|
|
||||||
|
```nix
|
||||||
|
{
|
||||||
|
inputs.neovim-flake = {
|
||||||
|
url = "github:notashelf/neovim-flake";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
|
|
||||||
|
outputs = {nixpkgs, neovim-flake, ...}: let
|
||||||
|
system = "x86_64-linux";
|
||||||
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
|
configModule = {
|
||||||
|
# Add any custom options (and feel free to upstream them!)
|
||||||
|
# options = ...
|
||||||
|
|
||||||
|
config.vim = {
|
||||||
|
theme.enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
customNeovim = neovim-flake.lib.neovimConfiguration {
|
||||||
|
modules = [configModule];
|
||||||
|
inherit pkgs;
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
# this will make the package available as a flake input
|
||||||
|
packages.${system}.neovim = customNeovim.neovim;
|
||||||
|
|
||||||
|
# this is an example nixosConfiguration using the built neovim package
|
||||||
|
nixosConfigurations = {
|
||||||
|
yourHostName = nixpkgs.lib.nixosSystem {
|
||||||
|
# ...
|
||||||
|
modules = [
|
||||||
|
./configuration.nix # or whatever your configuration is
|
||||||
|
|
||||||
|
# this will make wrapped neovim available in your system packages
|
||||||
|
{environment.systemPackages = [customNeovim.neovim];}
|
||||||
|
];
|
||||||
|
# ...
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Your built neovim configuration can be exposed as a flake output, or be added to your system packages to make
|
||||||
|
it available across your system. You may also consider passing the flake output to home-manager to make it available
|
||||||
|
to a specific user _without_ using the home-manager module.
|
12
docs/manual/custom-package.md
Normal file
12
docs/manual/custom-package.md
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
# Custom Neovim Package {#ch-custom-package}
|
||||||
|
|
||||||
|
As of v0.5, you may now specify the neovim package that will be wrapped with your configuration. This is done with the `vim.package` option.
|
||||||
|
|
||||||
|
```nix
|
||||||
|
{inputs, pkgs, ...}: {
|
||||||
|
# using the neovim-nightly overlay
|
||||||
|
config.vim.package = inputs.neovim-overlay.packages.${pkgs.system}.neovim;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
The neovim-nightly-overlay always exposes an unwrapped package. If using a different source, you are highly recommended to get an "unwrapped" version of the neovim package,similar to `neovim-unwrapped` in nixpkgs.
|
10
docs/manual/custom-plugins.md
Normal file
10
docs/manual/custom-plugins.md
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
# Custom Plugins {#ch-custom-plugins}
|
||||||
|
|
||||||
|
You can use custom plugins, before they are implemented in the flake.
|
||||||
|
To add a plugin, you need to add it to your config's `config.vim.startPlugins` array.
|
||||||
|
|
||||||
|
```{=include=} sections
|
||||||
|
custom-plugins/new-method.md
|
||||||
|
custom-plugins/old-method.md
|
||||||
|
custom-plugins/configuring.md
|
||||||
|
```
|
23
docs/manual/custom-plugins/configuring.md
Normal file
23
docs/manual/custom-plugins/configuring.md
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
# Configuring {#configuring-plugins}
|
||||||
|
|
||||||
|
Just making the plugin to your neovim configuration available might not always be enough.
|
||||||
|
In that case, you can write custom vimscript or lua config, using `config.vim.configRC` or `config.vim.luaConfigRC`
|
||||||
|
respectively. These options are attribute sets, and you need to give the configuration you're adding some name, like this:
|
||||||
|
|
||||||
|
```nix
|
||||||
|
{
|
||||||
|
# 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
|
||||||
|
config.vim.configRC.aquarium = "colorscheme aquiarum";
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
:::{.note}
|
||||||
|
If your configuration needs to be put in a specific place in the config, you can use functions from
|
||||||
|
`inputs.neovim-flake.lib.nvim.dag` to order it.
|
||||||
|
Refer to https://github.com/nix-community/home-manager/blob/master/modules/lib/dag.nix to find out more about
|
||||||
|
the DAG system.
|
||||||
|
:::
|
||||||
|
|
||||||
|
Also, if you successfully made your plugin work, please make a PR to add it to the flake, or open an issue
|
||||||
|
with your findings so that we can make it available for everyone easily.
|
|
@ -1,8 +1,8 @@
|
||||||
# New Method {#sec-new-method}
|
# New Method {#sec-new-method}
|
||||||
|
|
||||||
As of version **0.5**, we have a more extensive API for configuring plugins,
|
As of version 0.5, we have a more extensive API for configuring plugins, under `vim.extraPlugins`.
|
||||||
under `vim.extraPlugins`. Instead of using DAGs exposed by the library, you may
|
|
||||||
use the extra plugin module as follows:
|
Instead of using DAGs exposed by the library, you may use the extra plugin module as follows:
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
{
|
{
|
18
docs/manual/custom-plugins/old-method.md
Normal file
18
docs/manual/custom-plugins/old-method.md
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
# Old Method {#sec-old-method}
|
||||||
|
|
||||||
|
Users who have not yet updated to 0.5, or prefer a more hands-on approach may use the old method where the load order
|
||||||
|
of the plugins is determined by DAGs.
|
||||||
|
|
||||||
|
```nix
|
||||||
|
{
|
||||||
|
# fetch plugin source from GitHub and add it to startPlugins
|
||||||
|
config.vim.startPlugins = [
|
||||||
|
(pkgs.fetchFromGitHub {
|
||||||
|
owner = "FrenzyExists";
|
||||||
|
repo = "aquarium-vim";
|
||||||
|
rev = "d09b1feda1148797aa5ff0dbca8d8e3256d028d5";
|
||||||
|
sha256 = "CtyEhCcGxxok6xFQ09feWpdEBIYHH+GIFVOaNZx10Bs=";
|
||||||
|
})
|
||||||
|
];
|
||||||
|
}
|
||||||
|
```
|
|
@ -1,9 +1,10 @@
|
||||||
# Default Configs {#ch-default-configs}
|
# Default Configs {#ch-default-configs}
|
||||||
|
|
||||||
While you can configure **nvf** yourself using the builder, you can also use the pre-built configs that are available.
|
While you can configure neovim-flake yourself using the builder, you can also use the pre-built configs that are available.
|
||||||
Here are a few default configurations you can use.
|
Here are a few default configurations you can use.
|
||||||
|
|
||||||
```{=include=} chapters
|
```{=include=} sections
|
||||||
default-configs/maximal.md
|
default-configs/maximal.md
|
||||||
default-configs/nix.md
|
default-configs/nix.md
|
||||||
|
default-configs/tidal.md
|
||||||
```
|
```
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
# Maximal {#sec-default-maximal}
|
# Maximal {#sec-default-maximal}
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ nix shell github:notashelf/nvf#maximal test.nix
|
$ nix shell github:notashelf/neovim-flake#maximal test.nix
|
||||||
```
|
```
|
||||||
|
|
||||||
It is the same fully configured Neovim as with the [Nix](#sec-default-nix)
|
It is the same fully configured neovim as with the [Nix](#sec-default-nix) config, but with every supported language enabled.
|
||||||
configuration, but with every supported language enabled.
|
|
||||||
|
:::{.note}
|
||||||
|
|
||||||
|
Running the maximal config will download _a lot_ of packages as it is downloading language servers, formatters, and more.
|
||||||
|
|
||||||
::: {.note}
|
|
||||||
Running the maximal config will download _a lot_ of packages as it is
|
|
||||||
downloading language servers, formatters, and more.
|
|
||||||
:::
|
:::
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
# Nix {#sec-default-nix}
|
# Nix {#sec-default-nix}
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ nix run github:notashelf/nvf#nix test.nix
|
$ nix run github:notashelf/neovim-flake#nix test.nix
|
||||||
```
|
```
|
||||||
|
|
||||||
Enables all the of Neovim plugins, with language support for specifically Nix.
|
Enables all the of neovim plugins, with language support for specifically Nix. This lets you see what a fully configured neovim setup looks like without downloading a whole bunch of language servers and associated tools.
|
||||||
This lets you see what a fully configured neovim setup looks like without
|
|
||||||
downloading a whole bunch of language servers and associated tools.
|
|
||||||
|
|
12
docs/manual/default-configs/tidal.md
Normal file
12
docs/manual/default-configs/tidal.md
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
# Tidal Cycles {#sec-default-tidal}
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ nix run github:notashelf/neovim-flake#tidal file.tidal
|
||||||
|
```
|
||||||
|
|
||||||
|
Utilizing [vim-tidal](https://github.com/tidalcycles/vim-tidal) and mitchmindtree's fantastic
|
||||||
|
[tidalcycles.nix](https://github.com/mitchmindtree/tidalcycles.nix) start playing with tidal cycles in a single command.
|
||||||
|
|
||||||
|
In your tidal file, type a cycle e.g. `d1 $ s "drum"` and then press _ctrl+enter_. Super collider with superdirt, and a
|
||||||
|
modified GHCI with tidal will start up and begin playing. Note, you need jack enabled on your system. If you are using
|
||||||
|
pipewire, its as easy as setting `services.pipewire.jack.enable = true` in your configuration.
|
|
@ -1,14 +1,14 @@
|
||||||
# Hacking nvf {#ch-hacking}
|
# Hacking neovim-flake {#ch-hacking}
|
||||||
|
|
||||||
**nvf** is designed for developers as much as it is for the end user. I would like any potential contributor
|
neovim-flake is designed for developers as much as it is for the end user. I would like any potential contributor
|
||||||
to be able to propagate their desired changes into the repository without the extra effort. As such, below are guides
|
to be able to propagate their desired changes into the repository without the extra effort. As such, below are guides
|
||||||
(and guidelines) to streamline the contribution process and ensure that your valuable input seamlessly integrates
|
(and guidelines) to streamline the contribution process and ensure that your valuable input seamlessly integrates
|
||||||
into **nvf**'s development without leaving question marks in your head.
|
into neovim-flake's development without leaving question marks in your head.
|
||||||
|
|
||||||
This section is mainly directed towards those who wish to contribute code into **nvf**. If you wish to instead
|
This section is mainly directed towards those who wish to contribute code into neovim-flake. If you wish to instead
|
||||||
report a bug or discuss a potential feature implementation, first look among the
|
report a bug or discuss a potential feature implementation, first look among the
|
||||||
already [open issues](https://github.com/notashelf/nvf/issues) and if no matching issue exists you may open
|
already [open issues](https://github.com/notashelf/neovim-flake/issues) and if no matching issue exists you may open
|
||||||
a [new issue](https://github.com/notashelf/nvf/issues/new) and describe your problem/request. While creating an
|
a [new issue](https://github.com/notashelf/neovim-flake/issues/new) and describe your problem/request. While creating an
|
||||||
issue, please try to include as much information as you can, ideally also include relevant context in which an issue
|
issue, please try to include as much information as you can, ideally also include relevant context in which an issue
|
||||||
occurs or a feature should be implemented.
|
occurs or a feature should be implemented.
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,13 @@
|
||||||
# Adding Plugins {#sec-additional-plugins}
|
# Adding Plugins {#sec-additional-plugins}
|
||||||
|
|
||||||
To add a new Neovim plugin, first add the source url in the inputs section of `flake.nix`
|
To add a new neovim plugin, first add the source url in the inputs section of `flake.nix`
|
||||||
with the prefix `plugin-`
|
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
|
|
||||||
{
|
{
|
||||||
inputs = {
|
inputs = {
|
||||||
# ...
|
# ...
|
||||||
plugin-neodev-nvim = {
|
neodev-nvim = {
|
||||||
url = "github:folke/neodev.nvim";
|
url = "github:folke/neodev.nvim";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
@ -17,110 +16,18 @@ with the prefix `plugin-`
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
The addition of the `plugin-` prefix will allow **nvf** to autodiscover the
|
Then add the name of the plugin into the `availablePlugins` variable in `lib/types/plugins.nix`:
|
||||||
input from the flake inputs automatically, allowing you to refer to it in areas
|
|
||||||
that require a very specific plugin type as defined in `lib/types/plugins.nix`
|
|
||||||
|
|
||||||
You can now reference this plugin using its string name, the plugin will be
|
```nix
|
||||||
built with the name and source URL from the flake input, allowing you to
|
# ...
|
||||||
refer to it as a **string**.
|
availablePlugins = [
|
||||||
|
# ...
|
||||||
|
"neodev-nvim"
|
||||||
|
];
|
||||||
|
```
|
||||||
|
|
||||||
|
You can now reference this plugin using its string name:
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
config.vim.startPlugins = ["neodev-nvim"];
|
config.vim.startPlugins = ["neodev-nvim"];
|
||||||
```
|
```
|
||||||
|
|
||||||
## Modular setup options {#sec-modular-setup-options}
|
|
||||||
|
|
||||||
Most plugins is initialized with a call to `require('plugin').setup({...})`.
|
|
||||||
|
|
||||||
We use a special function that lets you easily add support for such setup options in a modular way:
|
|
||||||
`mkPluginSetupOption`.
|
|
||||||
|
|
||||||
Once you have added the source of the plugin as shown above, you can define the setup options like
|
|
||||||
this:
|
|
||||||
|
|
||||||
```nix
|
|
||||||
# in modules/.../your-plugin/your-plugin.nix
|
|
||||||
|
|
||||||
{lib, ...}:
|
|
||||||
let
|
|
||||||
inherit (lib.types) bool int;
|
|
||||||
inherit (lib.nvim.types) mkPluginSetupOption;
|
|
||||||
in {
|
|
||||||
options.vim.your-plugin = {
|
|
||||||
setupOpts = mkPluginSetupOption "plugin name" {
|
|
||||||
enable_feature_a = mkOption {
|
|
||||||
type = bool;
|
|
||||||
default = false;
|
|
||||||
# ...
|
|
||||||
};
|
|
||||||
|
|
||||||
number_option = mkOption {
|
|
||||||
type = int;
|
|
||||||
default = 3;
|
|
||||||
# ...
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```nix
|
|
||||||
# in modules/.../your-plugin/config.nix
|
|
||||||
{lib, config, ...}:
|
|
||||||
let
|
|
||||||
cfg = config.vim.your-plugin;
|
|
||||||
in {
|
|
||||||
vim.luaConfigRC = lib.nvim.dag.entryAnywhere ''
|
|
||||||
require('plugin-name').setup(${lib.nvim.lua.toLuaObject cfg.setupOpts})
|
|
||||||
'';
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
This above config will result in this lua script:
|
|
||||||
|
|
||||||
```lua
|
|
||||||
require('plugin-name').setup({
|
|
||||||
enable_feature_a = false,
|
|
||||||
number_option = 3,
|
|
||||||
})
|
|
||||||
```
|
|
||||||
|
|
||||||
Now users can set any of the pre-defined option field, and can also add their own fields!
|
|
||||||
|
|
||||||
```nix
|
|
||||||
# in user's config
|
|
||||||
{
|
|
||||||
vim.your-plugin.setupOpts = {
|
|
||||||
enable_feature_a = true;
|
|
||||||
number_option = 4;
|
|
||||||
another_field = "hello";
|
|
||||||
size = { # nested fields work as well
|
|
||||||
top = 10;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
## Details of toLuaObject {#sec-details-of-toluaobject}
|
|
||||||
|
|
||||||
As you've seen above, `toLuaObject` is used to convert our nix attrSet
|
|
||||||
`cfg.setupOpts`, into a lua table. Here are some rules of the conversion:
|
|
||||||
|
|
||||||
1. nix `null` converts to lua `nil`
|
|
||||||
2. number and strings convert to their lua counterparts
|
|
||||||
3. nix attrSet/list convert into lua tables
|
|
||||||
4. you can write raw lua code using `lib.generators.mkLuaInline`. This
|
|
||||||
function is part of nixpkgs.
|
|
||||||
|
|
||||||
Example:
|
|
||||||
|
|
||||||
```nix
|
|
||||||
vim.your-plugin.setupOpts = {
|
|
||||||
on_init = lib.generators.mkLuaInline ''
|
|
||||||
function()
|
|
||||||
print('we can write lua!')
|
|
||||||
end
|
|
||||||
'';
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
|
@ -1,16 +1,10 @@
|
||||||
# Getting Started {#sec-contrib-getting-started}
|
# Getting Started {#sec-contrib-getting-started}
|
||||||
|
|
||||||
You, naturally, would like to start by forking the repository to get started. If
|
You naturally would like to start by forking the repository. If you are new to git, have a look at GitHub's
|
||||||
you are new to Git and GitHub, do have a look at GitHub's [Fork a repo guide](https://help.github.com/articles/fork-a-repo/)
|
[Fork a repo guide](https://help.github.com/articles/fork-a-repo/) for instructions on how you can do this. Once you have a fork of neovim-flake
|
||||||
for instructions on how you can do this. Once you have a fork of **nvf**, you
|
you should create a branch starting at the most recent `main` branch.
|
||||||
should create a separate branch based on the msot recent `main` branch. Give
|
Give your branch a reasonably descriptive name, suffixed by its type - i.e `feature/debugger` or `fix/pesky-bug`.
|
||||||
your branch a reasonably descriptive name (e.g. `feature/debugger` or
|
|
||||||
`fix/pesky-bug`) and you are ready to work on your changes
|
|
||||||
|
|
||||||
Implement your changes and commit them to the newly created branch and when you
|
Implement your changes and commit them to the newly created branch and when you are happy with the result and positive
|
||||||
are happy with the result, and positive that it fullfills our [Contributing
|
that it fulfills [Guidelines](#sec-guidelines). Once you are confident everything is in order, push the branch to GitHub and
|
||||||
Guidelines](#sec-guidelines), push the branch to GitHub and [create a pull
|
[create a pull request](https://help.github.com/articles/creating-a-pull-request), following the template that you will be prompted to fill.
|
||||||
request](https://help.github.com/articles/creating-a-pull-request). The default
|
|
||||||
pull request template available on the **nvf** repository will guide you through
|
|
||||||
the rest of the process, and we'll gently nudge you in the correct direction if
|
|
||||||
there are any mistakes.
|
|
||||||
|
|
|
@ -1,65 +1,55 @@
|
||||||
# Guidelines {#sec-guidelines}
|
# Guidelines {#sec-guidelines}
|
||||||
|
|
||||||
If your contribution tightly follows the guidelines, then there is a good chance
|
If your contribution tightly follows the guidelines, then there is a good chance it will be merged without too much
|
||||||
it will be merged without too much trouble. Some of the guidelines will be
|
trouble. Some of the guidelines will be strictly enforced, others will remain as gentle nudges towards the correct
|
||||||
strictly enforced, others will remain as gentle nudges towards the correct
|
direction. As we have no automated system enforcing those guidelines, please try to double check your changes before
|
||||||
direction. As we have no automated system enforcing those guidelines, please
|
making your pull request in order to avoid "faulty" code slipping by.
|
||||||
try to double check your changes before making your pull request in order to
|
|
||||||
avoid "faulty" code slipping by.
|
|
||||||
|
|
||||||
If you are uncertain how these rules affect the change you would like to make
|
If you are uncertain how these rules affect the change you would like to make then feel free to start a
|
||||||
then feel free to start a discussion in the [discussions tab](https://github.com/NotAShelf/nvf/discussions)
|
discussion in the [discussions tab](https://github.com/NotAShelf/neovim-flake/discussions) ideally (but not necessarily)
|
||||||
ideally (but not necessarily) before you start developing.
|
before you start developing.
|
||||||
|
|
||||||
## Adding Documentation {#sec-guidelines-documentation}
|
## Adding Documentation {#sec-guidelines-documentation}
|
||||||
|
|
||||||
Most, if not all, changes warrant changes to the documentation. Module options
|
Most, if not all, changes warrant changes to the documentation. Module options should be documented with
|
||||||
should be documented with [Nixpkgs-flavoured Markdown](https://nixos.org/manual/nixpkgs/unstable/#sec-contributing-markup),
|
[Nixpkgs-flavoured Markdown](https://nixos.org/manual/nixpkgs/unstable/#sec-contributing-markup), albeit with exceptions.
|
||||||
albeit with exceptions.
|
|
||||||
|
:::{.note}
|
||||||
|
|
||||||
|
As of v0.5, neovim-flake is itself documented using full markdown in both module options and the manual. With
|
||||||
|
v0.6, this manual has also been converted to markdown in full.
|
||||||
|
|
||||||
::: {.note}
|
|
||||||
As of **v0.5**, **nvf** is itself documented using full markdown in both module
|
|
||||||
options and the manual. With **v0.6**, this manual has also been converted to
|
|
||||||
markdown in full.
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
The HTML version of this manual containing both the module option descriptions
|
The HTML version of this manual containing both the module option descriptions and the documentation of neovim-flake
|
||||||
and the documentation of **nvf** (such as this page) can be generated and
|
(such as this page) can be generated and opened by typing the following in a shell within a clone of the
|
||||||
opened by typing the following in a shell within a clone of the **nvf** Git
|
neovim-flake Git repository:
|
||||||
repository:
|
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ nix build .#docs-html
|
$ nix build .#docs-html
|
||||||
$ xdg-open $PWD/result/share/doc/nvf/index.html
|
$ xdg-open $PWD/result/share/doc/neovim-flake/index.html
|
||||||
```
|
```
|
||||||
|
|
||||||
## Formatting Code {#sec-guidelines-formatting}
|
## Formatting Code {#sec-guidelines-formatting}
|
||||||
|
|
||||||
Make sure your code is formatted as described in [code-style
|
Make sure your code is formatted as described in [code-style section](#sec-guidelines-code-style). To maintain consistency throughout
|
||||||
section](#sec-guidelines-code-style). To maintain consistency throughout the
|
the project you are encouraged to browse through existing code and adopt its style also in new code.
|
||||||
project you are encouraged to browse through existing code and adopt its style
|
|
||||||
also in new code.
|
|
||||||
|
|
||||||
## Formatting Commits {#sec-guidelines-commit-message-style}
|
## Formatting Commits {#sec-guidelines-commit-message-style}
|
||||||
|
|
||||||
Similar to [code style guidelines](#sec-guidelines-code-style) we encourage a
|
Similar to [code style guidelines](#sec-guidelines-code-style) we encourage a consistent commit message format as described
|
||||||
consistent commit message format as described in [commit style
|
in [commit style guidelines](#sec-guidelines-commit-style).
|
||||||
guidelines](#sec-guidelines-commit-style).
|
|
||||||
|
|
||||||
## Commit Style {#sec-guidelines-commit-style}
|
## Commit Style {#sec-guidelines-commit-style}
|
||||||
|
|
||||||
The commits in your pull request should be reasonably self-contained. Which
|
The commits in your pull request should be reasonably self-contained. Which means each and every commit in
|
||||||
means each and every commit in a pull request should make sense both on its
|
a pull request should make sense both on its own and in general context. That is, a second commit should not resolve
|
||||||
own and in general context. That is, a second commit should not resolve an
|
an issue that is introduced in an earlier commit. In particular, you will be asked to amend any commit that
|
||||||
issue that is introduced in an earlier commit. In particular, you will be
|
introduces syntax errors or similar problems even if they are fixed in a later commit.
|
||||||
asked to amend any commit that introduces syntax errors or similar problems
|
|
||||||
even if they are fixed in a later commit.
|
|
||||||
|
|
||||||
The commit messages should follow the [seven
|
The commit messages should follow the [seven rules](https://chris.beams.io/posts/git-commit/#seven-rule),
|
||||||
rules](https://chris.beams.io/posts/git-commit/#seven-rule), except for
|
except for "Capitalize the subject line". We also ask you to include the affected code component or module in
|
||||||
"Capitalize the subject line". We also ask you to include the affected code
|
the first line. A commit message ideally, but not necessarily, follow the given template from home-manager's own documentation
|
||||||
component or module in the first line. A commit message ideally, but not
|
|
||||||
necessarily, follow the given template from home-manager's own documentation
|
|
||||||
|
|
||||||
```
|
```
|
||||||
{component}: {description}
|
{component}: {description}
|
||||||
|
@ -67,63 +57,47 @@ necessarily, follow the given template from home-manager's own documentation
|
||||||
{long description}
|
{long description}
|
||||||
```
|
```
|
||||||
|
|
||||||
where `{component}` refers to the code component (or module) your change
|
where `{component}` refers to the code component (or module) your change affects, `{description}` is a very brief
|
||||||
affects, `{description}` is a very brief description of your change, and
|
description of your change, and `{long description}` is an optional clarifying description. As a rare exception, if
|
||||||
`{long description}` is an optional clarifying description. As a rare
|
there is no clear component, or your change affects many components, then the `{component}` part is optional.
|
||||||
exception, if there is no clear component, or your change affects many
|
See [example commit message](#sec-guidelines-ex-commit-message) for a commit message that fulfills these requirements.
|
||||||
components, then the `{component}` part is optional. See [example commit
|
|
||||||
message](#sec-guidelines-ex-commit-message) for a commit message that
|
|
||||||
fulfills these requirements.
|
|
||||||
|
|
||||||
## Example Commit {#sec-guidelines-ex-commit-message}
|
## Example Commit {#sec-guidelines-ex-commit-message}
|
||||||
|
|
||||||
The commit [69f8e47e9e74c8d3d060ca22e18246b7f7d988ef](https://github.com/nix-community/home-manager/commit/69f8e47e9e74c8d3d060ca22e18246b7f7d988ef)
|
The commit [69f8e47e9e74c8d3d060ca22e18246b7f7d988ef](https://github.com/nix-community/home-manager/commit/69f8e47e9e74c8d3d060ca22e18246b7f7d988ef) contains the commit message
|
||||||
in home-manager contains the following commit message.
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
starship: allow running in Emacs if vterm is used
|
starship: allow running in Emacs if vterm is used
|
||||||
|
|
||||||
The vterm buffer is backed by libvterm and can handle Starship prompts
|
The vterm buffer is backed by libvterm and can handle Starship prompts
|
||||||
without issues.
|
without issues.
|
||||||
```
|
|
||||||
|
|
||||||
Similarly, if you are contributing to **nvf**, you would include the scope of
|
|
||||||
the commit followed by the description:
|
|
||||||
|
|
||||||
```
|
```
|
||||||
languages/ruby: init module
|
|
||||||
|
|
||||||
Adds a language module for Ruby, adds appropriate formatters and Treesitter grammers
|
Long description can be ommitted if the change is too simple to warrant it. A minor fix in spelling or a formatting
|
||||||
```
|
change does not warrant long description, however, a module addition or removal does as you would like to provide the
|
||||||
|
relevant context for your changes.
|
||||||
|
|
||||||
Long description can be ommitted if the change is too simple to warrant it. A
|
Finally, when adding a new module, say `modules/foo.nix`, we use the fixed commit format `foo: add module`.
|
||||||
minor fix in spelling or a formatting change does not warrant long description,
|
You can, of course, still include a long description if you wish.
|
||||||
however, a module addition or removal does as you would like to provide the
|
|
||||||
relevant context, i.e. the reasoning behind it, for your commit.
|
|
||||||
|
|
||||||
Finally, when adding a new module, say `modules/foo.nix`, we use the fixed
|
In case of nested modules, i.e `modules/languages/java.nix` you are recommended to contain the parent as well - for
|
||||||
commit format `foo: add module`. You can, of course, still include a long
|
example `languages/java: some major change`.
|
||||||
description if you wish.
|
|
||||||
|
|
||||||
In case of nested modules, i.e `modules/languages/java.nix` you are recommended
|
|
||||||
to contain the parent as well - for example `languages/java: some major change`.
|
|
||||||
|
|
||||||
## Code Style {#sec-guidelines-code-style}
|
## Code Style {#sec-guidelines-code-style}
|
||||||
|
|
||||||
### Treewide {#sec-code-style-treewide}
|
**Treewide**
|
||||||
|
Keep lines at a reasonable width, ideally 80 characters or less. This also applies to string literals and module
|
||||||
|
descriptions and documentation.
|
||||||
|
|
||||||
Keep lines at a reasonable width, ideally 80 characters or less. This also applies
|
**Nix**
|
||||||
to string literals and module descriptions and documentation.
|
neovim-flake is formatted by the [alejandra](https://github.com/kamadorueda/alejandra) tool and the formatting is checked in the pull
|
||||||
|
request and push workflows. Run the `nix fmt` command inside the project repository before submitting your
|
||||||
|
pull request.
|
||||||
|
|
||||||
### Nix {#sec-code-style-nix}
|
While Alejandra is mostly opinionated on how code looks after formatting, certain changes are done at the
|
||||||
|
user's discretion based on how the original code was structured.
|
||||||
**nvf** is formatted by the [alejandra](https://github.com/kamadorueda/alejandra)
|
|
||||||
tool and the formatting is checked in the pull request and push workflows. Run the
|
|
||||||
`nix fmt` command inside the project repository before submitting your pull request.
|
|
||||||
|
|
||||||
While Alejandra is mostly opinionated on how code looks after formatting,
|
|
||||||
certain changes are done at the user's discretion based on how the original
|
|
||||||
code was structured.
|
|
||||||
|
|
||||||
Please use one line code for attribute sets that contain only one subset.
|
Please use one line code for attribute sets that contain only one subset.
|
||||||
For example:
|
For example:
|
||||||
|
@ -146,8 +120,8 @@ module = {
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
If you move a line down after the merge operator, Alejandra will automatically
|
If you move a line down after the merge operator, Alejandra will automatically unfold the whole merged attrset
|
||||||
unfold the whole merged attrset for you, which we **do not** want.
|
for you, which we **do not** want.
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
module = {
|
module = {
|
||||||
|
@ -157,12 +131,13 @@ module = {
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
For lists, it is mostly up to your own discretion how you want to format them,
|
For lists, it is mostly up to your own discretion how you want to format them, but please try to unfold lists if
|
||||||
but please try to unfold lists if they contain multiple items and especially
|
they contain multiple items and especially if they are to include comments.
|
||||||
if they are to include comments.
|
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
|
|
||||||
# this is ok
|
# this is ok
|
||||||
|
|
||||||
acceptableList = [
|
acceptableList = [
|
||||||
item1 # comment
|
item1 # comment
|
||||||
item2
|
item2
|
||||||
|
@ -174,12 +149,10 @@ acceptableList = [
|
||||||
listToBeAvoided = [item1 item2 /* comment */ item3 item4];
|
listToBeAvoided = [item1 item2 /* comment */ item3 item4];
|
||||||
|
|
||||||
# this is ok
|
# this is ok
|
||||||
acceptableList = [item1 item2];
|
acceptableList = [item1];
|
||||||
|
|
||||||
# this is also ok if the list is expected to contain more elements
|
# this is not ok
|
||||||
acceptableList= [
|
listToBeAvoided = [
|
||||||
item1
|
item1
|
||||||
item2
|
|
||||||
# more items if needed...
|
|
||||||
];
|
];
|
||||||
```
|
```
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
# Keybinds {#sec-keybinds}
|
# Keybinds {#sec-keybinds}
|
||||||
|
|
||||||
As of 0.4, there exists an API for writing your own keybinds and a couple of
|
As of 0.4, there exists an API for writing your own keybinds and a couple of useful utility functions are available in
|
||||||
useful utility functions are available in the [extended standard
|
the [extended standard library](https://github.com/NotAShelf/neovim-flake/tree/main/lib). The following section contains
|
||||||
library](https://github.com/NotAShelf/nvf/tree/main/lib). The following
|
a general overview to how you may utilize said functions.
|
||||||
section contains a general overview to how you may utilize said functions.
|
|
||||||
|
|
||||||
## Custom Key Mappings Support for a Plugin {#sec-custom-key-mappings}
|
## Custom Key Mappings Support for a Plugin {#sec-custom-key-mappings}
|
||||||
|
|
||||||
|
@ -37,58 +36,44 @@ An example, simple keybinding, can look like this:
|
||||||
```
|
```
|
||||||
|
|
||||||
There are many settings available in the options. Please refer to the
|
There are many settings available in the options. Please refer to the
|
||||||
[documentation](https://notashelf.github.io/nvf/options.html#opt-vim.maps.command._name_.action)
|
[documentation](https://notashelf.github.io/neovim-flake/options.html#opt-vim.maps.command._name_.action)
|
||||||
to see a list of them.
|
to see a list of them.
|
||||||
|
|
||||||
**nvf** provides a list of helper commands, so that you don't have to write the
|
`neovim-flake` provides a list of helper commands, so that you don't have to write the mapping attribute sets every
|
||||||
mapping attribute sets every time:
|
time:
|
||||||
|
|
||||||
- `mkBinding = key: action: desc:` - makes a basic binding, with `silent` set
|
- `mkBinding = key: action: desc:` - makes a basic binding, with `silent` set to true.
|
||||||
to true.
|
- `mkExprBinding = key: action: desc:` - makes an expression binding, with `lua`, `silent`, and `expr` set to true.
|
||||||
- `mkExprBinding = key: action: desc:` - makes an expression binding, with
|
- `mkLuaBinding = key: action: desc:` - makes an expression binding, with `lua`, and `silent` set to true.
|
||||||
`lua`, `silent`, and `expr` set to true.
|
|
||||||
- `mkLuaBinding = key: action: desc:` - makes an expression binding, with
|
|
||||||
`lua`, and `silent` set to true.
|
|
||||||
|
|
||||||
Do note that the Lua in these bindings is actual Lua, and not pasted into a
|
Note that the Lua in these bindings is actual Lua, not pasted into a `:lua` command.
|
||||||
`:lua` command. Therefore, you should either pass in a function like
|
Therefore, you either pass in a function like `require('someplugin').some_function`, without actually calling it,
|
||||||
`require('someplugin').some_function`, without actually calling it, or you
|
or you define your own function, like `function() require('someplugin').some_function() end`.
|
||||||
should define your own functions, for example
|
|
||||||
|
|
||||||
```lua
|
Additionally, to not have to repeat the descriptions, there's another utility function with its own set of functions:
|
||||||
function()
|
|
||||||
require('someplugin').some_function()
|
|
||||||
end
|
|
||||||
```
|
|
||||||
|
|
||||||
Additionally, to not have to repeat the descriptions, there's another utility
|
Utility function that takes two attrsets:
|
||||||
function with its own set of functions: Utility function that takes two
|
|
||||||
attribute sets:
|
|
||||||
|
|
||||||
- `{ someKey = "some_value" }`
|
- `{ someKey = "some_value" }`
|
||||||
- `{ someKey = { description = "Some Description"; }; }`
|
- `{ someKey = { description = "Some Description"; }; }`
|
||||||
|
|
||||||
and merges them into `{ someKey = { value = "some_value"; description = "Some Description"; }; }`
|
and merges them into `{ someKey = { value = "some_value"; description = "Some Description"; }; }`
|
||||||
|
|
||||||
```nix
|
```
|
||||||
addDescriptionsToMappings = actualMappings: mappingDefinitions:
|
addDescriptionsToMappings = actualMappings: mappingDefinitions:
|
||||||
```
|
```
|
||||||
|
|
||||||
This function can be used in combination with the same `mkBinding` functions as
|
This function can be used in combination with the same `mkBinding` functions as above, except they only take two
|
||||||
above, except they only take two arguments - `binding` and `action`, and have
|
arguments - `binding` and `action`, and have different names:
|
||||||
different names:
|
|
||||||
|
|
||||||
- `mkSetBinding = binding: action:` - makes a basic binding, with `silent`
|
- `mkSetBinding = binding: action:` - makes a basic binding, with `silent` set to true.
|
||||||
set to true.
|
- `mkSetExprBinding = binding: action:` - makes an expression binding, with `lua`, `silent`, and `expr` set to true.
|
||||||
- `mkSetExprBinding = binding: action:` - makes an expression binding, with
|
- `mkSetLuaBinding = binding: action:` - makes an expression binding, with `lua`, and `silent` set to true.
|
||||||
`lua`, `silent`, and `expr` set to true.
|
|
||||||
- `mkSetLuaBinding = binding: action:` - makes an expression binding, with
|
|
||||||
`lua`, and `silent` set to true.
|
|
||||||
|
|
||||||
You can read the source code of some modules to see them in action, but their
|
You can read the source code of some modules to see them in action, but their usage should look something like this:
|
||||||
usage should look something like this:
|
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
|
|
||||||
# plugindefinition.nix
|
# plugindefinition.nix
|
||||||
{lib, ...}: with lib; {
|
{lib, ...}: with lib; {
|
||||||
options.vim.plugin = {
|
options.vim.plugin = {
|
||||||
|
@ -111,13 +96,15 @@ usage should look something like this:
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
|
|
||||||
# config.nix
|
# config.nix
|
||||||
{
|
{
|
||||||
config,
|
|
||||||
pkgs,
|
pkgs,
|
||||||
|
config,
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
|
@ -171,8 +158,9 @@ in {
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
::: {.note}
|
:::{.note}
|
||||||
If you have come across a plugin that has an API that doesn't seem to easily
|
|
||||||
allow custom keybindings, don't be scared to implement a draft PR. We'll help
|
If you have come across a plugin that has an API that doesn't seem to easily allow custom keybindings,
|
||||||
you get it done.
|
don't be scared to implement a draft PR. We'll help you get it done.
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
|
@ -1,15 +1,11 @@
|
||||||
# Testing Changes {#sec-testing-changes}
|
# Testing Changes {#sec-testing-changes}
|
||||||
|
|
||||||
Once you have made your changes, you will need to test them throughly. If it is
|
Once you have made your changes, you will need to test them throughly. If it is a module, add your module option to
|
||||||
a module, add your module option to `configuration.nix` (located in the root of
|
`configuration.nix` (located in the root of this project) inside `neovimConfiguration`. Enable it, and then run the
|
||||||
this project) inside `neovimConfiguration`. Enable it, and then run the maximal
|
maximal configuration with `nix run .#maximal -Lv` to check for build errors. If neovim opens in the current directory
|
||||||
configuration with `nix run .#maximal -Lv` to check for build errors. If neovim
|
without any error messages (you can check the output of `:messages` inside neovim to see if there are any errors), then
|
||||||
opens in the current directory without any error messages (you can check the
|
your changes are good to go. Open your pull request, and it will be reviewed as soon as posssible.
|
||||||
output of `:messages` inside neovim to see if there are any errors), then your
|
|
||||||
changes are good to go. Open your pull request, and it will be reviewed as soon
|
|
||||||
as posssible.
|
|
||||||
|
|
||||||
If it is not a new module, but a change to an existing one, then make sure the
|
If it is not a new module, but a change to an existing one, then make sure the module you have changed is enabled in the
|
||||||
module you have changed is enabled in the maximal configuration by editing
|
maximal configuration by editing `configuration.nix`, and then run it with `nix run .#maximal -Lv`. Same procedure as
|
||||||
`configuration.nix`, and then run it with `nix run .#maximal -Lv`. Same procedure
|
adding a new module will apply here.
|
||||||
as adding a new module will apply here.
|
|
||||||
|
|
75
docs/manual/home-manager.md
Normal file
75
docs/manual/home-manager.md
Normal file
|
@ -0,0 +1,75 @@
|
||||||
|
# Home Manager {#ch-hm-module}
|
||||||
|
|
||||||
|
The Home Manager module allows us to customize the different `vim` options from inside the home-manager configuration
|
||||||
|
and it is the preferred way of configuring neovim-flake, both on NixOS and non-NixOS systems.
|
||||||
|
|
||||||
|
To use it, we first add the input flake.
|
||||||
|
|
||||||
|
```nix
|
||||||
|
{
|
||||||
|
neovim-flake = {
|
||||||
|
url = github:notashelf/neovim-flake;
|
||||||
|
# you can override input nixpkgs
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
# you can also override individual plugins
|
||||||
|
# i.e inputs.obsidian-nvim.follows = "obsidian-nvim"; # <- obsidian nvim needs to be in your inputs
|
||||||
|
};
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Followed by importing the home-manager module somewhere in your configuration.
|
||||||
|
|
||||||
|
```nix
|
||||||
|
{
|
||||||
|
# assuming neovim-flake is in your inputs and inputs is in the argset
|
||||||
|
imports = [ inputs.neovim-flake.homeManagerModules.default ];
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
An example installation for standalone home-manager would look like this:
|
||||||
|
|
||||||
|
```nix
|
||||||
|
{
|
||||||
|
inputs = {
|
||||||
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||||
|
home-manager.url = "github:nix-community/home-manager";
|
||||||
|
stylix.url = "github:notashelf/neovim-flake";
|
||||||
|
};
|
||||||
|
|
||||||
|
outputs = { nixpkgs, home-manager, neovim-flake ... }: let
|
||||||
|
system = "x86_64-linux"; in {
|
||||||
|
# ↓ this is the home-manager output in the flake schema
|
||||||
|
homeConfigurations."yourUsername»" = home-manager.lib.homeManagerConfiguration {
|
||||||
|
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
||||||
|
modules = [
|
||||||
|
neovim-flake.homeManagerModules.default # <- this imports the home-manager module that provides the options
|
||||||
|
./home.nix # your home-manager configuration, probably where you will want to add programs.neovim-flake options
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Once the module is imported, we will be able to define the following options (and much more) from inside the
|
||||||
|
home-manager configuration.
|
||||||
|
|
||||||
|
```nix{
|
||||||
|
programs.neovim-flake = {
|
||||||
|
|
||||||
|
enable = true;
|
||||||
|
# your settings need to go into the settings attribute set
|
||||||
|
# most settings are documented in the appendix
|
||||||
|
settings = {
|
||||||
|
vim.viAlias = false;
|
||||||
|
vim.vimAlias = true;
|
||||||
|
vim.lsp = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
:::{.note}
|
||||||
|
You may find all avaliable options in the [appendix](https://notashelf.github.io/neovim-flake/options)
|
||||||
|
:::
|
|
@ -1,11 +0,0 @@
|
||||||
# Installing nvf {#ch-installation}
|
|
||||||
|
|
||||||
There are multiple ways of installing nvf on your system. You may either choose
|
|
||||||
the standalone installation method, which does not depend on a module system and may
|
|
||||||
be done on any system that has the Nix package manager or the appropriate modules
|
|
||||||
for NixOS and home-manager as described in the [module installation section](#ch-module-installation)
|
|
||||||
|
|
||||||
```{=include=} chapters
|
|
||||||
installation/custom-configuration.md
|
|
||||||
installation/modules.md
|
|
||||||
```
|
|
|
@ -1,19 +0,0 @@
|
||||||
# Standalone Installation {#ch-standalone-installation}
|
|
||||||
|
|
||||||
It is possible to install **nvf** without depending on NixOS or home-manager as the parent
|
|
||||||
module system, using the `neovimConfiguration` function exposed by **nvf** extended library.
|
|
||||||
It takes in the configuration as a module, and returns an attribute set as a result.
|
|
||||||
|
|
||||||
```nix
|
|
||||||
{
|
|
||||||
options = "The options that were available to configure";
|
|
||||||
config = "The outputted configuration";
|
|
||||||
pkgs = "The package set used to evaluate the module";
|
|
||||||
neovim = "The built neovim package";
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```{=include=} chapters
|
|
||||||
standalone/nixos.md
|
|
||||||
standalone/home-manager.md
|
|
||||||
```
|
|
|
@ -1,6 +0,0 @@
|
||||||
# Module Installation {#ch-module-installation}
|
|
||||||
|
|
||||||
```{=include=} chapters
|
|
||||||
modules/nixos.md
|
|
||||||
modules/home-manager.md
|
|
||||||
```
|
|
|
@ -1,83 +0,0 @@
|
||||||
# Home-Manager Module {#ch-hm-module}
|
|
||||||
|
|
||||||
The home-manager module allows us to customize the different `vim` options from
|
|
||||||
inside the home-manager configuration without having to call for the wrapper
|
|
||||||
yourself. It is the recommended way to use **nvf** alongside the NixOS module
|
|
||||||
depending on your needs.
|
|
||||||
|
|
||||||
To use it, we first add the input flake.
|
|
||||||
|
|
||||||
```nix
|
|
||||||
{
|
|
||||||
inputs = {
|
|
||||||
obsidian-nvim.url = "github:epwalsh/obsidian.nvim";
|
|
||||||
nvf = {
|
|
||||||
url = "github:notashelf/nvf";
|
|
||||||
# you can override input nixpkgs
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
# you can also override individual plugins
|
|
||||||
# for example:
|
|
||||||
inputs.obsidian-nvim.follows = "obsidian-nvim"; # <- this will use the obsidian-nvim from your inputs
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
Followed by importing the home-manager module somewhere in your configuration.
|
|
||||||
|
|
||||||
```nix
|
|
||||||
{
|
|
||||||
# assuming nvf is in your inputs and inputs is in the argset
|
|
||||||
# see example below
|
|
||||||
imports = [ inputs.nvf.homeManagerModules.default ];
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
## Example Installation {#sec-example-installation-hm}
|
|
||||||
|
|
||||||
```nix
|
|
||||||
{
|
|
||||||
inputs = {
|
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
||||||
home-manager.url = "github:nix-community/home-manager";
|
|
||||||
nvf.url = "github:notashelf/nvf";
|
|
||||||
};
|
|
||||||
|
|
||||||
outputs = { nixpkgs, home-manager, nvf, ... }: let
|
|
||||||
system = "x86_64-linux"; in {
|
|
||||||
# ↓ this is your home output in the flake schema, expected by home-manager
|
|
||||||
"your-username@your-hostname" = home-manager.lib.homeManagerConfiguration
|
|
||||||
modules = [
|
|
||||||
nvf.homeManagerModules.default # <- this imports the home-manager module that provides the options
|
|
||||||
./home.nix # <- your home entrypoint
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
Once the module is properly imported by your host, you will be able to use the
|
|
||||||
`programs.nvf` module option anywhere in your configuration in order to
|
|
||||||
configure **nvf**.
|
|
||||||
|
|
||||||
```nix{
|
|
||||||
programs.nvf = {
|
|
||||||
enable = true;
|
|
||||||
# your settings need to go into the settings attribute set
|
|
||||||
# most settings are documented in the appendix
|
|
||||||
settings = {
|
|
||||||
vim.viAlias = false;
|
|
||||||
vim.vimAlias = true;
|
|
||||||
vim.lsp = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
::: {.note}
|
|
||||||
**nvf** exposes a lot of options, most of which are not referenced in the
|
|
||||||
installation sections of the manual. You may find all avaliable options
|
|
||||||
in the [appendix](https://notashelf.github.io/nvf/options)
|
|
||||||
:::
|
|
|
@ -1,82 +0,0 @@
|
||||||
# NixOS Module {#ch-nixos-module}
|
|
||||||
|
|
||||||
The NixOS module allows us to customize the different `vim` options from inside
|
|
||||||
the NixOS configuration without having to call for the wrapper yourself. It is
|
|
||||||
the recommended way to use **nvf** alongside the home-manager module depending
|
|
||||||
on your needs.
|
|
||||||
|
|
||||||
To use it, we first add the input flake.
|
|
||||||
|
|
||||||
```nix
|
|
||||||
{
|
|
||||||
inputs = {
|
|
||||||
obsidian-nvim.url = "github:epwalsh/obsidian.nvim";
|
|
||||||
nvf = {
|
|
||||||
url = "github:notashelf/nvf";
|
|
||||||
# you can override input nixpkgs
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
# you can also override individual plugins
|
|
||||||
# for example:
|
|
||||||
inputs.obsidian-nvim.follows = "obsidian-nvim"; # <- this will use the obsidian-nvim from your inputs
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
Followed by importing the NixOS module somewhere in your configuration.
|
|
||||||
|
|
||||||
```nix
|
|
||||||
{
|
|
||||||
# assuming nvf is in your inputs and inputs is in the argset
|
|
||||||
# see example below
|
|
||||||
imports = [ inputs.nvf.nixosModules.default ];
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
## Example Installation {#sec-example-installation-nixos}
|
|
||||||
|
|
||||||
```nix
|
|
||||||
{
|
|
||||||
inputs = {
|
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
||||||
nvf.url = "github:notashelf/nvf";
|
|
||||||
};
|
|
||||||
|
|
||||||
outputs = { nixpkgs, nvf, ... }: let
|
|
||||||
system = "x86_64-linux"; in {
|
|
||||||
# ↓ this is your host output in the flake schema
|
|
||||||
nixosConfigurations."yourUsername»" = nixpkgs.lib.nixosSystem {
|
|
||||||
modules = [
|
|
||||||
nvf.nixosModules.default # <- this imports the NixOS module that provides the options
|
|
||||||
./configuration.nix # <- your host entrypoint
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
Once the module is properly imported by your host, you will be able to use the
|
|
||||||
`programs.nvf` module option anywhere in your configuration in order to
|
|
||||||
configure **nvf**.
|
|
||||||
|
|
||||||
```nix{
|
|
||||||
programs.nvf = {
|
|
||||||
enable = true;
|
|
||||||
# your settings need to go into the settings attribute set
|
|
||||||
# most settings are documented in the appendix
|
|
||||||
settings = {
|
|
||||||
vim.viAlias = false;
|
|
||||||
vim.vimAlias = true;
|
|
||||||
vim.lsp = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
::: {.note}
|
|
||||||
**nvf** exposes a lot of options, most of which are not referenced in the
|
|
||||||
installation sections of the manual. You may find all avaliable options
|
|
||||||
in the [appendix](https://notashelf.github.io/nvf/options)
|
|
||||||
:::
|
|
|
@ -1,56 +0,0 @@
|
||||||
# Standalone Installation on Home-Manager {#ch-standalone-hm}
|
|
||||||
|
|
||||||
Your built Neoevim configuration can be exposed as a flake output to make it
|
|
||||||
easier to share across machines, repositories and so on. Or it can be added to
|
|
||||||
your system packages to make it available across your system.
|
|
||||||
|
|
||||||
The following is an example installation of `nvf` as a standalone package with
|
|
||||||
the default theme enabled. You may use other options inside `config.vim` in
|
|
||||||
`configModule`, but this example will not cover that.
|
|
||||||
|
|
||||||
```nix
|
|
||||||
{
|
|
||||||
inputs = {
|
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
||||||
home-manager.url = "github:nix-community/home-manager";
|
|
||||||
nvf.url = "github:notashelf/nvf";
|
|
||||||
};
|
|
||||||
|
|
||||||
outputs = {nixpkgs, home-manager, nvf, ...}: let
|
|
||||||
system = "x86_64-linux";
|
|
||||||
pkgs = nixpkgs.legacyPackages.${system};
|
|
||||||
configModule = {
|
|
||||||
# Add any custom options (and do feel free to upstream them!)
|
|
||||||
# options = { ... };
|
|
||||||
|
|
||||||
config.vim = {
|
|
||||||
theme.enable = true;
|
|
||||||
# and more options as you see fit...
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
customNeovim = nvf.lib.neovimConfiguration {
|
|
||||||
modules = [configModule];
|
|
||||||
inherit pkgs;
|
|
||||||
};
|
|
||||||
in {
|
|
||||||
# this will make the package available as a flake input
|
|
||||||
packages.${system}.my-neovim = customNeovim.neovim;
|
|
||||||
|
|
||||||
# this is an example home-manager configuration
|
|
||||||
# using the built neovim package
|
|
||||||
homeConfigurations = {
|
|
||||||
"your-username@your-hostname" = home-manager.lib.homeManagerConfiguration {
|
|
||||||
# ...
|
|
||||||
modules = [
|
|
||||||
./home.nix
|
|
||||||
|
|
||||||
# this will make wrapped neovim available in your system packages
|
|
||||||
{environment.systemPackages = [customNeovim.neovim];}
|
|
||||||
];
|
|
||||||
# ...
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
```
|
|
|
@ -1,55 +0,0 @@
|
||||||
# Standalone Installation on NixOS {#ch-standalone-nixos}
|
|
||||||
|
|
||||||
Your built Neoevim configuration can be exposed as a flake output to make it
|
|
||||||
easier to share across machines, repositories and so on. Or it can be added to
|
|
||||||
your system packages to make it available across your system.
|
|
||||||
|
|
||||||
The following is an example installation of `nvf` as a standalone package with
|
|
||||||
the default theme enabled. You may use other options inside `config.vim` in
|
|
||||||
`configModule`, but this example will not cover that.
|
|
||||||
|
|
||||||
```nix
|
|
||||||
{
|
|
||||||
inputs = {
|
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
||||||
home-manager.url = "github:nix-community/home-manager";
|
|
||||||
nvf.url = "github:notashelf/nvf";
|
|
||||||
};
|
|
||||||
|
|
||||||
outputs = {nixpkgs, nvf, ...}: let
|
|
||||||
system = "x86_64-linux";
|
|
||||||
pkgs = nixpkgs.legacyPackages.${system};
|
|
||||||
configModule = {
|
|
||||||
# Add any custom options (and do feel free to upstream them!)
|
|
||||||
# options = { ... };
|
|
||||||
|
|
||||||
config.vim = {
|
|
||||||
theme.enable = true;
|
|
||||||
# and more options as you see fit...
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
customNeovim = nvf.lib.neovimConfiguration {
|
|
||||||
modules = [configModule];
|
|
||||||
inherit pkgs;
|
|
||||||
};
|
|
||||||
in {
|
|
||||||
# this will make the package available as a flake input
|
|
||||||
packages.${system}.my-neovim = customNeovim.neovim;
|
|
||||||
|
|
||||||
# this is an example nixosConfiguration using the built neovim package
|
|
||||||
nixosConfigurations = {
|
|
||||||
yourHostName = nixpkgs.lib.nixosSystem {
|
|
||||||
# ...
|
|
||||||
modules = [
|
|
||||||
./configuration.nix # or whatever your configuration is
|
|
||||||
|
|
||||||
# this will make wrapped neovim available in your system packages
|
|
||||||
{environment.systemPackages = [customNeovim.neovim];}
|
|
||||||
];
|
|
||||||
# ...
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
```
|
|
|
@ -1,10 +1,6 @@
|
||||||
# Language Support {#ch-languages}
|
# Language Support {#ch-languages}
|
||||||
|
|
||||||
Language specific support means there is a combination of language specific
|
Language specific support means there is a combination of language specific plugins, `treesitter` support, `nvim-lspconfig` language servers, and `null-ls` integration. This gets you capabilities ranging from autocompletion to formatting to diagnostics. The following languages have sections under the `vim.languages` attribute. See the configuration docs for details.
|
||||||
plugins, `treesitter` support, `nvim-lspconfig` language servers, and `null-ls`
|
|
||||||
integration. This gets you capabilities ranging from autocompletion to formatting
|
|
||||||
to diagnostics. The following languages have sections under the `vim.languages`
|
|
||||||
attribute.
|
|
||||||
|
|
||||||
- Rust: [vim.languages.rust.enable](#opt-vim.languages.rust.enable)
|
- Rust: [vim.languages.rust.enable](#opt-vim.languages.rust.enable)
|
||||||
- Nix: [vim.languages.nix.enable](#opt-vim.languages.nix.enable)
|
- Nix: [vim.languages.nix.enable](#opt-vim.languages.nix.enable)
|
16
docs/manual/languages/lsp.md
Normal file
16
docs/manual/languages/lsp.md
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
# LSP Custom Packages/Command {#sec-languages-custom-lsp-packages}
|
||||||
|
|
||||||
|
In any of the `opt.languages.<language>.lsp.package` options you can provide your own LSP package, or provide
|
||||||
|
the command to launch the language server, as a list of strings.
|
||||||
|
|
||||||
|
You can use this to skip automatic installation of a language server, and instead
|
||||||
|
use the one found in your `$PATH` during runtime, for example:
|
||||||
|
|
||||||
|
```nix
|
||||||
|
vim.languages.java = {
|
||||||
|
lsp = {
|
||||||
|
enable = true;
|
||||||
|
package = ["jdt-language-server" "-data" "~/.cache/jdtls/workspace"];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
```
|
3
docs/manual/manpage-urls.json
Normal file
3
docs/manual/manpage-urls.json
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"nix.conf(5)": "https://nixos.org/manual/nix/stable/command-ref/conf-file.html"
|
||||||
|
}
|
|
@ -1,6 +1,6 @@
|
||||||
# nvf manual {#nvf-manual}
|
# neovim-flake-manual {#neovim-flake-manual}
|
||||||
|
|
||||||
## Version @NVF_VERSION@
|
## Version @VERSION@
|
||||||
|
|
||||||
```{=include=} preface
|
```{=include=} preface
|
||||||
preface.md
|
preface.md
|
||||||
|
@ -8,12 +8,12 @@ try-it-out.md
|
||||||
```
|
```
|
||||||
|
|
||||||
```{=include=} parts
|
```{=include=} parts
|
||||||
|
custom-configs.md
|
||||||
|
custom-package.md
|
||||||
|
custom-plugins.md
|
||||||
default-configs.md
|
default-configs.md
|
||||||
installation.md
|
home-manager.md
|
||||||
configuring.md
|
languages.md
|
||||||
```
|
|
||||||
|
|
||||||
```{=include=} chapters
|
|
||||||
hacking.md
|
hacking.md
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,7 @@
|
||||||
# Neovim Flake Configuration Options {#ch-options}
|
# Neovim Flake Configuration Options {#ch-options}
|
||||||
|
|
||||||
Below are the options provided by nvf provided in no particular order.
|
|
||||||
They may include useful comments and warnings, or examples on how a module option
|
|
||||||
is meant to be used.
|
|
||||||
|
|
||||||
```{=include=} options
|
```{=include=} options
|
||||||
id-prefix: opt-
|
id-prefix: opt-
|
||||||
list-id: nvf-options
|
list-id: neovim-flake-options
|
||||||
source: @OPTIONS_JSON@
|
source: @OPTIONS_JSON@
|
||||||
```
|
```
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
# Preface {#ch-preface}
|
# Preface {#sec-preface}
|
||||||
|
|
||||||
If you noticed a bug caused by **nvf** then please consider reporting it over
|
If you noticed a bug caused by neovim-flake then please consider reporting it over
|
||||||
[the issue tracker](https://github.com/notashelf/nvf/issues).
|
[the neovim-flake issue tracker](https://github.com/notashelf/neovim-flake/issues).
|
||||||
|
Bugfixes, feature additions and upstreamed changes are welcome over
|
||||||
Bugfixes, feature additions and upstreamed changes from your local configurations
|
[the neovim-flake pull requests tab](https://github.com/notashelf/neovim-flake/pulls).
|
||||||
are always welcome in the [the pull requests tab](https://github.com/notashelf/nvf/pulls).
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# Try it out {#ch-try-it-out}
|
# Try it out {#ch-try-it-out}
|
||||||
|
|
||||||
Thanks to the portability of Nix, you can try out nvf without actually installing it to your machine.
|
Thanks to the portability of Nix, you can try out neovim-flake without actually installing it to your machine.
|
||||||
Below are the commands you may run to try out different configurations provided by this flake. As of v0.5, three
|
Below are the commands you may run to try out different configurations provided by this flake. As of v0.5, three
|
||||||
configurations are provided:
|
configurations are provided:
|
||||||
|
|
||||||
|
@ -11,19 +11,21 @@ configurations are provided:
|
||||||
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.
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ cachix use nvf # Optional: it'll save you CPU resources and time
|
$ cachix use neovim-flake # Optional: it'll save you CPU resources and time
|
||||||
$ nix run github:notashelf/nvf#nix # will run the default minimal configuration
|
$ nix run github:notashelf/neovim-flake#nix # will run the default minimal configuration
|
||||||
```
|
```
|
||||||
|
|
||||||
Do keep in mind that this is **susceptible to garbage collection** meaning it will be removed from your Nix store
|
Do keep in mind that this is **susceptible to garbage collection** meaning it will be removed from your Nix store
|
||||||
once you garbage collect.
|
once you garbage collect. If you wish to install neovim-flake, please take a look at
|
||||||
|
[custom-configuration](#ch-custom-configuration) or [home-manager](#ch-hm-module) sections for installation
|
||||||
|
instructions.
|
||||||
|
|
||||||
## Using Prebuilt Configs {#sec-using-prebuild-configs}
|
## Using Prebuilt Configs {#sec-using-prebuild-configs}
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ nix run github:notashelf/nvf#nix
|
$ nix run github:notashelf/neovim-flake#nix
|
||||||
$ nix run github:notashelf/nvf#tidal
|
$ nix run github:notashelf/neovim-flake#tidal
|
||||||
$ nix run github:notashelf/nvf#maximal
|
$ nix run github:notashelf/neovim-flake#maximal
|
||||||
```
|
```
|
||||||
|
|
||||||
### Available Configs {#sec-available-configs}
|
### Available Configs {#sec-available-configs}
|
||||||
|
@ -31,7 +33,7 @@ $ nix run github:notashelf/nvf#maximal
|
||||||
#### Nix {#sec-configs-nix}
|
#### Nix {#sec-configs-nix}
|
||||||
|
|
||||||
`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 {#sec-configs-tidal}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
.Dd January 1, 1980
|
.Dd January 1, 1980
|
||||||
.Dt nvf 1
|
.Dt neovim-flake 1
|
||||||
.Os nvf
|
.Os neovim-flake
|
||||||
.\" disable hyphenation
|
.\" disable hyphenation
|
||||||
.nh
|
.nh
|
||||||
.\" disable justification (adjust text to left margin only)
|
.\" disable justification (adjust text to left margin only)
|
||||||
|
@ -8,26 +8,22 @@
|
||||||
.\" enable line breaks after slashes
|
.\" enable line breaks after slashes
|
||||||
.cflags 4 /
|
.cflags 4 /
|
||||||
.Sh NAME
|
.Sh NAME
|
||||||
.Nm nvf
|
.Nm neovim-flake
|
||||||
.Nd A highly modular, extensible and distro-agnostic Neovim configuration framework for Nix/NixOS.
|
.Nd a extensible and distro-agonistic Neovim configuration wrapper in Nix
|
||||||
.
|
.
|
||||||
.Sh BUGS
|
.Sh BUGS
|
||||||
.Pp
|
.Pp
|
||||||
Please report any bugs that you might encounter on the
|
Please report any bugs on the
|
||||||
\m[blue]\fBproject issue tracker\fR\m[]\&.
|
\m[blue]\fBproject issue tracker\fR\m[]\&.
|
||||||
|
|
||||||
.Sh SEE ALSO
|
|
||||||
.Pp
|
|
||||||
\fBnvf\fR(5)
|
|
||||||
|
|
||||||
.Sh AUTHOR
|
.Sh AUTHOR
|
||||||
.Pp
|
.Pp
|
||||||
\fBnvf contributors\fR
|
\fBneovim-flake contributors\fR
|
||||||
.RS 4
|
.RS 4
|
||||||
Author.
|
Author.
|
||||||
.RE
|
.RE
|
||||||
|
|
||||||
.Sh COPYRIGHT
|
.Sh COPYRIGHT
|
||||||
.br
|
.br
|
||||||
Copyright \(co 2023\(en2024 nvf contributors
|
Copyright \(co 2017\(en2022 neovim-flake contributors
|
||||||
.br
|
.br
|
|
@ -1,7 +1,6 @@
|
||||||
# Release Notes {#ch-release-notes}
|
# Release Notes {#ch-release-notes}
|
||||||
|
|
||||||
This section lists the release notes for tagged version of **nvf** and
|
This section lists the release notes for tagged version of neovim-flake and current main.
|
||||||
the current main current main branch
|
|
||||||
|
|
||||||
```{=include=} chapters
|
```{=include=} chapters
|
||||||
rl-0.1.md
|
rl-0.1.md
|
||||||
|
|
|
@ -2,157 +2,53 @@
|
||||||
|
|
||||||
Release notes for release 0.6
|
Release notes for release 0.6
|
||||||
|
|
||||||
## Breaking Changes and Migration Guide {#sec-breaking-changes-and-migration-guide}
|
|
||||||
|
|
||||||
In v0.6 we are introducing `setupOpts`: many plugin related options are moved into their respective `setupOpts`
|
|
||||||
submodule, e.g. `nvimTree.disableNetrw` is renamed to `nvimTree.setupOpts.disable_netrw`.
|
|
||||||
|
|
||||||
_Why?_ in short, you can now pass in anything to setupOpts and it will be passed to your `require'plugin'.setup{...}`.
|
|
||||||
No need to wait for us to support every single plugin option.
|
|
||||||
|
|
||||||
The warnings when you rebuild your config should be enough to guide you through what you need to do, if there's an
|
|
||||||
option that was renamed but wasn't listed in the warning, please file a bug report!
|
|
||||||
|
|
||||||
To make your migration process less annoying, here's a keybind that will help you with renaming stuff from camelCase to
|
|
||||||
snake_case (you'll be doing that a lot):
|
|
||||||
|
|
||||||
```lua
|
|
||||||
-- paste this in a temp.lua file and load it in vim with :source /path/to/temp.lua
|
|
||||||
function camelToSnake()
|
|
||||||
-- Get the current word under the cursor
|
|
||||||
local word = vim.fn.expand("<cword>")
|
|
||||||
-- Replace each capital letter with an underscore followed by its lowercase equivalent
|
|
||||||
local snakeCase = string.gsub(word, "%u", function(match)
|
|
||||||
return "_" .. string.lower(match)
|
|
||||||
end)
|
|
||||||
-- Remove the leading underscore if present
|
|
||||||
if string.sub(snakeCase, 1, 1) == "_" then
|
|
||||||
snakeCase = string.sub(snakeCase, 2)
|
|
||||||
end
|
|
||||||
vim.fn.setreg(vim.v.register, snakeCase)
|
|
||||||
-- Select the word under the cursor and paste
|
|
||||||
vim.cmd("normal! viwP")
|
|
||||||
end
|
|
||||||
|
|
||||||
vim.api.nvim_set_keymap('n', '<leader>a', ':lua camelToSnake()<CR>', { noremap = true, silent = true })
|
|
||||||
```
|
|
||||||
|
|
||||||
## Changelog {#sec-release-0.6-changelog}
|
## Changelog {#sec-release-0.6-changelog}
|
||||||
|
|
||||||
[ksonj](https://github.com/ksonj):
|
[ksonj](https://github.com/ksonj):
|
||||||
|
|
||||||
- Added Terraform language support.
|
- Add Terraform language support
|
||||||
|
|
||||||
- Added `ChatGPT.nvim`, which can be enabled with [`vim.assistant.chatgpt`](vim.assistant.chatgpt). Do
|
|
||||||
keep in mind that this option requires `OPENAI_API_KEY` environment variable to be set.
|
|
||||||
|
|
||||||
[donnerinoern](https://github.com/donnerinoern):
|
|
||||||
|
|
||||||
- Added Gruvbox theme.
|
|
||||||
|
|
||||||
- Added marksman LSP for Markdown.
|
|
||||||
|
|
||||||
- Fixed markdown preview with Glow not working and added an option for changing the preview keybind.
|
|
||||||
|
|
||||||
- colorizer.nvim: switched to a maintained fork.
|
|
||||||
|
|
||||||
- Added `markdown-preview.nvim`, moved `glow.nvim` to a brand new `vim.utility.preview` category.
|
|
||||||
|
|
||||||
[elijahimmer](https://github.com/elijahimmer)
|
|
||||||
|
|
||||||
- Added rose-pine theme.
|
|
||||||
|
|
||||||
[jacekpoz](https://github.com/jacekpoz):
|
|
||||||
|
|
||||||
- Added `vim.autocomplete.alwaysComplete`. Allows users to have the autocomplete window popup only when manually activated.
|
|
||||||
|
|
||||||
[horriblename](https://github.com/horriblename):
|
[horriblename](https://github.com/horriblename):
|
||||||
|
|
||||||
- Fixed empty winbar when breadcrumbs are disabled.
|
- Fixed empty winbar when breadcrumbs are disabled
|
||||||
|
|
||||||
- Added custom `setupOpts` for various plugins.
|
[donnerinoern](https://github.com/donnerinoern):
|
||||||
|
|
||||||
- Removed support for deprecated plugin "nvim-compe".
|
- Added Gruvbox theme
|
||||||
|
|
||||||
- Moved most plugins to `setupOpts` method.
|
- Added marksman LSP for Markdown
|
||||||
|
|
||||||
[frothymarrow](https://github.com/frothymarrow):
|
- Fixed markdown preview with Glow not working and added an option for changing the preview keybind
|
||||||
|
|
||||||
- Added option `vim.luaPackages` to wrap neovim with extra Lua packages.
|
- colorizer.nvim: switched to a maintained fork
|
||||||
|
|
||||||
- Rewrote the entire `fidget.nvim` module to include extensive configuration options. Option `vim.fidget-nvim.align.bottom` has
|
- Added `markdown-preview.nvim`, moved `glow.nvim` to a brand new `vim.utility.preview` category.
|
||||||
been removed in favor of [vim.fidget-nvim.notification.window.align](vim.fidget-nvim.notification.window.align), which now supports
|
|
||||||
`top` and `bottom` values. `vim.fidget-nvim.align.right` has no longer any equivalent and also has been removed.
|
|
||||||
|
|
||||||
- `which-key.nvim` categories can now be customized through [vim.binds.whichKey.register](vim.binds.whichKey.register)
|
|
||||||
|
|
||||||
- Added `magick` to `vim.luaPackages` for `image.nvim`.
|
|
||||||
|
|
||||||
- Added `alejandra` to the default devShell.
|
|
||||||
|
|
||||||
- Migrated neovim-flake to `makeNeovimUnstable` wrapper.
|
|
||||||
|
|
||||||
[notashelf](https://github.com/notashelf):
|
[notashelf](https://github.com/notashelf):
|
||||||
|
|
||||||
- Finished moving to `nixosOptionsDoc` in the documentation and changelog. All documentation options
|
- Finished moving to `nixosOptionsDoc` in the documentation and changelog. We are fully free of asciidoc now
|
||||||
and files are fully free of Asciidoc, and will now use Nixpkgs flavored markdown.
|
|
||||||
|
|
||||||
- Bumped plugin inputs to their latest versions.
|
- Bumped plugin inputs to their latest versions
|
||||||
|
|
||||||
- Deprecated `presence.nvim` in favor of `neocord`. This means `vim.rich-presence.presence-nvim` is removed and will throw
|
- Deprecated `presence.nvim` in favor of `neocord`. This means `vim.rich-presence.presence-nvim` is removed and will throw
|
||||||
a warning if used. You are recommended to rewrite your neocord configuration from scratch based on the.
|
a warning if used. You are recommended to rewrite your neocord config from scratch based on the
|
||||||
[official documentation](https://github.com/IogaMaster/neocord)
|
[official documentation](https://github.com/IogaMaster/neocord)
|
||||||
|
|
||||||
- Removed Tabnine plugin due to the usage of imperative tarball downloads. If you'd like to see it back, please create an issue.
|
|
||||||
|
|
||||||
- Added support for css and tailwindcss through vscode-language-servers-extracted & tailwind-language-server.
|
- Added support for css and tailwindcss through vscode-language-servers-extracted & tailwind-language-server.
|
||||||
Those can be enabled through `vim.languages.css` and `vim.languages.tailwind`.
|
Those can be enabled through `vim.languages.css` and `vim.languages.tailwind`
|
||||||
|
|
||||||
- Lualine module now allows customizing `always_divide_middle`, `ignore_focus` and `disabled_filetypes` through the new
|
- Lualine module now allows customizing `always_divide_middle`, `ignore_focus` and `disabled_filetypes` through the new
|
||||||
options: [vim.statusline.lualine.alwaysDivideMiddle](vim.statusline.lualine.alwaysDivideMiddle),
|
options: [vim.statusline.lualine.alwaysDivideMiddle](vim.statusline.lualine.alwaysDivideMiddle),
|
||||||
[vim.statusline.lualine.ignoreFocus](vim.statusline.lualine.ignoreFocus) and
|
[vim.statusline.lualine.ignoreFocus](vim.statusline.lualine.ignoreFocus) and
|
||||||
[vim.statusline.lualine.disabledFiletypes](vim.statusline.lualine.disabledFiletypes).
|
[vim.statusline.lualine.disabledFiletypes](vim.statusline.lualine.disabledFiletypes)
|
||||||
|
|
||||||
- Updated all plugin inputs to their latest versions (**21.04.2024**) - this brought minor color changes to the Catppuccin
|
- Updated all plugin inputs to their latest versions (26.01.2024) - this brought minor color changess to the Catppuccin
|
||||||
theme.
|
theme
|
||||||
|
|
||||||
- Moved home-manager module entrypoint to `flake/modules` and added an experimental Nixos module. This requires further testing
|
[elijahimmer](https://github.com/elijahimmer)
|
||||||
before it can be considered ready for use.
|
|
||||||
|
|
||||||
- Made lib calls explicit. E.g. `lib.strings.optionalString` instead of `lib.optionalString`. This is a pattern expected
|
- Added rose-pine theme
|
||||||
to be followed by all contributors in the future.
|
|
||||||
|
|
||||||
- Added `image.nvim` for image previews.
|
[frothymarrow](https://github.com/frothymarrow)
|
||||||
|
|
||||||
- The final neovim package is now exposed. This means you can build the neovim package that will be added to your
|
- Added option `vim.luaPackages` to wrap neovim with extra Lua packages.
|
||||||
package list without rebuilding your system to test if your configuration yields a broken package.
|
|
||||||
|
|
||||||
- Changed the tree structure to distinguish between core options and plugin options.
|
|
||||||
|
|
||||||
- Added plugin auto-discovery from plugin inputs. This is mostly from
|
|
||||||
[JordanIsaac's neovim-flake](https://github.com/jordanisaacs/neovim-flake). Allows contributors to add plugin inputs
|
|
||||||
with the `plugin-` prefix to have them automatically discovered for the `plugin` type in `lib/types`.
|
|
||||||
|
|
||||||
- Moved internal `wrapLuaConfig` to the extended library, structured its arguments to take `luaBefore`, `luaConfig`
|
|
||||||
and `luaAfter` as strings, which are then concatted inside a lua block.
|
|
||||||
|
|
||||||
- Added [`vim.luaConfigBefore`](vim.luaConfigBefore) and [`vim.luaConfigAfter`](vim.luaConfigAfter)
|
|
||||||
for inserting verbatim Lua configuration before and after the resolved Lua DAG respectively. Both of those options
|
|
||||||
take strings as the type, so you may read the contents of a Lua file from a given path.
|
|
||||||
|
|
||||||
- Added [`vim.spellChecking.ignoredFiletypes`](vim.spellChecking.ignoredFiletypes)
|
|
||||||
and [`vim.spellChecking.programmingWordlist.enable`](vim.spellChecking.programmingWordlist.enable) for ignoring certain filetypes
|
|
||||||
in spellchecking and enabling `vim-dirtytalk` respectively. The previously used `vim.spellcheck.vim-dirtytalk` aliases to the latter
|
|
||||||
option.
|
|
||||||
|
|
||||||
- Exposed `withRuby`, `withNodeJs`, `withPython3`, and `python3Packages` from the `makeNeovimConfig` function under their respective options.
|
|
||||||
|
|
||||||
- Added [`vim.extraPackages`](vim.extraPackages) for appending additional packages to the wrapper PATH, making said packages available
|
|
||||||
while inside the Neovim session.
|
|
||||||
|
|
||||||
- Made treesitter options configurable, and moved `treesitter-context to
|
|
||||||
`setupOpts` while it is enabled.
|
|
||||||
|
|
||||||
- Added `vim.notify.nvim-notify.setupOpts.render` which takes either a string of enum or
|
|
||||||
a lua function. The default is "compact", but you may change it according to
|
|
||||||
nvim-notify documentation.
|
|
||||||
|
|
830
docs/static/style.css
vendored
830
docs/static/style.css
vendored
|
@ -1,830 +0,0 @@
|
||||||
:root {
|
|
||||||
--nmd-color0: #0a3e68;
|
|
||||||
--nmd-color1: #268598;
|
|
||||||
--nmd-color2: #b8d09e;
|
|
||||||
--nmd-color3: #f6cf5e;
|
|
||||||
--nmd-color4: #ec733b;
|
|
||||||
--nmd-color-info: #167cb9;
|
|
||||||
--nmd-color-warn: #ff6700;
|
|
||||||
}
|
|
||||||
html {
|
|
||||||
-webkit-text-size-adjust: 100%;
|
|
||||||
}
|
|
||||||
html:focus-within {
|
|
||||||
scroll-behavior: smooth;
|
|
||||||
}
|
|
||||||
body {
|
|
||||||
-webkit-text-size-adjust: 100%;
|
|
||||||
-moz-text-size-adjust: 100%;
|
|
||||||
text-size-adjust: 100%;
|
|
||||||
-moz-osx-font-smoothing: grayscale;
|
|
||||||
-webkit-font-smoothing: antialiased;
|
|
||||||
min-height: 100vh;
|
|
||||||
position: relative;
|
|
||||||
text-rendering: optimizeSpeed;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
*,
|
|
||||||
:after,
|
|
||||||
:before {
|
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
|
||||||
a:not([class]) {
|
|
||||||
-webkit-text-decoration-skip: ink;
|
|
||||||
text-decoration-skip-ink: auto;
|
|
||||||
}
|
|
||||||
a,
|
|
||||||
abbr,
|
|
||||||
acronym,
|
|
||||||
address,
|
|
||||||
applet,
|
|
||||||
article,
|
|
||||||
aside,
|
|
||||||
audio,
|
|
||||||
b,
|
|
||||||
big,
|
|
||||||
blockquote,
|
|
||||||
body,
|
|
||||||
canvas,
|
|
||||||
caption,
|
|
||||||
center,
|
|
||||||
cite,
|
|
||||||
code,
|
|
||||||
dd,
|
|
||||||
del,
|
|
||||||
details,
|
|
||||||
dfn,
|
|
||||||
div,
|
|
||||||
dl,
|
|
||||||
dt,
|
|
||||||
em,
|
|
||||||
embed,
|
|
||||||
fieldset,
|
|
||||||
figcaption,
|
|
||||||
figure,
|
|
||||||
footer,
|
|
||||||
form,
|
|
||||||
h1,
|
|
||||||
h2,
|
|
||||||
h3,
|
|
||||||
h4,
|
|
||||||
h5,
|
|
||||||
h6,
|
|
||||||
header,
|
|
||||||
hgroup,
|
|
||||||
html,
|
|
||||||
i,
|
|
||||||
iframe,
|
|
||||||
img,
|
|
||||||
ins,
|
|
||||||
kbd,
|
|
||||||
label,
|
|
||||||
legend,
|
|
||||||
li,
|
|
||||||
mark,
|
|
||||||
menu,
|
|
||||||
nav,
|
|
||||||
object,
|
|
||||||
ol,
|
|
||||||
output,
|
|
||||||
p,
|
|
||||||
pre,
|
|
||||||
q,
|
|
||||||
ruby,
|
|
||||||
s,
|
|
||||||
samp,
|
|
||||||
section,
|
|
||||||
small,
|
|
||||||
span,
|
|
||||||
strike,
|
|
||||||
strong,
|
|
||||||
sub,
|
|
||||||
summary,
|
|
||||||
sup,
|
|
||||||
table,
|
|
||||||
tbody,
|
|
||||||
td,
|
|
||||||
tfoot,
|
|
||||||
th,
|
|
||||||
thead,
|
|
||||||
time,
|
|
||||||
tr,
|
|
||||||
tt,
|
|
||||||
u,
|
|
||||||
ul,
|
|
||||||
var,
|
|
||||||
video {
|
|
||||||
border: 0;
|
|
||||||
font-size: 100%;
|
|
||||||
font: inherit;
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
vertical-align: baseline;
|
|
||||||
}
|
|
||||||
:focus {
|
|
||||||
outline: 0;
|
|
||||||
}
|
|
||||||
article,
|
|
||||||
aside,
|
|
||||||
details,
|
|
||||||
figcaption,
|
|
||||||
figure,
|
|
||||||
footer,
|
|
||||||
header,
|
|
||||||
hgroup,
|
|
||||||
main,
|
|
||||||
menu,
|
|
||||||
nav,
|
|
||||||
section {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
ol,
|
|
||||||
ul {
|
|
||||||
list-style: none;
|
|
||||||
}
|
|
||||||
blockquote,
|
|
||||||
q {
|
|
||||||
quotes: none;
|
|
||||||
}
|
|
||||||
blockquote:after,
|
|
||||||
blockquote:before,
|
|
||||||
q:after,
|
|
||||||
q:before {
|
|
||||||
content: "";
|
|
||||||
content: none;
|
|
||||||
}
|
|
||||||
input,
|
|
||||||
input:required {
|
|
||||||
box-shadow: none;
|
|
||||||
}
|
|
||||||
input:-webkit-autofill,
|
|
||||||
input:-webkit-autofill:active,
|
|
||||||
input:-webkit-autofill:focus,
|
|
||||||
input:-webkit-autofill:hover {
|
|
||||||
-webkit-box-shadow: inset 0 0 0 30px #fff;
|
|
||||||
}
|
|
||||||
input[type="search"]::-webkit-search-cancel-button,
|
|
||||||
input[type="search"]::-webkit-search-decoration,
|
|
||||||
input[type="search"]::-webkit-search-results-button,
|
|
||||||
input[type="search"]::-webkit-search-results-decoration {
|
|
||||||
-webkit-appearance: none;
|
|
||||||
-moz-appearance: none;
|
|
||||||
}
|
|
||||||
input[type="search"] {
|
|
||||||
-webkit-appearance: none;
|
|
||||||
-moz-appearance: none;
|
|
||||||
}
|
|
||||||
input:focus {
|
|
||||||
outline: 0;
|
|
||||||
}
|
|
||||||
audio,
|
|
||||||
canvas,
|
|
||||||
video {
|
|
||||||
display: inline-block;
|
|
||||||
max-width: 100%;
|
|
||||||
}
|
|
||||||
audio:not([controls]) {
|
|
||||||
display: none;
|
|
||||||
height: 0;
|
|
||||||
}
|
|
||||||
[hidden] {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
a:active,
|
|
||||||
a:hover {
|
|
||||||
outline: 0;
|
|
||||||
}
|
|
||||||
img {
|
|
||||||
height: auto;
|
|
||||||
max-width: 100%;
|
|
||||||
vertical-align: middle;
|
|
||||||
}
|
|
||||||
img,
|
|
||||||
picture {
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
button,
|
|
||||||
input {
|
|
||||||
line-height: normal;
|
|
||||||
}
|
|
||||||
button,
|
|
||||||
html input[type="button"],
|
|
||||||
input[type="reset"],
|
|
||||||
input[type="submit"] {
|
|
||||||
-webkit-appearance: button;
|
|
||||||
background: 0 0;
|
|
||||||
border: 0;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
button[disabled],
|
|
||||||
html input[disabled] {
|
|
||||||
cursor: default;
|
|
||||||
}
|
|
||||||
[disabled] {
|
|
||||||
pointer-events: none;
|
|
||||||
}
|
|
||||||
input[type="checkbox"],
|
|
||||||
input[type="radio"] {
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
input[type="search"] {
|
|
||||||
-webkit-appearance: textfield;
|
|
||||||
box-sizing: content-box;
|
|
||||||
}
|
|
||||||
input[type="search"]::-webkit-search-cancel-button,
|
|
||||||
input[type="search"]::-webkit-search-decoration {
|
|
||||||
-webkit-appearance: none;
|
|
||||||
}
|
|
||||||
button::-moz-focus-inner,
|
|
||||||
input::-moz-focus-inner {
|
|
||||||
border: 0;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
button {
|
|
||||||
background: 0 0;
|
|
||||||
border: 0;
|
|
||||||
}
|
|
||||||
textarea {
|
|
||||||
overflow: auto;
|
|
||||||
resize: vertical;
|
|
||||||
vertical-align: top;
|
|
||||||
}
|
|
||||||
table {
|
|
||||||
border-collapse: collapse;
|
|
||||||
border-spacing: 0;
|
|
||||||
text-indent: 0;
|
|
||||||
}
|
|
||||||
hr {
|
|
||||||
background: #000;
|
|
||||||
border: 0;
|
|
||||||
box-sizing: content-box;
|
|
||||||
height: 1px;
|
|
||||||
line-height: 0;
|
|
||||||
margin: 0;
|
|
||||||
overflow: visible;
|
|
||||||
padding: 0;
|
|
||||||
page-break-after: always;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
pre {
|
|
||||||
font-family: monospace, monospace;
|
|
||||||
font-size: 100%;
|
|
||||||
}
|
|
||||||
a {
|
|
||||||
background-color: transparent;
|
|
||||||
}
|
|
||||||
abbr[title] {
|
|
||||||
border-bottom: none;
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
code,
|
|
||||||
kbd,
|
|
||||||
pre,
|
|
||||||
samp {
|
|
||||||
font-family: monospace, monospace;
|
|
||||||
}
|
|
||||||
small,
|
|
||||||
sub,
|
|
||||||
sup {
|
|
||||||
font-size: 75%;
|
|
||||||
}
|
|
||||||
sub,
|
|
||||||
sup {
|
|
||||||
line-height: 0;
|
|
||||||
position: relative;
|
|
||||||
vertical-align: baseline;
|
|
||||||
}
|
|
||||||
sub {
|
|
||||||
bottom: -5px;
|
|
||||||
}
|
|
||||||
sup {
|
|
||||||
top: -5px;
|
|
||||||
}
|
|
||||||
button,
|
|
||||||
input,
|
|
||||||
optgroup,
|
|
||||||
select,
|
|
||||||
textarea {
|
|
||||||
font-family: inherit;
|
|
||||||
font-size: 100%;
|
|
||||||
line-height: 1;
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
button,
|
|
||||||
input {
|
|
||||||
overflow: visible;
|
|
||||||
}
|
|
||||||
button,
|
|
||||||
select {
|
|
||||||
text-transform: none;
|
|
||||||
}
|
|
||||||
[type="button"],
|
|
||||||
[type="reset"],
|
|
||||||
[type="submit"],
|
|
||||||
button {
|
|
||||||
-webkit-appearance: button;
|
|
||||||
}
|
|
||||||
[type="button"]::-moz-focus-inner,
|
|
||||||
[type="reset"]::-moz-focus-inner,
|
|
||||||
[type="submit"]::-moz-focus-inner,
|
|
||||||
button::-moz-focus-inner {
|
|
||||||
border-style: none;
|
|
||||||
outline: 0;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
legend {
|
|
||||||
border: 0;
|
|
||||||
color: inherit;
|
|
||||||
display: block;
|
|
||||||
max-width: 100%;
|
|
||||||
white-space: normal;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
fieldset {
|
|
||||||
min-width: 0;
|
|
||||||
}
|
|
||||||
body:not(:-moz-handler-blocked) fieldset {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
progress {
|
|
||||||
vertical-align: baseline;
|
|
||||||
}
|
|
||||||
[type="number"]::-webkit-inner-spin-button,
|
|
||||||
[type="number"]::-webkit-outer-spin-button {
|
|
||||||
height: auto;
|
|
||||||
}
|
|
||||||
[type="search"] {
|
|
||||||
-webkit-appearance: textfield;
|
|
||||||
outline-offset: -2px;
|
|
||||||
}
|
|
||||||
[type="search"]::-webkit-search-decoration {
|
|
||||||
-webkit-appearance: none;
|
|
||||||
}
|
|
||||||
::-webkit-file-upload-button {
|
|
||||||
-webkit-appearance: button;
|
|
||||||
font: inherit;
|
|
||||||
}
|
|
||||||
summary {
|
|
||||||
display: list-item;
|
|
||||||
}
|
|
||||||
template {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
body {
|
|
||||||
background: white;
|
|
||||||
color: #111827;
|
|
||||||
max-width: min(100ch, 1024px);
|
|
||||||
margin: 0 auto;
|
|
||||||
padding: 10px;
|
|
||||||
font-family: "Lucida Sans", Arial, sans-serif;
|
|
||||||
font-size: 16px;
|
|
||||||
line-height: 1.4em;
|
|
||||||
}
|
|
||||||
@media (prefers-color-scheme: dark) {
|
|
||||||
body {
|
|
||||||
background: #111827;
|
|
||||||
color: #f9fafb;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
h1,
|
|
||||||
h2,
|
|
||||||
h3 {
|
|
||||||
color: var(--nmd-color0);
|
|
||||||
font-family: "Lato", sans-serif;
|
|
||||||
font-weight: 300;
|
|
||||||
line-height: 1.125;
|
|
||||||
}
|
|
||||||
@media (prefers-color-scheme: dark) {
|
|
||||||
h1,
|
|
||||||
h2,
|
|
||||||
h3 {
|
|
||||||
color: var(--nmd-color4);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
h1 {
|
|
||||||
font-size: 48px;
|
|
||||||
font-weight: 300;
|
|
||||||
margin: 4rem 0 1.5rem;
|
|
||||||
}
|
|
||||||
h2 {
|
|
||||||
font-size: 32px;
|
|
||||||
font-weight: 300;
|
|
||||||
margin: 2rem 0 1rem;
|
|
||||||
}
|
|
||||||
h3 {
|
|
||||||
font-size: 20px;
|
|
||||||
font-weight: 400;
|
|
||||||
margin: 0.5rem 0.25rem;
|
|
||||||
}
|
|
||||||
p {
|
|
||||||
margin: 0.9rem 0;
|
|
||||||
}
|
|
||||||
p:first-child {
|
|
||||||
margin-top: 0;
|
|
||||||
}
|
|
||||||
p:last-child {
|
|
||||||
margin-bottom: 0;
|
|
||||||
}
|
|
||||||
a {
|
|
||||||
color: var(--nmd-color0);
|
|
||||||
text-decoration: underline;
|
|
||||||
text-underline-offset: 3px;
|
|
||||||
}
|
|
||||||
a:visited {
|
|
||||||
color: var(--nmd-color1);
|
|
||||||
}
|
|
||||||
a:hover {
|
|
||||||
color: var(--nmd-color1);
|
|
||||||
}
|
|
||||||
@media (prefers-color-scheme: dark) {
|
|
||||||
a {
|
|
||||||
color: var(--nmd-color3);
|
|
||||||
}
|
|
||||||
a:visited {
|
|
||||||
color: var(--nmd-color2);
|
|
||||||
}
|
|
||||||
a:hover {
|
|
||||||
color: var(--nmd-color4);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
code {
|
|
||||||
font-size: 90%;
|
|
||||||
}
|
|
||||||
span.command {
|
|
||||||
font-size: 90%;
|
|
||||||
font-family: monospace;
|
|
||||||
}
|
|
||||||
em {
|
|
||||||
font-style: italic;
|
|
||||||
}
|
|
||||||
strong {
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
pre {
|
|
||||||
background: #f9fafb;
|
|
||||||
margin: 2rem 16px;
|
|
||||||
padding: 10px;
|
|
||||||
border: 1px solid #e5e7eb;
|
|
||||||
border-radius: 4px;
|
|
||||||
box-shadow: 4px 4px 8px #e5e7eb;
|
|
||||||
font-size: 90%;
|
|
||||||
margin-bottom: 1.5rem;
|
|
||||||
padding: 6px;
|
|
||||||
overflow: auto;
|
|
||||||
}
|
|
||||||
@media (prefers-color-scheme: dark) {
|
|
||||||
pre {
|
|
||||||
background: #1f2937;
|
|
||||||
border-color: black;
|
|
||||||
box-shadow: 4px 4px 8px black;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pre span img {
|
|
||||||
user-select: none;
|
|
||||||
}
|
|
||||||
pre:has(code) {
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
td,
|
|
||||||
th {
|
|
||||||
padding: 2px 5px;
|
|
||||||
}
|
|
||||||
td:first-child,
|
|
||||||
th:first-child {
|
|
||||||
padding-left: 0;
|
|
||||||
}
|
|
||||||
td:last-child,
|
|
||||||
th:last-child {
|
|
||||||
padding-right: 0;
|
|
||||||
}
|
|
||||||
dt {
|
|
||||||
margin: 1.2rem 0 0.8rem;
|
|
||||||
}
|
|
||||||
dd {
|
|
||||||
margin-left: 2rem;
|
|
||||||
}
|
|
||||||
ul {
|
|
||||||
margin: 0.9rem 0;
|
|
||||||
padding-left: 30px;
|
|
||||||
list-style: disc;
|
|
||||||
}
|
|
||||||
ul:first-child {
|
|
||||||
margin-top: 0;
|
|
||||||
}
|
|
||||||
ul:last-child {
|
|
||||||
margin-bottom: 0;
|
|
||||||
}
|
|
||||||
ol {
|
|
||||||
margin: 0.9rem 0;
|
|
||||||
padding-left: 30px;
|
|
||||||
list-style: decimal;
|
|
||||||
}
|
|
||||||
ol:first-child {
|
|
||||||
margin-top: 0;
|
|
||||||
}
|
|
||||||
ol:last-child {
|
|
||||||
margin-bottom: 0;
|
|
||||||
}
|
|
||||||
li {
|
|
||||||
margin: 0.9rem 0;
|
|
||||||
padding-left: 5px;
|
|
||||||
}
|
|
||||||
li:first-child {
|
|
||||||
margin-top: 0;
|
|
||||||
}
|
|
||||||
li:last-child {
|
|
||||||
margin-bottom: 0;
|
|
||||||
}
|
|
||||||
.navheader hr,
|
|
||||||
.navfooter hr {
|
|
||||||
margin: 1rem 0;
|
|
||||||
background: #e5e7eb;
|
|
||||||
}
|
|
||||||
@media (prefers-color-scheme: dark) {
|
|
||||||
.navheader hr,
|
|
||||||
.navfooter hr {
|
|
||||||
background: #4b5563;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.navheader a,
|
|
||||||
.navfooter a {
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
div.titlepage {
|
|
||||||
margin: 40px 0;
|
|
||||||
}
|
|
||||||
div.titlepage hr {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
div.toc {
|
|
||||||
background: #f9fafb;
|
|
||||||
margin: 2rem 16px;
|
|
||||||
padding: 10px;
|
|
||||||
border: 1px solid #e5e7eb;
|
|
||||||
border-radius: 4px;
|
|
||||||
box-shadow: 4px 4px 8px #e5e7eb;
|
|
||||||
}
|
|
||||||
@media (prefers-color-scheme: dark) {
|
|
||||||
div.toc {
|
|
||||||
background: #1f2937;
|
|
||||||
border-color: black;
|
|
||||||
box-shadow: 4px 4px 8px black;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
div.toc a {
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
div.note,
|
|
||||||
div.warning {
|
|
||||||
background: #f9fafb;
|
|
||||||
margin: 2rem 16px;
|
|
||||||
padding: 10px;
|
|
||||||
border: 1px solid #e5e7eb;
|
|
||||||
border-radius: 4px;
|
|
||||||
box-shadow: 4px 4px 8px #e5e7eb;
|
|
||||||
font-style: italic;
|
|
||||||
}
|
|
||||||
@media (prefers-color-scheme: dark) {
|
|
||||||
div.note,
|
|
||||||
div.warning {
|
|
||||||
background: #1f2937;
|
|
||||||
border-color: black;
|
|
||||||
box-shadow: 4px 4px 8px black;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
div.note h3,
|
|
||||||
div.warning h3 {
|
|
||||||
float: right;
|
|
||||||
margin: 0 0 1rem 1rem;
|
|
||||||
width: 42px;
|
|
||||||
height: 42px;
|
|
||||||
content: url();
|
|
||||||
}
|
|
||||||
div.note h3 + p,
|
|
||||||
div.warning h3 + p {
|
|
||||||
margin-top: 0;
|
|
||||||
}
|
|
||||||
div.note h3 {
|
|
||||||
background-color: var(--nmd-color-info);
|
|
||||||
mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='42' height='42' viewBox='0 0 24 24' stroke-width='2' stroke='black' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'%3E%3C/path%3E%3Cpath d='M12 8h.01'%3E%3C/path%3E%3Cpath d='M11 12h1v4h1'%3E%3C/path%3E%3Cpath d='M12 3c7.2 0 9 1.8 9 9s-1.8 9 -9 9s-9 -1.8 -9 -9s1.8 -9 9 -9z'%3E%3C/path%3E%3C/svg%3E");
|
|
||||||
-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='42' height='42' viewBox='0 0 24 24' stroke-width='2' stroke='black' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'%3E%3C/path%3E%3Cpath d='M12 8h.01'%3E%3C/path%3E%3Cpath d='M11 12h1v4h1'%3E%3C/path%3E%3Cpath d='M12 3c7.2 0 9 1.8 9 9s-1.8 9 -9 9s-9 -1.8 -9 -9s1.8 -9 9 -9z'%3E%3C/path%3E%3C/svg%3E");
|
|
||||||
}
|
|
||||||
div.warning h3 {
|
|
||||||
background-color: var(--nmd-color-warn);
|
|
||||||
mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='42' height='42' viewBox='0 0 24 24' stroke-width='2' stroke='black' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'%3E%3C/path%3E%3Cpath d='M12 9v2m0 4v.01'%3E%3C/path%3E%3Cpath d='M5 19h14a2 2 0 0 0 1.84 -2.75l-7.1 -12.25a2 2 0 0 0 -3.5 0l-7.1 12.25a2 2 0 0 0 1.75 2.75'%3E%3C/path%3E%3C/svg%3E");
|
|
||||||
-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='42' height='42' viewBox='0 0 24 24' stroke-width='2' stroke='black' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'%3E%3C/path%3E%3Cpath d='M12 9v2m0 4v.01'%3E%3C/path%3E%3Cpath d='M5 19h14a2 2 0 0 0 1.84 -2.75l-7.1 -12.25a2 2 0 0 0 -3.5 0l-7.1 12.25a2 2 0 0 0 1.75 2.75'%3E%3C/path%3E%3C/svg%3E");
|
|
||||||
}
|
|
||||||
.term {
|
|
||||||
font-weight: 300;
|
|
||||||
}
|
|
||||||
.docbook .xref img[src^="images\/callouts\/"],
|
|
||||||
.screen img,
|
|
||||||
.programlisting img {
|
|
||||||
width: 1em;
|
|
||||||
}
|
|
||||||
.calloutlist img {
|
|
||||||
width: 1.3em;
|
|
||||||
}
|
|
||||||
.programlisting.language-shell .hljs-meta.prompt_ {
|
|
||||||
user-select: none;
|
|
||||||
} /*!
|
|
||||||
Theme: Tomorrow
|
|
||||||
Author: Chris Kempson (http://chriskempson.com)
|
|
||||||
License: ~ MIT (or more permissive) [via base16-schemes-source]
|
|
||||||
Maintainer: @highlightjs/core-team
|
|
||||||
Version: 2021.09.0
|
|
||||||
*/
|
|
||||||
pre code.hljs {
|
|
||||||
display: block;
|
|
||||||
overflow-x: auto;
|
|
||||||
padding: 1em;
|
|
||||||
}
|
|
||||||
code.hljs {
|
|
||||||
padding: 3px 5px;
|
|
||||||
}
|
|
||||||
.hljs {
|
|
||||||
color: #4d4d4c;
|
|
||||||
background: #fff;
|
|
||||||
}
|
|
||||||
.hljs ::selection,
|
|
||||||
.hljs::selection {
|
|
||||||
background-color: #d6d6d6;
|
|
||||||
color: #4d4d4c;
|
|
||||||
}
|
|
||||||
.hljs-comment {
|
|
||||||
color: #8e908c;
|
|
||||||
}
|
|
||||||
.hljs-tag {
|
|
||||||
color: #969896;
|
|
||||||
}
|
|
||||||
.hljs-operator,
|
|
||||||
.hljs-punctuation,
|
|
||||||
.hljs-subst {
|
|
||||||
color: #4d4d4c;
|
|
||||||
}
|
|
||||||
.hljs-operator {
|
|
||||||
opacity: 0.7;
|
|
||||||
}
|
|
||||||
.hljs-bullet,
|
|
||||||
.hljs-deletion,
|
|
||||||
.hljs-name,
|
|
||||||
.hljs-selector-tag,
|
|
||||||
.hljs-template-variable,
|
|
||||||
.hljs-variable {
|
|
||||||
color: #c82829;
|
|
||||||
}
|
|
||||||
.hljs-attr,
|
|
||||||
.hljs-link,
|
|
||||||
.hljs-literal,
|
|
||||||
.hljs-number,
|
|
||||||
.hljs-symbol,
|
|
||||||
.hljs-variable.constant_ {
|
|
||||||
color: #f5871f;
|
|
||||||
}
|
|
||||||
.hljs-class .hljs-title,
|
|
||||||
.hljs-title,
|
|
||||||
.hljs-title.class_ {
|
|
||||||
color: #eab700;
|
|
||||||
}
|
|
||||||
.hljs-strong {
|
|
||||||
font-weight: 700;
|
|
||||||
color: #eab700;
|
|
||||||
}
|
|
||||||
.hljs-addition,
|
|
||||||
.hljs-code,
|
|
||||||
.hljs-string,
|
|
||||||
.hljs-title.class_.inherited__ {
|
|
||||||
color: #718c00;
|
|
||||||
}
|
|
||||||
.hljs-built_in,
|
|
||||||
.hljs-doctag,
|
|
||||||
.hljs-keyword.hljs-atrule,
|
|
||||||
.hljs-quote,
|
|
||||||
.hljs-regexp {
|
|
||||||
color: #3e999f;
|
|
||||||
}
|
|
||||||
.hljs-attribute,
|
|
||||||
.hljs-function .hljs-title,
|
|
||||||
.hljs-section,
|
|
||||||
.hljs-title.function_,
|
|
||||||
.ruby .hljs-property {
|
|
||||||
color: #4271ae;
|
|
||||||
}
|
|
||||||
.diff .hljs-meta,
|
|
||||||
.hljs-keyword,
|
|
||||||
.hljs-template-tag,
|
|
||||||
.hljs-type {
|
|
||||||
color: #8959a8;
|
|
||||||
}
|
|
||||||
.hljs-emphasis {
|
|
||||||
color: #8959a8;
|
|
||||||
font-style: italic;
|
|
||||||
}
|
|
||||||
.hljs-meta,
|
|
||||||
.hljs-meta .hljs-keyword,
|
|
||||||
.hljs-meta .hljs-string {
|
|
||||||
color: #a3685a;
|
|
||||||
}
|
|
||||||
.hljs-meta .hljs-keyword,
|
|
||||||
.hljs-meta-keyword {
|
|
||||||
font-weight: 700;
|
|
||||||
}
|
|
||||||
@media (prefers-color-scheme: dark) {
|
|
||||||
/*! Theme: Tomorrow Night Author: Chris Kempson (http://chriskempson.com) License: ~ MIT (or more permissive) [via base16-schemes-source] Maintainer: @highlightjs/core-team Version: 2021.09.0*/
|
|
||||||
pre code.hljs {
|
|
||||||
display: block;
|
|
||||||
overflow-x: auto;
|
|
||||||
padding: 1em;
|
|
||||||
}
|
|
||||||
code.hljs {
|
|
||||||
padding: 3px 5px;
|
|
||||||
}
|
|
||||||
.hljs {
|
|
||||||
color: #ccc;
|
|
||||||
background: #2d2d2d;
|
|
||||||
}
|
|
||||||
.hljs ::selection,
|
|
||||||
.hljs::selection {
|
|
||||||
background-color: #515151;
|
|
||||||
color: #ccc;
|
|
||||||
}
|
|
||||||
.hljs-comment {
|
|
||||||
color: #999;
|
|
||||||
}
|
|
||||||
.hljs-tag {
|
|
||||||
color: #b4b7b4;
|
|
||||||
}
|
|
||||||
.hljs-operator,
|
|
||||||
.hljs-punctuation,
|
|
||||||
.hljs-subst {
|
|
||||||
color: #ccc;
|
|
||||||
}
|
|
||||||
.hljs-operator {
|
|
||||||
opacity: 0.7;
|
|
||||||
}
|
|
||||||
.hljs-bullet,
|
|
||||||
.hljs-deletion,
|
|
||||||
.hljs-name,
|
|
||||||
.hljs-selector-tag,
|
|
||||||
.hljs-template-variable,
|
|
||||||
.hljs-variable {
|
|
||||||
color: #f2777a;
|
|
||||||
}
|
|
||||||
.hljs-attr,
|
|
||||||
.hljs-link,
|
|
||||||
.hljs-literal,
|
|
||||||
.hljs-number,
|
|
||||||
.hljs-symbol,
|
|
||||||
.hljs-variable.constant_ {
|
|
||||||
color: #f99157;
|
|
||||||
}
|
|
||||||
.hljs-class .hljs-title,
|
|
||||||
.hljs-title,
|
|
||||||
.hljs-title.class_ {
|
|
||||||
color: #fc6;
|
|
||||||
}
|
|
||||||
.hljs-strong {
|
|
||||||
font-weight: 700;
|
|
||||||
color: #fc6;
|
|
||||||
}
|
|
||||||
.hljs-addition,
|
|
||||||
.hljs-code,
|
|
||||||
.hljs-string,
|
|
||||||
.hljs-title.class_.inherited__ {
|
|
||||||
color: #9c9;
|
|
||||||
}
|
|
||||||
.hljs-built_in,
|
|
||||||
.hljs-doctag,
|
|
||||||
.hljs-keyword.hljs-atrule,
|
|
||||||
.hljs-quote,
|
|
||||||
.hljs-regexp {
|
|
||||||
color: #6cc;
|
|
||||||
}
|
|
||||||
.hljs-attribute,
|
|
||||||
.hljs-function .hljs-title,
|
|
||||||
.hljs-section,
|
|
||||||
.hljs-title.function_,
|
|
||||||
.ruby .hljs-property {
|
|
||||||
color: #69c;
|
|
||||||
}
|
|
||||||
.diff .hljs-meta,
|
|
||||||
.hljs-keyword,
|
|
||||||
.hljs-template-tag,
|
|
||||||
.hljs-type {
|
|
||||||
color: #c9c;
|
|
||||||
}
|
|
||||||
.hljs-emphasis {
|
|
||||||
color: #c9c;
|
|
||||||
font-style: italic;
|
|
||||||
}
|
|
||||||
.hljs-meta,
|
|
||||||
.hljs-meta .hljs-keyword,
|
|
||||||
.hljs-meta .hljs-string {
|
|
||||||
color: #a3685a;
|
|
||||||
}
|
|
||||||
.hljs-meta .hljs-keyword,
|
|
||||||
.hljs-meta-keyword {
|
|
||||||
font-weight: 700;
|
|
||||||
}
|
|
||||||
}
|
|
312
docs/static/style.scss
vendored
312
docs/static/style.scss
vendored
|
@ -1,312 +0,0 @@
|
||||||
:root {
|
|
||||||
--nmd-color0: #0a3e68;
|
|
||||||
--nmd-color1: #268598;
|
|
||||||
--nmd-color2: #b8d09e;
|
|
||||||
--nmd-color3: #f6cf5e;
|
|
||||||
--nmd-color4: #ec733b;
|
|
||||||
|
|
||||||
--nmd-color-info: #167cb9;
|
|
||||||
--nmd-color-warn: #ff6700;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Copied from Tailwind CSS.
|
|
||||||
$color-gray-50: #f9fafb;
|
|
||||||
$color-gray-100: #f3f4f6;
|
|
||||||
$color-gray-200: #e5e7eb;
|
|
||||||
$color-gray-300: #d1d5db;
|
|
||||||
$color-gray-400: #9ca3af;
|
|
||||||
$color-gray-500: #6b7280;
|
|
||||||
$color-gray-600: #4b5563;
|
|
||||||
$color-gray-700: #374151;
|
|
||||||
$color-gray-800: #1f2937;
|
|
||||||
$color-gray-900: #111827;
|
|
||||||
|
|
||||||
$color-blue-50: #eff6ff;
|
|
||||||
$color-blue-100: #dbeafe;
|
|
||||||
$color-blue-200: #bfdbfe;
|
|
||||||
$color-blue-300: #93c5fd;
|
|
||||||
$color-blue-400: #60a5fa;
|
|
||||||
$color-blue-500: #3b82f6;
|
|
||||||
$color-blue-600: #2563eb;
|
|
||||||
$color-blue-700: #1d4ed8;
|
|
||||||
$color-blue-800: #1e40af;
|
|
||||||
$color-blue-900: #1e3a8a;
|
|
||||||
|
|
||||||
@use "scss-reset/reset";
|
|
||||||
|
|
||||||
@mixin boxed {
|
|
||||||
background: $color-gray-50;
|
|
||||||
margin: 2rem 16px;
|
|
||||||
padding: 10px;
|
|
||||||
border: 1px solid $color-gray-200;
|
|
||||||
border-radius: 4px;
|
|
||||||
box-shadow: 4px 4px 8px $color-gray-200;
|
|
||||||
|
|
||||||
@media (prefers-color-scheme: dark) {
|
|
||||||
background: $color-gray-800;
|
|
||||||
border-color: black;
|
|
||||||
box-shadow: 4px 4px 8px black;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@mixin margined {
|
|
||||||
margin: 0.9rem 0;
|
|
||||||
|
|
||||||
&:first-child {
|
|
||||||
margin-top: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:last-child {
|
|
||||||
margin-bottom: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
body {
|
|
||||||
background: white;
|
|
||||||
color: $color-gray-900;
|
|
||||||
max-width: min(100ch, 1024px);
|
|
||||||
margin: 0 auto;
|
|
||||||
padding: 10px;
|
|
||||||
|
|
||||||
font-family: "Lucida Sans", Arial, sans-serif;
|
|
||||||
font-size: 16px;
|
|
||||||
line-height: 1.4em;
|
|
||||||
|
|
||||||
@media (prefers-color-scheme: dark) {
|
|
||||||
background: $color-gray-900;
|
|
||||||
color: $color-gray-50;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
h1,
|
|
||||||
h2,
|
|
||||||
h3 {
|
|
||||||
color: var(--nmd-color0);
|
|
||||||
font-family: "Lato", sans-serif;
|
|
||||||
font-weight: 300;
|
|
||||||
line-height: 1.125;
|
|
||||||
|
|
||||||
@media (prefers-color-scheme: dark) {
|
|
||||||
color: var(--nmd-color4);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
h1 {
|
|
||||||
font-size: 48px;
|
|
||||||
font-weight: 300;
|
|
||||||
margin: 4rem 0 1.5rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
h2 {
|
|
||||||
font-size: 32px;
|
|
||||||
font-weight: 300;
|
|
||||||
margin: 2rem 0 1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
h3 {
|
|
||||||
font-size: 20px;
|
|
||||||
font-weight: 400;
|
|
||||||
margin: 0.5rem 0.25rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
p {
|
|
||||||
@include margined;
|
|
||||||
}
|
|
||||||
|
|
||||||
a {
|
|
||||||
color: var(--nmd-color0); //$color-secondary-1-3;
|
|
||||||
text-decoration: underline;
|
|
||||||
text-underline-offset: 3px;
|
|
||||||
|
|
||||||
&:visited {
|
|
||||||
color: var(--nmd-color1);
|
|
||||||
}
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
color: var(--nmd-color1);
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (prefers-color-scheme: dark) {
|
|
||||||
color: var(--nmd-color3);
|
|
||||||
|
|
||||||
&:visited {
|
|
||||||
color: var(--nmd-color2);
|
|
||||||
}
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
color: var(--nmd-color4);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
code {
|
|
||||||
font-size: 90%;
|
|
||||||
}
|
|
||||||
|
|
||||||
span.command {
|
|
||||||
font-size: 90%;
|
|
||||||
font-family: monospace;
|
|
||||||
}
|
|
||||||
|
|
||||||
em {
|
|
||||||
font-style: italic;
|
|
||||||
}
|
|
||||||
|
|
||||||
strong {
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
pre {
|
|
||||||
@include boxed;
|
|
||||||
|
|
||||||
font-size: 90%;
|
|
||||||
margin-bottom: 1.5rem;
|
|
||||||
padding: 6px;
|
|
||||||
overflow: auto;
|
|
||||||
|
|
||||||
// The callout markers should not be selectable.
|
|
||||||
span img {
|
|
||||||
user-select: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pre:has(code) {
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
td,
|
|
||||||
th {
|
|
||||||
padding: 2px 5px;
|
|
||||||
|
|
||||||
&:first-child {
|
|
||||||
padding-left: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:last-child {
|
|
||||||
padding-right: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
dt {
|
|
||||||
margin: 1.2rem 0 0.8rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
dd {
|
|
||||||
margin-left: 2rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.book {
|
|
||||||
}
|
|
||||||
|
|
||||||
ul {
|
|
||||||
@include margined;
|
|
||||||
|
|
||||||
padding-left: 30px;
|
|
||||||
list-style: disc;
|
|
||||||
}
|
|
||||||
|
|
||||||
ol {
|
|
||||||
@include margined;
|
|
||||||
|
|
||||||
padding-left: 30px;
|
|
||||||
list-style: decimal;
|
|
||||||
}
|
|
||||||
|
|
||||||
li {
|
|
||||||
@include margined;
|
|
||||||
|
|
||||||
padding-left: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.navheader,
|
|
||||||
.navfooter {
|
|
||||||
hr {
|
|
||||||
margin: 1rem 0;
|
|
||||||
background: $color-gray-200;
|
|
||||||
@media (prefers-color-scheme: dark) {
|
|
||||||
background: $color-gray-600;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
a {
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
div.titlepage {
|
|
||||||
margin: 40px 0;
|
|
||||||
|
|
||||||
hr {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
div.toc {
|
|
||||||
@include boxed;
|
|
||||||
|
|
||||||
a {
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
div.note,
|
|
||||||
div.warning {
|
|
||||||
@include boxed;
|
|
||||||
|
|
||||||
font-style: italic;
|
|
||||||
|
|
||||||
h3 {
|
|
||||||
float: right;
|
|
||||||
margin: 0 0 1rem 1rem;
|
|
||||||
width: 42px;
|
|
||||||
height: 42px;
|
|
||||||
content: url();
|
|
||||||
}
|
|
||||||
|
|
||||||
h3 + p {
|
|
||||||
margin-top: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
div.note {
|
|
||||||
h3 {
|
|
||||||
background-color: var(--nmd-color-info);
|
|
||||||
// From https://tabler-icons.io/i/info-square-rounded
|
|
||||||
mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='42' height='42' viewBox='0 0 24 24' stroke-width='2' stroke='black' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'%3E%3C/path%3E%3Cpath d='M12 8h.01'%3E%3C/path%3E%3Cpath d='M11 12h1v4h1'%3E%3C/path%3E%3Cpath d='M12 3c7.2 0 9 1.8 9 9s-1.8 9 -9 9s-9 -1.8 -9 -9s1.8 -9 9 -9z'%3E%3C/path%3E%3C/svg%3E");
|
|
||||||
-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='42' height='42' viewBox='0 0 24 24' stroke-width='2' stroke='black' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'%3E%3C/path%3E%3Cpath d='M12 8h.01'%3E%3C/path%3E%3Cpath d='M11 12h1v4h1'%3E%3C/path%3E%3Cpath d='M12 3c7.2 0 9 1.8 9 9s-1.8 9 -9 9s-9 -1.8 -9 -9s1.8 -9 9 -9z'%3E%3C/path%3E%3C/svg%3E");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
div.warning {
|
|
||||||
h3 {
|
|
||||||
background-color: var(--nmd-color-warn);
|
|
||||||
// From https://tabler-icons.io/i/alert-triangle
|
|
||||||
mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='42' height='42' viewBox='0 0 24 24' stroke-width='2' stroke='black' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'%3E%3C/path%3E%3Cpath d='M12 9v2m0 4v.01'%3E%3C/path%3E%3Cpath d='M5 19h14a2 2 0 0 0 1.84 -2.75l-7.1 -12.25a2 2 0 0 0 -3.5 0l-7.1 12.25a2 2 0 0 0 1.75 2.75'%3E%3C/path%3E%3C/svg%3E");
|
|
||||||
-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='42' height='42' viewBox='0 0 24 24' stroke-width='2' stroke='black' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'%3E%3C/path%3E%3Cpath d='M12 9v2m0 4v.01'%3E%3C/path%3E%3Cpath d='M5 19h14a2 2 0 0 0 1.84 -2.75l-7.1 -12.25a2 2 0 0 0 -3.5 0l-7.1 12.25a2 2 0 0 0 1.75 2.75'%3E%3C/path%3E%3C/svg%3E");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.term {
|
|
||||||
font-weight: 300;
|
|
||||||
}
|
|
||||||
|
|
||||||
.docbook .xref img[src^="images\/callouts\/"],
|
|
||||||
.screen img,
|
|
||||||
.programlisting img {
|
|
||||||
width: 1em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.calloutlist img {
|
|
||||||
width: 1.3em;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** The console prompt, e.g., `$` and `#` should not be selectable. */
|
|
||||||
.programlisting.language-shell .hljs-meta.prompt_ {
|
|
||||||
user-select: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
@import "tomorrow.min.css";
|
|
||||||
|
|
||||||
@media (prefers-color-scheme: dark) {
|
|
||||||
@import "tomorrow-night.min.css";
|
|
||||||
}
|
|
102
docs/static/tomorrow-night.min.css
vendored
102
docs/static/tomorrow-night.min.css
vendored
|
@ -1,102 +0,0 @@
|
||||||
/*!
|
|
||||||
Theme: Tomorrow Night
|
|
||||||
Author: Chris Kempson (http://chriskempson.com)
|
|
||||||
License: ~ MIT (or more permissive) [via base16-schemes-source]
|
|
||||||
Maintainer: @highlightjs/core-team
|
|
||||||
Version: 2021.09.0
|
|
||||||
*/
|
|
||||||
pre code.hljs {
|
|
||||||
display: block;
|
|
||||||
overflow-x: auto;
|
|
||||||
padding: 1em;
|
|
||||||
}
|
|
||||||
code.hljs {
|
|
||||||
padding: 3px 5px;
|
|
||||||
}
|
|
||||||
.hljs {
|
|
||||||
color: #ccc;
|
|
||||||
background: #2d2d2d;
|
|
||||||
}
|
|
||||||
.hljs ::selection,
|
|
||||||
.hljs::selection {
|
|
||||||
background-color: #515151;
|
|
||||||
color: #ccc;
|
|
||||||
}
|
|
||||||
.hljs-comment {
|
|
||||||
color: #999;
|
|
||||||
}
|
|
||||||
.hljs-tag {
|
|
||||||
color: #b4b7b4;
|
|
||||||
}
|
|
||||||
.hljs-operator,
|
|
||||||
.hljs-punctuation,
|
|
||||||
.hljs-subst {
|
|
||||||
color: #ccc;
|
|
||||||
}
|
|
||||||
.hljs-operator {
|
|
||||||
opacity: 0.7;
|
|
||||||
}
|
|
||||||
.hljs-bullet,
|
|
||||||
.hljs-deletion,
|
|
||||||
.hljs-name,
|
|
||||||
.hljs-selector-tag,
|
|
||||||
.hljs-template-variable,
|
|
||||||
.hljs-variable {
|
|
||||||
color: #f2777a;
|
|
||||||
}
|
|
||||||
.hljs-attr,
|
|
||||||
.hljs-link,
|
|
||||||
.hljs-literal,
|
|
||||||
.hljs-number,
|
|
||||||
.hljs-symbol,
|
|
||||||
.hljs-variable.constant_ {
|
|
||||||
color: #f99157;
|
|
||||||
}
|
|
||||||
.hljs-class .hljs-title,
|
|
||||||
.hljs-title,
|
|
||||||
.hljs-title.class_ {
|
|
||||||
color: #fc6;
|
|
||||||
}
|
|
||||||
.hljs-strong {
|
|
||||||
font-weight: 700;
|
|
||||||
color: #fc6;
|
|
||||||
}
|
|
||||||
.hljs-addition,
|
|
||||||
.hljs-code,
|
|
||||||
.hljs-string,
|
|
||||||
.hljs-title.class_.inherited__ {
|
|
||||||
color: #9c9;
|
|
||||||
}
|
|
||||||
.hljs-built_in,
|
|
||||||
.hljs-doctag,
|
|
||||||
.hljs-keyword.hljs-atrule,
|
|
||||||
.hljs-quote,
|
|
||||||
.hljs-regexp {
|
|
||||||
color: #6cc;
|
|
||||||
}
|
|
||||||
.hljs-attribute,
|
|
||||||
.hljs-function .hljs-title,
|
|
||||||
.hljs-section,
|
|
||||||
.hljs-title.function_,
|
|
||||||
.ruby .hljs-property {
|
|
||||||
color: #69c;
|
|
||||||
}
|
|
||||||
.diff .hljs-meta,
|
|
||||||
.hljs-keyword,
|
|
||||||
.hljs-template-tag,
|
|
||||||
.hljs-type {
|
|
||||||
color: #c9c;
|
|
||||||
}
|
|
||||||
.hljs-emphasis {
|
|
||||||
color: #c9c;
|
|
||||||
font-style: italic;
|
|
||||||
}
|
|
||||||
.hljs-meta,
|
|
||||||
.hljs-meta .hljs-keyword,
|
|
||||||
.hljs-meta .hljs-string {
|
|
||||||
color: #a3685a;
|
|
||||||
}
|
|
||||||
.hljs-meta .hljs-keyword,
|
|
||||||
.hljs-meta-keyword {
|
|
||||||
font-weight: 700;
|
|
||||||
}
|
|
102
docs/static/tomorrow.min.css
vendored
102
docs/static/tomorrow.min.css
vendored
|
@ -1,102 +0,0 @@
|
||||||
/*!
|
|
||||||
Theme: Tomorrow
|
|
||||||
Author: Chris Kempson (http://chriskempson.com)
|
|
||||||
License: ~ MIT (or more permissive) [via base16-schemes-source]
|
|
||||||
Maintainer: @highlightjs/core-team
|
|
||||||
Version: 2021.09.0
|
|
||||||
*/
|
|
||||||
pre code.hljs {
|
|
||||||
display: block;
|
|
||||||
overflow-x: auto;
|
|
||||||
padding: 1em;
|
|
||||||
}
|
|
||||||
code.hljs {
|
|
||||||
padding: 3px 5px;
|
|
||||||
}
|
|
||||||
.hljs {
|
|
||||||
color: #4d4d4c;
|
|
||||||
background: #fff;
|
|
||||||
}
|
|
||||||
.hljs ::selection,
|
|
||||||
.hljs::selection {
|
|
||||||
background-color: #d6d6d6;
|
|
||||||
color: #4d4d4c;
|
|
||||||
}
|
|
||||||
.hljs-comment {
|
|
||||||
color: #8e908c;
|
|
||||||
}
|
|
||||||
.hljs-tag {
|
|
||||||
color: #969896;
|
|
||||||
}
|
|
||||||
.hljs-operator,
|
|
||||||
.hljs-punctuation,
|
|
||||||
.hljs-subst {
|
|
||||||
color: #4d4d4c;
|
|
||||||
}
|
|
||||||
.hljs-operator {
|
|
||||||
opacity: 0.7;
|
|
||||||
}
|
|
||||||
.hljs-bullet,
|
|
||||||
.hljs-deletion,
|
|
||||||
.hljs-name,
|
|
||||||
.hljs-selector-tag,
|
|
||||||
.hljs-template-variable,
|
|
||||||
.hljs-variable {
|
|
||||||
color: #c82829;
|
|
||||||
}
|
|
||||||
.hljs-attr,
|
|
||||||
.hljs-link,
|
|
||||||
.hljs-literal,
|
|
||||||
.hljs-number,
|
|
||||||
.hljs-symbol,
|
|
||||||
.hljs-variable.constant_ {
|
|
||||||
color: #f5871f;
|
|
||||||
}
|
|
||||||
.hljs-class .hljs-title,
|
|
||||||
.hljs-title,
|
|
||||||
.hljs-title.class_ {
|
|
||||||
color: #eab700;
|
|
||||||
}
|
|
||||||
.hljs-strong {
|
|
||||||
font-weight: 700;
|
|
||||||
color: #eab700;
|
|
||||||
}
|
|
||||||
.hljs-addition,
|
|
||||||
.hljs-code,
|
|
||||||
.hljs-string,
|
|
||||||
.hljs-title.class_.inherited__ {
|
|
||||||
color: #718c00;
|
|
||||||
}
|
|
||||||
.hljs-built_in,
|
|
||||||
.hljs-doctag,
|
|
||||||
.hljs-keyword.hljs-atrule,
|
|
||||||
.hljs-quote,
|
|
||||||
.hljs-regexp {
|
|
||||||
color: #3e999f;
|
|
||||||
}
|
|
||||||
.hljs-attribute,
|
|
||||||
.hljs-function .hljs-title,
|
|
||||||
.hljs-section,
|
|
||||||
.hljs-title.function_,
|
|
||||||
.ruby .hljs-property {
|
|
||||||
color: #4271ae;
|
|
||||||
}
|
|
||||||
.diff .hljs-meta,
|
|
||||||
.hljs-keyword,
|
|
||||||
.hljs-template-tag,
|
|
||||||
.hljs-type {
|
|
||||||
color: #8959a8;
|
|
||||||
}
|
|
||||||
.hljs-emphasis {
|
|
||||||
color: #8959a8;
|
|
||||||
font-style: italic;
|
|
||||||
}
|
|
||||||
.hljs-meta,
|
|
||||||
.hljs-meta .hljs-keyword,
|
|
||||||
.hljs-meta .hljs-string {
|
|
||||||
color: #a3685a;
|
|
||||||
}
|
|
||||||
.hljs-meta .hljs-keyword,
|
|
||||||
.hljs-meta-keyword {
|
|
||||||
font-weight: 700;
|
|
||||||
}
|
|
2503
flake.lock
2503
flake.lock
File diff suppressed because it is too large
Load diff
457
flake.nix
457
flake.nix
|
@ -22,38 +22,18 @@
|
||||||
|
|
||||||
flake = {
|
flake = {
|
||||||
lib = {
|
lib = {
|
||||||
inherit (import ./lib/stdlib-extended.nix nixpkgs.lib inputs) nvim;
|
inherit (import ./lib/stdlib-extended.nix nixpkgs.lib) nvim;
|
||||||
inherit (import ./configuration.nix inputs) neovimConfiguration;
|
inherit (import ./configuration.nix inputs) neovimConfiguration;
|
||||||
};
|
};
|
||||||
|
|
||||||
homeManagerModules = {
|
homeManagerModules = {
|
||||||
neovim-flake =
|
neovim-flake = {
|
||||||
nixpkgs.lib.warn ''
|
imports = [
|
||||||
homeManagerModules.neovim-flake has been deprecated.
|
(import ./lib/module self.packages inputs)
|
||||||
Plese use the homeManagereModules.nvf instead
|
];
|
||||||
''
|
|
||||||
self.homeManagerModules.nvf;
|
|
||||||
|
|
||||||
nvf = {
|
|
||||||
imports = [(import ./flake/modules/home-manager.nix self.packages inputs)];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
default = self.homeManagerModules.nvf;
|
default = self.homeManagerModules.neovim-flake;
|
||||||
};
|
|
||||||
|
|
||||||
nixosModules = {
|
|
||||||
neovim-flake =
|
|
||||||
nixpkgs.lib.warn ''
|
|
||||||
nixosModules.neovim-flake has been deprecated.
|
|
||||||
Please use the nixosModules.nvf instead
|
|
||||||
''
|
|
||||||
self.nixosModules.neovim-flake;
|
|
||||||
|
|
||||||
nvf = {
|
|
||||||
imports = [(import ./flake/modules/nixos.nix self.packages inputs)];
|
|
||||||
};
|
|
||||||
|
|
||||||
default = self.nixosModules.nvf;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -68,7 +48,7 @@
|
||||||
default = self'.devShells.lsp;
|
default = self'.devShells.lsp;
|
||||||
nvim-nix = pkgs.mkShell {nativeBuildInputs = [config.packages.nix];};
|
nvim-nix = pkgs.mkShell {nativeBuildInputs = [config.packages.nix];};
|
||||||
lsp = pkgs.mkShell {
|
lsp = pkgs.mkShell {
|
||||||
nativeBuildInputs = with pkgs; [nil statix deadnix alejandra];
|
nativeBuildInputs = with pkgs; [nil statix deadnix];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -90,6 +70,123 @@
|
||||||
# TODO: get zig from the zig overlay instead of nixpkgs
|
# TODO: get zig from the zig overlay instead of nixpkgs
|
||||||
zig.url = "github:mitchellh/zig-overlay";
|
zig.url = "github:mitchellh/zig-overlay";
|
||||||
|
|
||||||
|
# LSP plugins
|
||||||
|
nvim-lspconfig = {
|
||||||
|
# url = "github:neovim/nvim-lspconfig?ref=v0.1.3";
|
||||||
|
# Use master for nil_ls
|
||||||
|
url = "github:neovim/nvim-lspconfig";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
lspsaga = {
|
||||||
|
url = "github:tami5/lspsaga.nvim";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
lspkind = {
|
||||||
|
url = "github:onsails/lspkind-nvim";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
trouble = {
|
||||||
|
url = "github:folke/trouble.nvim";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
nvim-treesitter-context = {
|
||||||
|
url = "github:nvim-treesitter/nvim-treesitter-context";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
nvim-lightbulb = {
|
||||||
|
url = "github:kosayoda/nvim-lightbulb";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
nvim-code-action-menu = {
|
||||||
|
url = "github:weilbith/nvim-code-action-menu";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
lsp-signature = {
|
||||||
|
url = "github:ray-x/lsp_signature.nvim";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
lsp-lines = {
|
||||||
|
url = "sourcehut:~whynothugo/lsp_lines.nvim";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
none-ls = {
|
||||||
|
url = "github:nvimtools/none-ls.nvim";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
nvim-docs-view = {
|
||||||
|
url = "github:amrbashir/nvim-docs-view";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
# language support
|
||||||
|
sqls-nvim = {
|
||||||
|
url = "github:nanotee/sqls.nvim";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
rust-tools = {
|
||||||
|
url = "github:simrat39/rust-tools.nvim";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
flutter-tools = {
|
||||||
|
url = "github:akinsho/flutter-tools.nvim";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
neodev-nvim = {
|
||||||
|
url = "github:folke/neodev.nvim";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
elixir-ls = {
|
||||||
|
url = "github:elixir-lsp/elixir-ls";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
elixir-tools = {
|
||||||
|
url = "github:elixir-tools/elixir-tools.nvim";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
glow-nvim = {
|
||||||
|
url = "github:ellisonleao/glow.nvim";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
# Tidal cycles
|
||||||
|
tidalcycles = {
|
||||||
|
url = "github:mitchmindtree/tidalcycles.nix";
|
||||||
|
inputs.vim-tidal-src.url = "github:tidalcycles/vim-tidal";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Copying/Registers
|
||||||
|
registers = {
|
||||||
|
url = "github:tversteeg/registers.nvim";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
nvim-neoclip = {
|
||||||
|
url = "github:AckslD/nvim-neoclip.lua";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
# Telescope
|
||||||
|
telescope = {
|
||||||
|
url = "github:nvim-telescope/telescope.nvim";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
|
||||||
# Langauge server (use master instead of nixpkgs)
|
# 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 = {
|
||||||
|
@ -98,532 +195,396 @@
|
||||||
inputs.flake-utils.follows = "flake-utils";
|
inputs.flake-utils.follows = "flake-utils";
|
||||||
};
|
};
|
||||||
|
|
||||||
### Plugins
|
|
||||||
# Tidal cycles
|
|
||||||
tidalcycles = {
|
|
||||||
url = "github:mitchmindtree/tidalcycles.nix";
|
|
||||||
inputs.vim-tidal-src.url = "github:tidalcycles/vim-tidal";
|
|
||||||
};
|
|
||||||
|
|
||||||
# LSP plugins
|
|
||||||
plugin-nvim-lspconfig = {
|
|
||||||
url = "github:neovim/nvim-lspconfig";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-lspsaga = {
|
|
||||||
url = "github:tami5/lspsaga.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-lspkind = {
|
|
||||||
url = "github:onsails/lspkind-nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-trouble = {
|
|
||||||
url = "github:folke/trouble.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-nvim-treesitter-context = {
|
|
||||||
url = "github:nvim-treesitter/nvim-treesitter-context";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-nvim-lightbulb = {
|
|
||||||
url = "github:kosayoda/nvim-lightbulb";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-nvim-code-action-menu = {
|
|
||||||
url = "github:weilbith/nvim-code-action-menu";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-lsp-signature = {
|
|
||||||
url = "github:ray-x/lsp_signature.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-lsp-lines = {
|
|
||||||
url = "sourcehut:~whynothugo/lsp_lines.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-none-ls = {
|
|
||||||
# https://github.com/nvimtools/none-ls.nvim/issues/58
|
|
||||||
url = "github:nvimtools/none-ls.nvim/bb680d752cec37949faca7a1f509e2fe67ab418a";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-nvim-docs-view = {
|
|
||||||
url = "github:amrbashir/nvim-docs-view";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
# language support
|
|
||||||
plugin-sqls-nvim = {
|
|
||||||
url = "github:nanotee/sqls.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-rust-tools = {
|
|
||||||
url = "github:simrat39/rust-tools.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-flutter-tools = {
|
|
||||||
url = "github:akinsho/flutter-tools.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-neodev-nvim = {
|
|
||||||
url = "github:folke/neodev.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-elixir-ls = {
|
|
||||||
url = "github:elixir-lsp/elixir-ls";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-elixir-tools = {
|
|
||||||
url = "github:elixir-tools/elixir-tools.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-glow-nvim = {
|
|
||||||
url = "github:ellisonleao/glow.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-image-nvim = {
|
|
||||||
url = "github:3rd/image.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Copying/Registers
|
|
||||||
plugin-registers = {
|
|
||||||
url = "github:tversteeg/registers.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-nvim-neoclip = {
|
|
||||||
url = "github:AckslD/nvim-neoclip.lua";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Telescope
|
|
||||||
plugin-telescope = {
|
|
||||||
url = "github:nvim-telescope/telescope.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Debuggers
|
# Debuggers
|
||||||
plugin-nvim-dap = {
|
nvim-dap = {
|
||||||
url = "github:mfussenegger/nvim-dap";
|
url = "github:mfussenegger/nvim-dap";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
plugin-nvim-dap-ui = {
|
nvim-dap-ui = {
|
||||||
url = "github:rcarriga/nvim-dap-ui";
|
url = "github:rcarriga/nvim-dap-ui";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Filetrees
|
# Filetrees
|
||||||
plugin-nvim-tree-lua = {
|
nvim-tree-lua = {
|
||||||
url = "github:nvim-tree/nvim-tree.lua";
|
url = "github:nvim-tree/nvim-tree.lua";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Tablines
|
# Tablines
|
||||||
plugin-nvim-bufferline-lua = {
|
nvim-bufferline-lua = {
|
||||||
url = "github:akinsho/nvim-bufferline.lua";
|
url = "github:akinsho/nvim-bufferline.lua";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Statuslines
|
# Statuslines
|
||||||
plugin-lualine = {
|
lualine = {
|
||||||
url = "github:hoob3rt/lualine.nvim";
|
url = "github:hoob3rt/lualine.nvim";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
plugin-nvim-cmp = {
|
# Autocompletes
|
||||||
|
nvim-compe = {
|
||||||
|
url = "github:hrsh7th/nvim-compe";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
nvim-cmp = {
|
||||||
url = "github:hrsh7th/nvim-cmp";
|
url = "github:hrsh7th/nvim-cmp";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
cmp-buffer = {
|
||||||
plugin-cmp-buffer = {
|
|
||||||
url = "github:hrsh7th/cmp-buffer";
|
url = "github:hrsh7th/cmp-buffer";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
cmp-nvim-lsp = {
|
||||||
plugin-cmp-nvim-lsp = {
|
|
||||||
url = "github:hrsh7th/cmp-nvim-lsp";
|
url = "github:hrsh7th/cmp-nvim-lsp";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
cmp-vsnip = {
|
||||||
plugin-cmp-vsnip = {
|
|
||||||
url = "github:hrsh7th/cmp-vsnip";
|
url = "github:hrsh7th/cmp-vsnip";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
cmp-path = {
|
||||||
plugin-cmp-path = {
|
|
||||||
url = "github:hrsh7th/cmp-path";
|
url = "github:hrsh7th/cmp-path";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
cmp-treesitter = {
|
||||||
plugin-cmp-treesitter = {
|
|
||||||
url = "github:ray-x/cmp-treesitter";
|
url = "github:ray-x/cmp-treesitter";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
# snippets
|
# snippets
|
||||||
plugin-vim-vsnip = {
|
vim-vsnip = {
|
||||||
url = "github:hrsh7th/vim-vsnip";
|
url = "github:hrsh7th/vim-vsnip";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Presence
|
# Presence
|
||||||
plugin-neocord = {
|
neocord = {
|
||||||
url = "github:IogaMaster/neocord";
|
url = "github:IogaMaster/neocord";
|
||||||
flake = false; # uses flake-utils, avoid the flake
|
flake = false; # uses flake-utils, avoid the flake
|
||||||
};
|
};
|
||||||
|
|
||||||
# Autopairs
|
# Autopairs
|
||||||
plugin-nvim-autopairs = {
|
nvim-autopairs = {
|
||||||
url = "github:windwp/nvim-autopairs";
|
url = "github:windwp/nvim-autopairs";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
nvim-ts-autotag = {
|
||||||
plugin-nvim-ts-autotag = {
|
|
||||||
url = "github:windwp/nvim-ts-autotag";
|
url = "github:windwp/nvim-ts-autotag";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Commenting
|
# Commenting
|
||||||
plugin-comment-nvim = {
|
kommentary = {
|
||||||
|
url = "github:b3nj5m1n/kommentary";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
comment-nvim = {
|
||||||
url = "github:numToStr/Comment.nvim";
|
url = "github:numToStr/Comment.nvim";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
plugin-todo-comments = {
|
todo-comments = {
|
||||||
url = "github:folke/todo-comments.nvim";
|
url = "github:folke/todo-comments.nvim";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Buffer tools
|
# Buffer tools
|
||||||
plugin-bufdelete-nvim = {
|
bufdelete-nvim = {
|
||||||
url = "github:famiu/bufdelete.nvim";
|
url = "github:famiu/bufdelete.nvim";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Dashboard Utilities
|
# Dashboard Utilities
|
||||||
plugin-dashboard-nvim = {
|
dashboard-nvim = {
|
||||||
url = "github:glepnir/dashboard-nvim";
|
url = "github:glepnir/dashboard-nvim";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
plugin-alpha-nvim = {
|
alpha-nvim = {
|
||||||
url = "github:goolord/alpha-nvim";
|
url = "github:goolord/alpha-nvim";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
plugin-vim-startify = {
|
vim-startify = {
|
||||||
url = "github:mhinz/vim-startify";
|
url = "github:mhinz/vim-startify";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Themes
|
# Themes
|
||||||
plugin-tokyonight = {
|
tokyonight = {
|
||||||
url = "github:folke/tokyonight.nvim";
|
url = "github:folke/tokyonight.nvim";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
plugin-onedark = {
|
onedark = {
|
||||||
url = "github:navarasu/onedark.nvim";
|
url = "github:navarasu/onedark.nvim";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
plugin-catppuccin = {
|
catppuccin = {
|
||||||
url = "github:catppuccin/nvim";
|
url = "github:catppuccin/nvim";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
plugin-dracula = {
|
dracula = {
|
||||||
url = "github:Mofiqul/dracula.nvim";
|
url = "github:Mofiqul/dracula.nvim";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
plugin-oxocarbon = {
|
oxocarbon = {
|
||||||
url = "github:nyoom-engineering/oxocarbon.nvim";
|
url = "github:glyh/oxocarbon.nvim/lualine-support";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
plugin-gruvbox = {
|
gruvbox = {
|
||||||
url = "github:ellisonleao/gruvbox.nvim";
|
url = "github:ellisonleao/gruvbox.nvim";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
plugin-rose-pine = {
|
rose-pine = {
|
||||||
url = "github:rose-pine/neovim";
|
url = "github:rose-pine/neovim";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Rust crates
|
# Rust crates
|
||||||
plugin-crates-nvim = {
|
crates-nvim = {
|
||||||
url = "github:Saecki/crates.nvim";
|
url = "github:Saecki/crates.nvim";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Project Management
|
# Project Management
|
||||||
plugin-project-nvim = {
|
project-nvim = {
|
||||||
url = "github:ahmedkhalf/project.nvim";
|
url = "github:ahmedkhalf/project.nvim";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Visuals
|
# Visuals
|
||||||
plugin-nvim-cursorline = {
|
nvim-cursorline = {
|
||||||
url = "github:yamatsum/nvim-cursorline";
|
url = "github:yamatsum/nvim-cursorline";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
plugin-scrollbar-nvim = {
|
scrollbar-nvim = {
|
||||||
url = "github:petertriho/nvim-scrollbar";
|
url = "github:petertriho/nvim-scrollbar";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
plugin-cinnamon-nvim = {
|
cinnamon-nvim = {
|
||||||
url = "github:declancm/cinnamon.nvim";
|
url = "github:declancm/cinnamon.nvim";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
plugin-cellular-automaton = {
|
cellular-automaton = {
|
||||||
url = "github:Eandrju/cellular-automaton.nvim";
|
url = "github:Eandrju/cellular-automaton.nvim";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
plugin-indent-blankline = {
|
indent-blankline = {
|
||||||
url = "github:lukas-reineke/indent-blankline.nvim";
|
url = "github:lukas-reineke/indent-blankline.nvim";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
nvim-web-devicons = {
|
||||||
plugin-nvim-web-devicons = {
|
|
||||||
url = "github:nvim-tree/nvim-web-devicons";
|
url = "github:nvim-tree/nvim-web-devicons";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
gitsigns-nvim = {
|
||||||
plugin-gitsigns-nvim = {
|
|
||||||
url = "github:lewis6991/gitsigns.nvim";
|
url = "github:lewis6991/gitsigns.nvim";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
plugin-vim-fugitive = {
|
fidget-nvim = {
|
||||||
url = "github:tpope/vim-fugitive";
|
url = "github:j-hui/fidget.nvim?ref=legacy";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
plugin-fidget-nvim = {
|
highlight-undo = {
|
||||||
url = "github:j-hui/fidget.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-highlight-undo = {
|
|
||||||
url = "github:tzachar/highlight-undo.nvim";
|
url = "github:tzachar/highlight-undo.nvim";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Minimap
|
# Minimap
|
||||||
plugin-minimap-vim = {
|
minimap-vim = {
|
||||||
url = "github:wfxr/minimap.vim";
|
url = "github:wfxr/minimap.vim";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
plugin-codewindow-nvim = {
|
codewindow-nvim = {
|
||||||
url = "github:gorbit99/codewindow.nvim";
|
url = "github:gorbit99/codewindow.nvim";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Notifications
|
# Notifications
|
||||||
plugin-nvim-notify = {
|
nvim-notify = {
|
||||||
url = "github:rcarriga/nvim-notify";
|
url = "github:rcarriga/nvim-notify";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Utilities
|
# Utilities
|
||||||
plugin-ccc = {
|
ccc = {
|
||||||
url = "github:uga-rosa/ccc.nvim";
|
url = "github:uga-rosa/ccc.nvim";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
plugin-diffview-nvim = {
|
diffview-nvim = {
|
||||||
url = "github:sindrets/diffview.nvim";
|
url = "github:sindrets/diffview.nvim";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
plugin-icon-picker-nvim = {
|
icon-picker-nvim = {
|
||||||
url = "github:ziontee113/icon-picker.nvim";
|
url = "github:ziontee113/icon-picker.nvim";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
plugin-which-key = {
|
which-key = {
|
||||||
url = "github:folke/which-key.nvim";
|
url = "github:folke/which-key.nvim";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
plugin-cheatsheet-nvim = {
|
cheatsheet-nvim = {
|
||||||
url = "github:sudormrfbin/cheatsheet.nvim";
|
url = "github:sudormrfbin/cheatsheet.nvim";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
plugin-gesture-nvim = {
|
gesture-nvim = {
|
||||||
url = "github:notomo/gesture.nvim";
|
url = "github:notomo/gesture.nvim";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
plugin-hop-nvim = {
|
hop-nvim = {
|
||||||
url = "github:phaazon/hop.nvim";
|
url = "github:phaazon/hop.nvim";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
plugin-leap-nvim = {
|
leap-nvim = {
|
||||||
url = "github:ggandor/leap.nvim";
|
url = "github:ggandor/leap.nvim";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
plugin-smartcolumn = {
|
smartcolumn = {
|
||||||
url = "github:m4xshen/smartcolumn.nvim";
|
url = "github:m4xshen/smartcolumn.nvim";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
plugin-nvim-surround = {
|
nvim-surround = {
|
||||||
url = "github:kylechui/nvim-surround";
|
url = "github:kylechui/nvim-surround";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Note-taking
|
# Note-taking
|
||||||
plugin-obsidian-nvim = {
|
obsidian-nvim = {
|
||||||
url = "github:epwalsh/obsidian.nvim";
|
url = "github:epwalsh/obsidian.nvim";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
plugin-orgmode-nvim = {
|
orgmode-nvim = {
|
||||||
url = "github:nvim-orgmode/orgmode";
|
url = "github:nvim-orgmode/orgmode";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
plugin-mind-nvim = {
|
mind-nvim = {
|
||||||
url = "github:phaazon/mind.nvim";
|
url = "github:phaazon/mind.nvim";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Spellchecking
|
# Spellchecking
|
||||||
plugin-vim-dirtytalk = {
|
vim-dirtytalk = {
|
||||||
url = "github:psliwka/vim-dirtytalk";
|
url = "github:psliwka/vim-dirtytalk";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Terminal
|
# Terminal
|
||||||
plugin-toggleterm-nvim = {
|
toggleterm-nvim = {
|
||||||
url = "github:akinsho/toggleterm.nvim";
|
url = "github:akinsho/toggleterm.nvim";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
# UI
|
# UI
|
||||||
plugin-nvim-navbuddy = {
|
nvim-navbuddy = {
|
||||||
url = "github:SmiteshP/nvim-navbuddy";
|
url = "github:SmiteshP/nvim-navbuddy";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
plugin-nvim-navic = {
|
nvim-navic = {
|
||||||
url = "github:SmiteshP/nvim-navic";
|
url = "github:SmiteshP/nvim-navic";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
plugin-noice-nvim = {
|
noice-nvim = {
|
||||||
url = "github:folke/noice.nvim";
|
url = "github:folke/noice.nvim";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
plugin-modes-nvim = {
|
modes-nvim = {
|
||||||
url = "github:mvllow/modes.nvim";
|
url = "github:mvllow/modes.nvim";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
plugin-nvim-colorizer-lua = {
|
nvim-colorizer-lua = {
|
||||||
url = "github:NvChad/nvim-colorizer.lua";
|
url = "github:NvChad/nvim-colorizer.lua";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
plugin-vim-illuminate = {
|
vim-illuminate = {
|
||||||
url = "github:RRethy/vim-illuminate";
|
url = "github:RRethy/vim-illuminate";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Assistant
|
# Assistant
|
||||||
plugin-chatgpt = {
|
copilot-lua = {
|
||||||
url = "github:jackMort/ChatGPT.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
plugin-copilot-lua = {
|
|
||||||
url = "github:zbirenbaum/copilot.lua";
|
url = "github:zbirenbaum/copilot.lua";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
plugin-copilot-cmp = {
|
copilot-cmp = {
|
||||||
url = "github:zbirenbaum/copilot-cmp";
|
url = "github:zbirenbaum/copilot-cmp";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Session management
|
# Session management
|
||||||
plugin-nvim-session-manager = {
|
nvim-session-manager = {
|
||||||
url = "github:Shatur/neovim-session-manager";
|
url = "github:Shatur/neovim-session-manager";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Dependencies
|
# Dependencies
|
||||||
plugin-plenary-nvim = {
|
plenary-nvim = {
|
||||||
# (required by crates-nvim)
|
# (required by crates-nvim)
|
||||||
url = "github:nvim-lua/plenary.nvim";
|
url = "github:nvim-lua/plenary.nvim";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
plugin-dressing-nvim = {
|
dressing-nvim = {
|
||||||
# (required by icon-picker-nvim)
|
# (required by icon-picker-nvim)
|
||||||
url = "github:stevearc/dressing.nvim";
|
url = "github:stevearc/dressing.nvim";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
plugin-vim-markdown = {
|
vim-markdown = {
|
||||||
# (required by obsidian-nvim)
|
# (required by obsidian-nvim)
|
||||||
url = "github:preservim/vim-markdown";
|
url = "github:preservim/vim-markdown";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
plugin-tabular = {
|
tabular = {
|
||||||
# (required by vim-markdown)
|
# (required by vim-markdown)
|
||||||
url = "github:godlygeek/tabular";
|
url = "github:godlygeek/tabular";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
plugin-nui-nvim = {
|
nui-nvim = {
|
||||||
# (required by noice.nvim)
|
# (required by noice.nvim)
|
||||||
url = "github:MunifTanjim/nui.nvim";
|
url = "github:MunifTanjim/nui.nvim";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
plugin-vim-repeat = {
|
vim-repeat = {
|
||||||
# (required by leap.nvim)
|
|
||||||
url = "github:tpope/vim-repeat";
|
url = "github:tpope/vim-repeat";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
plugin-nvim-nio = {
|
|
||||||
# (required nvim-dap-ui)
|
|
||||||
url = "github:nvim-neotest/nvim-nio";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,87 +0,0 @@
|
||||||
# Home Manager module
|
|
||||||
packages: inputs: {
|
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
lib ? pkgs.lib,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
inherit (lib) maintainers;
|
|
||||||
inherit (lib.modules) mkIf;
|
|
||||||
inherit (lib.lists) optional;
|
|
||||||
inherit (lib.options) mkOption mkEnableOption literalExpression;
|
|
||||||
inherit (lib.types) attrsOf anything bool;
|
|
||||||
|
|
||||||
cfg = config.programs.neovim-flake;
|
|
||||||
inherit (import ../../configuration.nix inputs) neovimConfiguration;
|
|
||||||
|
|
||||||
neovimConfigured = neovimConfiguration {
|
|
||||||
inherit pkgs;
|
|
||||||
modules = [cfg.settings];
|
|
||||||
};
|
|
||||||
in {
|
|
||||||
meta.maintainers = with maintainers; [NotAShelf];
|
|
||||||
|
|
||||||
options.programs.neovim-flake = {
|
|
||||||
enable = mkEnableOption "neovim-flake, the extensible neovim configuration wrapper";
|
|
||||||
|
|
||||||
enableManpages = mkOption {
|
|
||||||
type = bool;
|
|
||||||
default = false;
|
|
||||||
description = "Whether to enable manpages for neovim-flake.";
|
|
||||||
};
|
|
||||||
|
|
||||||
defaultEditor = mkOption {
|
|
||||||
type = bool;
|
|
||||||
default = false;
|
|
||||||
description = ''
|
|
||||||
Whether to set `neovim-flake` as the default editor.
|
|
||||||
|
|
||||||
This will set the `EDITOR` environment variable as `nvim`
|
|
||||||
if set to true.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
finalPackage = mkOption {
|
|
||||||
type = anything;
|
|
||||||
visible = false;
|
|
||||||
readOnly = true;
|
|
||||||
description = ''
|
|
||||||
The built neovim-flake package, wrapped with the user's configuration.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
settings = mkOption {
|
|
||||||
type = attrsOf anything;
|
|
||||||
default = {};
|
|
||||||
description = "Attribute set of neovim-flake preferences.";
|
|
||||||
example = literalExpression ''
|
|
||||||
{
|
|
||||||
vim.viAlias = false;
|
|
||||||
vim.vimAlias = true;
|
|
||||||
vim.lsp = {
|
|
||||||
enable = true;
|
|
||||||
formatOnSave = true;
|
|
||||||
lightbulb.enable = true;
|
|
||||||
lspsaga.enable = false;
|
|
||||||
nvimCodeActionMenu.enable = true;
|
|
||||||
trouble.enable = true;
|
|
||||||
lspSignature.enable = true;
|
|
||||||
rust.enable = false;
|
|
||||||
nix = true;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
|
||||||
programs.neovim-flake.finalPackage = neovimConfigured.neovim;
|
|
||||||
|
|
||||||
home = {
|
|
||||||
sessionVariables = mkIf cfg.defaultEditor {EDITOR = "nvim";};
|
|
||||||
packages =
|
|
||||||
[cfg.finalPackage]
|
|
||||||
++ optional cfg.enableManpages packages.${pkgs.stdenv.system}.docs-manpages;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,87 +0,0 @@
|
||||||
# NixOS module
|
|
||||||
packages: inputs: {
|
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
lib ? pkgs.lib,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
inherit (lib) maintainers;
|
|
||||||
inherit (lib.modules) mkIf mkOverride;
|
|
||||||
inherit (lib.lists) optional;
|
|
||||||
inherit (lib.options) mkOption mkEnableOption literalExpression;
|
|
||||||
inherit (lib.types) attrsOf anything bool;
|
|
||||||
|
|
||||||
cfg = config.programs.neovim-flake;
|
|
||||||
inherit (import ../../configuration.nix inputs) neovimConfiguration;
|
|
||||||
|
|
||||||
neovimConfigured = neovimConfiguration {
|
|
||||||
inherit pkgs;
|
|
||||||
modules = [cfg.settings];
|
|
||||||
};
|
|
||||||
in {
|
|
||||||
meta.maintainers = with maintainers; [NotAShelf];
|
|
||||||
|
|
||||||
options.programs.neovim-flake = {
|
|
||||||
enable = mkEnableOption "neovim-flake, the extensible neovim configuration wrapper";
|
|
||||||
|
|
||||||
enableManpages = mkOption {
|
|
||||||
type = bool;
|
|
||||||
default = false;
|
|
||||||
description = "Whether to enable manpages for neovim-flake.";
|
|
||||||
};
|
|
||||||
|
|
||||||
defaultEditor = mkOption {
|
|
||||||
type = bool;
|
|
||||||
default = false;
|
|
||||||
description = ''
|
|
||||||
Whether to set `neovim-flake` as the default editor.
|
|
||||||
|
|
||||||
This will set the `EDITOR` environment variable as `nvim`
|
|
||||||
if set to true.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
finalPackage = mkOption {
|
|
||||||
type = anything;
|
|
||||||
visible = false;
|
|
||||||
readOnly = true;
|
|
||||||
description = ''
|
|
||||||
The built neovim-flake package, wrapped with the user's configuration.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
settings = mkOption {
|
|
||||||
type = attrsOf anything;
|
|
||||||
default = {};
|
|
||||||
description = "Attribute set of neovim-flake preferences.";
|
|
||||||
example = literalExpression ''
|
|
||||||
{
|
|
||||||
vim.viAlias = false;
|
|
||||||
vim.vimAlias = true;
|
|
||||||
vim.lsp = {
|
|
||||||
enable = true;
|
|
||||||
formatOnSave = true;
|
|
||||||
lightbulb.enable = true;
|
|
||||||
lspsaga.enable = false;
|
|
||||||
nvimCodeActionMenu.enable = true;
|
|
||||||
trouble.enable = true;
|
|
||||||
lspSignature.enable = true;
|
|
||||||
rust.enable = false;
|
|
||||||
nix = true;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
|
||||||
programs.neovim-flake.finalPackage = neovimConfigured.neovim;
|
|
||||||
|
|
||||||
environment = {
|
|
||||||
variables.EDITOR = mkIf cfg.defaultEditor (mkOverride 900 "nvim");
|
|
||||||
systemPackages =
|
|
||||||
[cfg.finalPackage]
|
|
||||||
++ optional cfg.enableManpages packages.${pkgs.stdenv.system}.docs-manpages;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -5,7 +5,10 @@
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
docs = import ../docs {inherit pkgs inputs;};
|
docs = import ../docs {
|
||||||
|
inherit pkgs;
|
||||||
|
nmdSrc = inputs.nmd;
|
||||||
|
};
|
||||||
in {
|
in {
|
||||||
packages =
|
packages =
|
||||||
{
|
{
|
||||||
|
@ -33,7 +36,7 @@
|
||||||
inherit (config.legacyPackages) neovim-nix;
|
inherit (config.legacyPackages) neovim-nix;
|
||||||
in
|
in
|
||||||
dockerTools.buildImage {
|
dockerTools.buildImage {
|
||||||
name = "nvf";
|
name = "neovim-flake";
|
||||||
tag = "latest";
|
tag = "latest";
|
||||||
|
|
||||||
copyToRoot = buildEnv {
|
copyToRoot = buildEnv {
|
||||||
|
|
|
@ -1,72 +0,0 @@
|
||||||
{lib}: let
|
|
||||||
inherit (lib.options) mkOption;
|
|
||||||
inherit (lib.modules) mkIf mkDefault;
|
|
||||||
inherit (lib.types) nullOr str;
|
|
||||||
inherit (lib.attrsets) isAttrs mapAttrs;
|
|
||||||
|
|
||||||
binds = rec {
|
|
||||||
mkLuaBinding = key: action: desc:
|
|
||||||
mkIf (key != null) {
|
|
||||||
"${key}" = {
|
|
||||||
inherit action desc;
|
|
||||||
lua = true;
|
|
||||||
silent = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
mkExprBinding = key: action: desc:
|
|
||||||
mkIf (key != null) {
|
|
||||||
"${key}" = {
|
|
||||||
inherit action desc;
|
|
||||||
lua = true;
|
|
||||||
silent = true;
|
|
||||||
expr = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
mkBinding = key: action: desc:
|
|
||||||
mkIf (key != null) {
|
|
||||||
"${key}" = {
|
|
||||||
inherit action desc;
|
|
||||||
silent = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
mkMappingOption = description: default:
|
|
||||||
mkOption {
|
|
||||||
type = nullOr str;
|
|
||||||
inherit default description;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Utility function that takes two attrsets:
|
|
||||||
# { someKey = "some_value" } and
|
|
||||||
# { someKey = { description = "Some Description"; }; }
|
|
||||||
# and merges them into
|
|
||||||
# { someKey = { value = "some_value"; description = "Some Description"; }; }
|
|
||||||
addDescriptionsToMappings = actualMappings: mappingDefinitions:
|
|
||||||
mapAttrs (name: value: let
|
|
||||||
isNested = isAttrs value;
|
|
||||||
returnedValue =
|
|
||||||
if isNested
|
|
||||||
then addDescriptionsToMappings actualMappings."${name}" mappingDefinitions."${name}"
|
|
||||||
else {
|
|
||||||
inherit value;
|
|
||||||
inherit (mappingDefinitions."${name}") description;
|
|
||||||
};
|
|
||||||
in
|
|
||||||
returnedValue)
|
|
||||||
actualMappings;
|
|
||||||
|
|
||||||
mkSetBinding = binding: action:
|
|
||||||
mkBinding binding.value action binding.description;
|
|
||||||
|
|
||||||
mkSetExprBinding = binding: action:
|
|
||||||
mkExprBinding binding.value action binding.description;
|
|
||||||
|
|
||||||
mkSetLuaBinding = binding: action:
|
|
||||||
mkLuaBinding binding.value action binding.description;
|
|
||||||
|
|
||||||
pushDownDefault = attr: mapAttrs (_: value: mkDefault value) attr;
|
|
||||||
};
|
|
||||||
in
|
|
||||||
binds
|
|
|
@ -1,65 +0,0 @@
|
||||||
{lib}: let
|
|
||||||
inherit (lib.options) mkOption;
|
|
||||||
inherit (lib.types) bool;
|
|
||||||
inherit (lib.modules) mkRenamedOptionModule;
|
|
||||||
inherit (lib.attrsets) mapAttrsToList;
|
|
||||||
inherit (lib.lists) flatten;
|
|
||||||
in {
|
|
||||||
mkBool = value: description:
|
|
||||||
mkOption {
|
|
||||||
type = bool;
|
|
||||||
default = value;
|
|
||||||
inherit description;
|
|
||||||
};
|
|
||||||
|
|
||||||
/*
|
|
||||||
Generates a list of mkRenamedOptionModule, from a mapping of the old name to
|
|
||||||
the new name. Nested options can optionally supply a "_name" to indicate its
|
|
||||||
new name.
|
|
||||||
|
|
||||||
# Example
|
|
||||||
|
|
||||||
```nix
|
|
||||||
batchRenameOptions ["nvimTree"] ["nvimTree" "setupOpts"] {
|
|
||||||
disableNetrw = "disable_netrw";
|
|
||||||
nestedOption = {
|
|
||||||
_name = "nested_option";
|
|
||||||
somethingElse = "something_else";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
The above code is equivalent to this:
|
|
||||||
|
|
||||||
```nix
|
|
||||||
[
|
|
||||||
(
|
|
||||||
mkRenamedOptionModule
|
|
||||||
["nvimTree" "disableNetrw"]
|
|
||||||
["nvimTree" "setupOpts" "disable_netrw"]
|
|
||||||
)
|
|
||||||
(
|
|
||||||
mkRenamedOptionModule
|
|
||||||
["nvimTree" "nestedOption" "somethingElse"]
|
|
||||||
["nvimTree" "setupOpts" "nested_option" "something_else"]
|
|
||||||
)
|
|
||||||
]
|
|
||||||
```
|
|
||||||
*/
|
|
||||||
batchRenameOptions = oldBasePath: newBasePath: mappings: let
|
|
||||||
genSetupOptRenames = oldSubpath: newSubpath: table:
|
|
||||||
mapAttrsToList (
|
|
||||||
oldName: newNameOrNestedOpts:
|
|
||||||
if builtins.isAttrs newNameOrNestedOpts
|
|
||||||
then
|
|
||||||
genSetupOptRenames (oldSubpath ++ [oldName]) (newSubpath ++ [newNameOrNestedOpts._name or oldName])
|
|
||||||
(builtins.removeAttrs newNameOrNestedOpts ["_name"])
|
|
||||||
else
|
|
||||||
mkRenamedOptionModule
|
|
||||||
(oldBasePath ++ oldSubpath ++ [oldName])
|
|
||||||
(newBasePath ++ newSubpath ++ [newNameOrNestedOpts])
|
|
||||||
)
|
|
||||||
table;
|
|
||||||
in
|
|
||||||
flatten (genSetupOptRenames [] [] mappings);
|
|
||||||
}
|
|
66
lib/dag.nix
66
lib/dag.nix
|
@ -8,16 +8,13 @@
|
||||||
# - 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;
|
inherit (lib) all filterAttrs nvim mapAttrs toposort;
|
||||||
inherit (lib.attrsets) filterAttrs mapAttrs;
|
|
||||||
inherit (lib.lists) toposort;
|
|
||||||
inherit (lib.nvim.dag) empty isEntry entryBetween entryAfter entriesBetween;
|
|
||||||
in {
|
in {
|
||||||
empty = {};
|
empty = {};
|
||||||
|
|
||||||
isEntry = e: e ? data && e ? after && e ? before;
|
isEntry = e: e ? data && e ? after && e ? before;
|
||||||
isDag = dag:
|
isDag = dag:
|
||||||
isAttrs dag && all isEntry (attrValues dag);
|
builtins.isAttrs dag && all nvim.dag.isEntry (builtins.attrValues dag);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Takes an attribute set containing entries built by entryAnywhere,
|
Takes an attribute set containing entries built by entryAnywhere,
|
||||||
|
@ -79,8 +76,8 @@ in {
|
||||||
*/
|
*/
|
||||||
topoSort = dag: let
|
topoSort = dag: let
|
||||||
dagBefore = dag: name:
|
dagBefore = dag: name:
|
||||||
attrNames
|
builtins.attrNames
|
||||||
(filterAttrs (_n: v: elem name v.before) dag);
|
(filterAttrs (_n: v: builtins.elem name v.before) dag);
|
||||||
normalizedDag =
|
normalizedDag =
|
||||||
mapAttrs (n: v: {
|
mapAttrs (n: v: {
|
||||||
name = n;
|
name = n;
|
||||||
|
@ -88,8 +85,8 @@ in {
|
||||||
after = v.after ++ dagBefore dag n;
|
after = v.after ++ dagBefore dag n;
|
||||||
})
|
})
|
||||||
dag;
|
dag;
|
||||||
before = a: b: elem a.name b.after;
|
before = a: b: builtins.elem a.name b.after;
|
||||||
sorted = toposort before (attrValues normalizedDag);
|
sorted = toposort before (builtins.attrValues normalizedDag);
|
||||||
in
|
in
|
||||||
if sorted ? result
|
if sorted ? result
|
||||||
then {
|
then {
|
||||||
|
@ -103,53 +100,8 @@ in {
|
||||||
entryBetween = before: after: data: {inherit data before after;};
|
entryBetween = before: after: data: {inherit data before after;};
|
||||||
|
|
||||||
# Create a DAG entry with no particular dependency information.
|
# Create a DAG entry with no particular dependency information.
|
||||||
entryAnywhere = entryBetween [] [];
|
entryAnywhere = nvim.dag.entryBetween [] [];
|
||||||
|
|
||||||
entryAfter = entryBetween [];
|
entryAfter = nvim.dag.entryBetween [];
|
||||||
entryBefore = before: entryBetween before [];
|
entryBefore = before: nvim.dag.entryBetween before [];
|
||||||
|
|
||||||
# Given a list of entries, this function places them in order within the DAG.
|
|
||||||
# Each entry is labeled "${tag}-${entry index}" and other DAG entries can be
|
|
||||||
# added with 'before' or 'after' referring these indexed entries.
|
|
||||||
#
|
|
||||||
# The entries as a whole can be given a relation to other DAG nodes. All
|
|
||||||
# generated nodes are then placed before or after those dependencies.
|
|
||||||
entriesBetween = tag: let
|
|
||||||
go = i: before: after: entries: let
|
|
||||||
name = "${tag}-${toString i}";
|
|
||||||
i' = i + 1;
|
|
||||||
in
|
|
||||||
if entries == []
|
|
||||||
then empty
|
|
||||||
else if length entries == 1
|
|
||||||
then {
|
|
||||||
"${name}" = entryBetween before after (head entries);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
"${name}" = entryAfter after (head entries);
|
|
||||||
}
|
|
||||||
// go (i + 1) before [name] (tail entries);
|
|
||||||
in
|
|
||||||
go 0;
|
|
||||||
|
|
||||||
entriesAnywhere = tag: entriesBetween tag [] [];
|
|
||||||
entriesAfter = tag: entriesBetween tag [];
|
|
||||||
entriesBefore = tag: before: entriesBetween tag before [];
|
|
||||||
|
|
||||||
# mkLuarcSection and mkVimrcSection take a section DAG
|
|
||||||
# and return a string containing a comment to identify
|
|
||||||
# the section, and the data contained within the section
|
|
||||||
#
|
|
||||||
# all operations are done without any modifications
|
|
||||||
# to the inputted section data
|
|
||||||
mkLuarcSection = section: ''
|
|
||||||
-- SECTION: ${section.name}
|
|
||||||
${section.data}
|
|
||||||
'';
|
|
||||||
|
|
||||||
mkVimrcSection = section: ''
|
|
||||||
" SECTION: ${section.name}
|
|
||||||
${section.data}
|
|
||||||
'';
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,15 +1,7 @@
|
||||||
{
|
{lib}: {
|
||||||
inputs,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
types = import ./types {inherit inputs lib;};
|
|
||||||
|
|
||||||
config = import ./config.nix {inherit lib;};
|
|
||||||
binds = import ./binds.nix {inherit lib;};
|
|
||||||
dag = import ./dag.nix {inherit lib;};
|
dag = import ./dag.nix {inherit lib;};
|
||||||
|
types = import ./types {inherit lib;};
|
||||||
languages = import ./languages.nix {inherit lib;};
|
languages = import ./languages.nix {inherit lib;};
|
||||||
lists = import ./lists.nix {inherit lib;};
|
|
||||||
lua = import ./lua.nix {inherit lib;};
|
lua = import ./lua.nix {inherit lib;};
|
||||||
vim = import ./vim.nix;
|
vim = import ./vim.nix {inherit lib;};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,37 +1,32 @@
|
||||||
# From home-manager: https://github.com/nix-community/home-manager/blob/master/modules/lib/booleans.nix
|
# From home-manager: https://github.com/nix-community/home-manager/blob/master/modules/lib/booleans.nix
|
||||||
{lib}: let
|
{lib}: {
|
||||||
inherit (builtins) isString getAttr;
|
|
||||||
inherit (lib.options) mkOption;
|
|
||||||
inherit (lib.attrsets) listToAttrs;
|
|
||||||
inherit (lib.types) bool;
|
|
||||||
in {
|
|
||||||
# Converts a boolean to a yes/no string. This is used in lots of
|
# Converts a boolean to a yes/no string. This is used in lots of
|
||||||
# configuration formats.
|
# configuration formats.
|
||||||
diagnosticsToLua = {
|
diagnosticsToLua = {
|
||||||
lang,
|
lang,
|
||||||
config,
|
config,
|
||||||
diagnosticsProviders,
|
diagnostics,
|
||||||
}:
|
}:
|
||||||
listToAttrs
|
lib.listToAttrs
|
||||||
(map (v: let
|
(map (v: let
|
||||||
type =
|
type =
|
||||||
if isString v
|
if builtins.isString v
|
||||||
then v
|
then v
|
||||||
else getAttr v.type;
|
else builtins.getAttr v.type;
|
||||||
package =
|
package =
|
||||||
if isString v
|
if builtins.isString v
|
||||||
then diagnosticsProviders.${type}.package
|
then diagnostics.${type}.package
|
||||||
else v.package;
|
else v.package;
|
||||||
in {
|
in {
|
||||||
name = "${lang}-diagnostics-${type}";
|
name = "${lang}-diagnostics-${type}";
|
||||||
value = diagnosticsProviders.${type}.nullConfig package;
|
value = diagnostics.${type}.nullConfig package;
|
||||||
})
|
})
|
||||||
config);
|
config);
|
||||||
|
|
||||||
mkEnable = desc:
|
mkEnable = desc:
|
||||||
mkOption {
|
lib.mkOption {
|
||||||
description = "Turn on ${desc} for enabled languages by default";
|
description = "Turn on ${desc} for enabled languages by default";
|
||||||
type = bool;
|
type = lib.types.bool;
|
||||||
default = false;
|
default = false;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,34 +0,0 @@
|
||||||
{lib}: let
|
|
||||||
inherit (lib.lists) elem all;
|
|
||||||
in {
|
|
||||||
/*
|
|
||||||
Checks if all values are present in the list.
|
|
||||||
|
|
||||||
Type:
|
|
||||||
listContainsValues :: { list :: [a], values :: [a] } -> Bool
|
|
||||||
|
|
||||||
Arguments:
|
|
||||||
list - A list of elements.
|
|
||||||
values - A list of values to check for presence in the list.
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
True if all values are present in the list, otherwise False.
|
|
||||||
|
|
||||||
Example:
|
|
||||||
```nix
|
|
||||||
listContainsValues { list = [1 2 3]; values = [2 3]; }
|
|
||||||
=> True
|
|
||||||
|
|
||||||
listContainsValues { list = [1 2 3]; values = [2 4]; }
|
|
||||||
=> False
|
|
||||||
```
|
|
||||||
*/
|
|
||||||
listContainsValues = {
|
|
||||||
list,
|
|
||||||
values,
|
|
||||||
}: let
|
|
||||||
# Check if all values are present in the list
|
|
||||||
containsValue = value: elem value list;
|
|
||||||
in
|
|
||||||
all containsValue values;
|
|
||||||
}
|
|
62
lib/lua.nix
62
lib/lua.nix
|
@ -1,20 +1,8 @@
|
||||||
# Helpers for converting values to lua
|
# Helpers for converting values to lua
|
||||||
{lib}: let
|
{lib}: let
|
||||||
inherit (builtins) hasAttr head throw typeOf isList isAttrs isBool isInt isString isPath isFloat toJSON;
|
inherit (lib) mapAttrsToList filterAttrs concatStringsSep concatMapStringsSep stringToCharacters boolToString;
|
||||||
inherit (lib.attrsets) mapAttrsToList filterAttrs;
|
inherit (builtins) hasAttr head throw typeOf;
|
||||||
inherit (lib.strings) concatStringsSep concatMapStringsSep stringToCharacters;
|
|
||||||
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
|
||||||
|
@ -23,29 +11,29 @@ in rec {
|
||||||
|
|
||||||
# convert an expression to lua
|
# convert an expression to lua
|
||||||
expToLua = exp:
|
expToLua = exp:
|
||||||
if isList exp
|
if builtins.isList exp
|
||||||
then listToLuaTable exp # if list, convert to lua table
|
then listToLuaTable exp # if list, convert to lua table
|
||||||
else if isAttrs exp
|
else if builtins.isAttrs exp
|
||||||
then attrsetToLuaTable exp # if attrs, convert to table
|
then attrsetToLuaTable exp # if attrs, convert to table
|
||||||
else if isBool exp
|
else if builtins.isBool exp
|
||||||
then boolToString exp # if bool, convert to string
|
then lib.boolToString exp # if bool, convert to string
|
||||||
else if isInt exp
|
else if builtins.isInt exp
|
||||||
then toString exp # if int, convert to string
|
then builtins.toString exp # if int, convert to string
|
||||||
else if exp == null
|
else if exp == null
|
||||||
then "nil"
|
then "nil"
|
||||||
else (toJSON exp); # otherwise jsonify the value and print as is
|
else (builtins.toJSON exp); # otherwise jsonify the value and print as is
|
||||||
|
|
||||||
# convert list to a lua table
|
# convert list to a lua table
|
||||||
listToLuaTable = list:
|
listToLuaTable = list:
|
||||||
"{ " + (concatStringsSep ", " (map expToLua list)) + " }";
|
"{ " + (builtins.concatStringsSep ", " (map expToLua list)) + " }";
|
||||||
|
|
||||||
# convert attrset to a lua table
|
# convert attrset to a lua table
|
||||||
attrsetToLuaTable = attrset:
|
attrsetToLuaTable = attrset:
|
||||||
"{ "
|
"{ "
|
||||||
+ (
|
+ (
|
||||||
concatStringsSep ", "
|
builtins.concatStringsSep ", "
|
||||||
(
|
(
|
||||||
mapAttrsToList (
|
lib.mapAttrsToList (
|
||||||
name: value:
|
name: value:
|
||||||
name
|
name
|
||||||
+ " = "
|
+ " = "
|
||||||
|
@ -56,15 +44,13 @@ in rec {
|
||||||
)
|
)
|
||||||
+ " }";
|
+ " }";
|
||||||
# Convert a list of lua expressions to a lua table. The difference to listToLuaTable is that the elements here are expected to be lua expressions already, whereas listToLuaTable converts from nix types to lua first
|
# Convert a list of lua expressions to a lua table. The difference to listToLuaTable is that the elements here are expected to be lua expressions already, whereas listToLuaTable converts from nix types to lua first
|
||||||
luaTable = items: ''{${concatStringsSep "," items}}'';
|
luaTable = items: ''{${builtins.concatStringsSep "," items}}'';
|
||||||
|
|
||||||
isLuaInline = object: (object._type or null) == "lua-inline";
|
|
||||||
|
|
||||||
toLuaObject = args:
|
toLuaObject = args:
|
||||||
if isAttrs args
|
if builtins.isAttrs args
|
||||||
then
|
then
|
||||||
if isLuaInline args
|
if hasAttr "__raw" args
|
||||||
then args.expr
|
then args.__raw
|
||||||
else if hasAttr "__empty" args
|
else if hasAttr "__empty" args
|
||||||
then "{ }"
|
then "{ }"
|
||||||
else
|
else
|
||||||
|
@ -82,19 +68,19 @@ in rec {
|
||||||
)
|
)
|
||||||
args)))
|
args)))
|
||||||
+ "}"
|
+ "}"
|
||||||
else if isList args
|
else if builtins.isList args
|
||||||
then "{" + concatMapStringsSep "," toLuaObject args + "}"
|
then "{" + concatMapStringsSep "," toLuaObject args + "}"
|
||||||
else if isString args
|
else if builtins.isString args
|
||||||
then
|
then
|
||||||
# This should be enough!
|
# This should be enough!
|
||||||
toJSON args
|
builtins.toJSON args
|
||||||
else if isPath args
|
else if builtins.isPath args
|
||||||
then toJSON (toString args)
|
then builtins.toJSON (toString args)
|
||||||
else if isBool args
|
else if builtins.isBool args
|
||||||
then "${boolToString args}"
|
then "${boolToString args}"
|
||||||
else if isFloat args
|
else if builtins.isFloat args
|
||||||
then "${toString args}"
|
then "${toString args}"
|
||||||
else if isInt args
|
else if builtins.isInt args
|
||||||
then "${toString args}"
|
then "${toString args}"
|
||||||
else if (args == null)
|
else if (args == null)
|
||||||
then "nil"
|
then "nil"
|
||||||
|
|
49
lib/module/default.nix
Normal file
49
lib/module/default.nix
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
# Home Manager module
|
||||||
|
packages: inputs: {
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
lib ? pkgs.lib,
|
||||||
|
self,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib; let
|
||||||
|
cfg = config.programs.neovim-flake;
|
||||||
|
inherit (import ../../configuration.nix inputs) neovimConfiguration;
|
||||||
|
set = neovimConfiguration {
|
||||||
|
inherit pkgs;
|
||||||
|
modules = [cfg.settings];
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
meta.maintainers = with maintainers; [NotAShelf];
|
||||||
|
|
||||||
|
options.programs.neovim-flake = {
|
||||||
|
enable = mkEnableOption "A NeoVim IDE with a focus on configurability and extensibility.";
|
||||||
|
|
||||||
|
settings = mkOption {
|
||||||
|
type = types.attrsOf types.anything;
|
||||||
|
default = {};
|
||||||
|
example = literalExpression ''
|
||||||
|
{
|
||||||
|
vim.viAlias = false;
|
||||||
|
vim.vimAlias = true;
|
||||||
|
vim.lsp = {
|
||||||
|
enable = true;
|
||||||
|
formatOnSave = true;
|
||||||
|
lightbulb.enable = true;
|
||||||
|
lspsaga.enable = false;
|
||||||
|
nvimCodeActionMenu.enable = true;
|
||||||
|
trouble.enable = true;
|
||||||
|
lspSignature.enable = true;
|
||||||
|
rust.enable = false;
|
||||||
|
nix = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
description = "Attribute set of neoflake preferences.";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
home.packages = [set.neovim];
|
||||||
|
};
|
||||||
|
}
|
17
lib/nmd.nix
Normal file
17
lib/nmd.nix
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
# Copied from nmd master: https://gitlab.com/rycee/nmd/-/blob/master/default.nix?ref_type=heads
|
||||||
|
# Allows asciiDoc in options. It is easier to copy & keep updated then figure out how to pass the nmd input
|
||||||
|
# along to user modules
|
||||||
|
{
|
||||||
|
# Indicates that the given text should be interpreted as AsciiDoc markup.
|
||||||
|
asciiDoc = text: {
|
||||||
|
_type = "asciiDoc";
|
||||||
|
inherit text;
|
||||||
|
};
|
||||||
|
|
||||||
|
# Indicates that the given text should be interpreted as AsciiDoc markup and
|
||||||
|
# used in a literal context.
|
||||||
|
literalAsciiDoc = text: {
|
||||||
|
_type = "literalAsciiDoc";
|
||||||
|
inherit text;
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,21 +1,73 @@
|
||||||
# Convenience function that returns the given Nixpkgs standard library
|
# From home-manager: https://github.com/nix-community/home-manager/blob/master/modules/lib/stdlib-extended.nix
|
||||||
# extended with our functions using `lib.extend`.
|
# Just a convenience function that returns the given Nixpkgs standard
|
||||||
nixpkgsLib: inputs:
|
# library extended with the HM library.
|
||||||
nixpkgsLib.extend (self: super: {
|
nixpkgsLib: let
|
||||||
# WARNING: New functions should not be added here, but to files
|
mkNvimLib = import ./.;
|
||||||
# imported by `./default.nix` under their own categories. If your
|
in
|
||||||
# function does not fit to any of the existing categories, create
|
nixpkgsLib.extend (self: super: rec {
|
||||||
# a new file and import it in `./default.nix.`
|
nvim = mkNvimLib {lib = self;};
|
||||||
|
|
||||||
# Makes our custom functions available under `lib.nvim` where stdlib-extended.nix is imported
|
mkLuaBinding = key: action: desc:
|
||||||
# with the appropriate arguments. For end-users, a `lib` output will be accessible from the flake.
|
self.mkIf (key != null) {
|
||||||
# E.g. for an input called `nvf`, `inputs.nvf.lib.nvim` will return the set
|
"${key}" = {
|
||||||
# below.
|
inherit action desc;
|
||||||
nvim = import ./. {
|
lua = true;
|
||||||
inherit inputs;
|
silent = true;
|
||||||
lib = self;
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# For forward compatibility.
|
mkExprBinding = key: action: desc:
|
||||||
literalExpression = super.literalExpression or super.literalExample;
|
self.mkIf (key != null) {
|
||||||
})
|
"${key}" = {
|
||||||
|
inherit action desc;
|
||||||
|
lua = true;
|
||||||
|
silent = true;
|
||||||
|
expr = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
mkBinding = key: action: desc:
|
||||||
|
self.mkIf (key != null) {
|
||||||
|
"${key}" = {
|
||||||
|
inherit action desc;
|
||||||
|
silent = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
mkMappingOption = description: default:
|
||||||
|
self.mkOption {
|
||||||
|
type = self.types.nullOr self.types.str;
|
||||||
|
inherit default description;
|
||||||
|
};
|
||||||
|
|
||||||
|
# Utility function that takes two attrsets:
|
||||||
|
# { someKey = "some_value" } and
|
||||||
|
# { someKey = { description = "Some Description"; }; }
|
||||||
|
# and merges them into
|
||||||
|
# { someKey = { value = "some_value"; description = "Some Description"; }; }
|
||||||
|
addDescriptionsToMappings = actualMappings: mappingDefinitions:
|
||||||
|
self.attrsets.mapAttrs (name: value: let
|
||||||
|
isNested = self.isAttrs value;
|
||||||
|
returnedValue =
|
||||||
|
if isNested
|
||||||
|
then addDescriptionsToMappings actualMappings."${name}" mappingDefinitions."${name}"
|
||||||
|
else {
|
||||||
|
value = value;
|
||||||
|
description = mappingDefinitions."${name}".description;
|
||||||
|
};
|
||||||
|
in
|
||||||
|
returnedValue)
|
||||||
|
actualMappings;
|
||||||
|
|
||||||
|
mkSetBinding = binding: action:
|
||||||
|
mkBinding binding.value action binding.description;
|
||||||
|
|
||||||
|
mkSetExprBinding = binding: action:
|
||||||
|
mkExprBinding binding.value action binding.description;
|
||||||
|
|
||||||
|
mkSetLuaBinding = binding: action:
|
||||||
|
mkLuaBinding binding.value action binding.description;
|
||||||
|
|
||||||
|
# For forward compatibility.
|
||||||
|
literalExpression = super.literalExpression or super.literalExample;
|
||||||
|
})
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
# From home-manager: https://github.com/nix-community/home-manager/blob/master/modules/lib/types-dag.nix
|
# From home-manager: https://github.com/nix-community/home-manager/blob/master/modules/lib/types-dag.nix
|
||||||
# Used for ordering configuration text.
|
# Used for ordering config text.
|
||||||
{lib}: let
|
{lib}: let
|
||||||
inherit
|
inherit
|
||||||
(lib)
|
(lib)
|
||||||
|
@ -59,8 +59,8 @@ in rec {
|
||||||
name = "dagOf";
|
name = "dagOf";
|
||||||
description = "DAG of ${elemType.description}";
|
description = "DAG of ${elemType.description}";
|
||||||
inherit (attrEquivalent) check merge emptyValue;
|
inherit (attrEquivalent) check merge emptyValue;
|
||||||
inherit (elemType) getSubModules;
|
|
||||||
getSubOptions = prefix: elemType.getSubOptions (prefix ++ ["<name>"]);
|
getSubOptions = prefix: elemType.getSubOptions (prefix ++ ["<name>"]);
|
||||||
|
getSubModules = elemType.getSubModules;
|
||||||
substSubModules = m: dagOf (elemType.substSubModules m);
|
substSubModules = m: dagOf (elemType.substSubModules m);
|
||||||
functor = (defaultFunctor name) // {wrapped = elemType;};
|
functor = (defaultFunctor name) // {wrapped = elemType;};
|
||||||
nestedTypes.elemType = elemType;
|
nestedTypes.elemType = elemType;
|
||||||
|
|
|
@ -1,13 +1,9 @@
|
||||||
{
|
{lib}: let
|
||||||
inputs,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
typesDag = import ./dag.nix {inherit lib;};
|
typesDag = import ./dag.nix {inherit lib;};
|
||||||
typesPlugin = import ./plugins.nix {inherit inputs lib;};
|
typesPlugin = import ./plugins.nix {inherit lib;};
|
||||||
typesLanguage = import ./languages.nix {inherit lib;};
|
typesLanguage = import ./languages.nix {inherit lib;};
|
||||||
in {
|
in {
|
||||||
inherit (typesDag) dagOf;
|
inherit (typesDag) dagOf;
|
||||||
inherit (typesPlugin) pluginsOpt extraPluginType mkPluginSetupOption luaInline;
|
inherit (typesPlugin) pluginsOpt extraPluginType mkPluginSetupOption;
|
||||||
inherit (typesLanguage) diagnostics mkGrammarOption;
|
inherit (typesLanguage) diagnostics mkGrammarOption;
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,13 +15,13 @@ with lib; let
|
||||||
in {
|
in {
|
||||||
diagnostics = {
|
diagnostics = {
|
||||||
langDesc,
|
langDesc,
|
||||||
diagnosticsProviders,
|
diagnostics,
|
||||||
defaultDiagnosticsProvider,
|
defaultDiagnostics,
|
||||||
}:
|
}:
|
||||||
mkOption {
|
mkOption {
|
||||||
description = "List of ${langDesc} diagnostics to enable";
|
description = "List of ${langDesc} diagnostics to enable";
|
||||||
type = with types; listOf (either (enum (attrNames diagnosticsProviders)) (submodule diagnosticSubmodule));
|
type = with types; listOf (either (enum (attrNames diagnostics)) (submodule diagnosticSubmodule));
|
||||||
default = defaultDiagnosticsProvider;
|
default = defaultDiagnostics;
|
||||||
};
|
};
|
||||||
|
|
||||||
mkGrammarOption = pkgs: grammar:
|
mkGrammarOption = pkgs: grammar:
|
||||||
|
|
|
@ -1,99 +1,163 @@
|
||||||
{
|
{lib}:
|
||||||
inputs,
|
with lib; let
|
||||||
lib,
|
# Plugin must be same as input name from flake.nix
|
||||||
...
|
availablePlugins = [
|
||||||
}: let
|
# TODO: sort by category
|
||||||
inherit (lib.options) mkOption;
|
"nvim-treesitter-context"
|
||||||
inherit (lib.attrsets) attrNames mapAttrs' filterAttrs nameValuePair;
|
"gitsigns-nvim"
|
||||||
inherit (lib.strings) hasPrefix removePrefix isString;
|
"plenary-nvim"
|
||||||
inherit (lib.types) submodule either package enum str lines attrsOf anything listOf nullOr;
|
"nvim-lspconfig"
|
||||||
|
"nvim-treesitter"
|
||||||
# Get the names of all flake inputs that start with the given prefix.
|
"lspsaga"
|
||||||
fromInputs = {
|
"lspkind"
|
||||||
inputs,
|
"nvim-lightbulb"
|
||||||
prefix,
|
"lsp-signature"
|
||||||
}:
|
"nvim-tree-lua"
|
||||||
mapAttrs' (n: v: nameValuePair (removePrefix prefix n) {src = v;}) (filterAttrs (n: _: hasPrefix prefix n) inputs);
|
"nvim-bufferline-lua"
|
||||||
|
"lualine"
|
||||||
# Get the names of all flake inputs that start with the given prefix.
|
"nvim-compe"
|
||||||
pluginInputNames = attrNames (fromInputs {
|
"nvim-autopairs"
|
||||||
inherit inputs;
|
"nvim-ts-autotag"
|
||||||
prefix = "plugin-";
|
"nvim-web-devicons"
|
||||||
});
|
"tokyonight"
|
||||||
|
"bufdelete-nvim"
|
||||||
|
"nvim-cmp"
|
||||||
|
"cmp-nvim-lsp"
|
||||||
|
"cmp-buffer"
|
||||||
|
"cmp-vsnip"
|
||||||
|
"cmp-path"
|
||||||
|
"cmp-treesitter"
|
||||||
|
"crates-nvim"
|
||||||
|
"vim-vsnip"
|
||||||
|
"nvim-code-action-menu"
|
||||||
|
"trouble"
|
||||||
|
"none-ls"
|
||||||
|
"which-key"
|
||||||
|
"indent-blankline"
|
||||||
|
"nvim-cursorline"
|
||||||
|
"sqls-nvim"
|
||||||
|
"glow-nvim"
|
||||||
|
"telescope"
|
||||||
|
"rust-tools"
|
||||||
|
"onedark"
|
||||||
|
"catppuccin"
|
||||||
|
"dracula"
|
||||||
|
"oxocarbon"
|
||||||
|
"gruvbox"
|
||||||
|
"rose-pine"
|
||||||
|
"minimap-vim"
|
||||||
|
"dashboard-nvim"
|
||||||
|
"alpha-nvim"
|
||||||
|
"scrollbar-nvim"
|
||||||
|
"codewindow-nvim"
|
||||||
|
"nvim-notify"
|
||||||
|
"cinnamon-nvim"
|
||||||
|
"cheatsheet-nvim"
|
||||||
|
"ccc"
|
||||||
|
"cellular-automaton"
|
||||||
|
"neocord"
|
||||||
|
"icon-picker-nvim"
|
||||||
|
"dressing-nvim"
|
||||||
|
"orgmode-nvim"
|
||||||
|
"obsidian-nvim"
|
||||||
|
"vim-markdown"
|
||||||
|
"tabular"
|
||||||
|
"toggleterm-nvim"
|
||||||
|
"noice-nvim"
|
||||||
|
"nui-nvim"
|
||||||
|
"copilot-lua"
|
||||||
|
"tabnine-nvim"
|
||||||
|
"nvim-session-manager"
|
||||||
|
"gesture-nvim"
|
||||||
|
"comment-nvim"
|
||||||
|
"kommentary"
|
||||||
|
"mind-nvim"
|
||||||
|
"fidget-nvim"
|
||||||
|
"diffview-nvim"
|
||||||
|
"todo-comments"
|
||||||
|
"flutter-tools"
|
||||||
|
"flutter-tools-patched"
|
||||||
|
"hop-nvim"
|
||||||
|
"leap-nvim"
|
||||||
|
"modes-nvim"
|
||||||
|
"vim-repeat"
|
||||||
|
"smartcolumn"
|
||||||
|
"project-nvim"
|
||||||
|
"neodev-nvim"
|
||||||
|
"elixir-ls"
|
||||||
|
"elixir-tools"
|
||||||
|
"nvim-colorizer-lua"
|
||||||
|
"vim-illuminate"
|
||||||
|
"nvim-surround"
|
||||||
|
"nvim-dap"
|
||||||
|
"nvim-dap-ui"
|
||||||
|
"nvim-navic"
|
||||||
|
"nvim-navbuddy"
|
||||||
|
"copilot-cmp"
|
||||||
|
"lsp-lines"
|
||||||
|
"vim-dirtytalk"
|
||||||
|
"highlight-undo"
|
||||||
|
"nvim-docs-view"
|
||||||
|
];
|
||||||
# You can either use the name of the plugin or a package.
|
# You can either use the name of the plugin or a package.
|
||||||
pluginType = nullOr (
|
pluginType = with types;
|
||||||
either
|
nullOr (
|
||||||
package
|
either
|
||||||
(enum (pluginInputNames ++ ["nvim-treesitter" "flutter-tools-patched" "vim-repeat"]))
|
package
|
||||||
);
|
(enum availablePlugins)
|
||||||
|
);
|
||||||
|
|
||||||
pluginsType = listOf pluginType;
|
pluginsType = types.listOf pluginType;
|
||||||
|
|
||||||
extraPluginType = submodule {
|
extraPluginType = with types;
|
||||||
options = {
|
submodule {
|
||||||
package = mkOption {
|
options = {
|
||||||
type = pluginType;
|
package = mkOption {
|
||||||
description = "Plugin Package.";
|
type = pluginType;
|
||||||
};
|
description = "Plugin Package.";
|
||||||
|
};
|
||||||
after = mkOption {
|
after = mkOption {
|
||||||
type = listOf str;
|
type = listOf str;
|
||||||
default = [];
|
default = [];
|
||||||
description = "Setup this plugin after the following ones.";
|
description = "Setup this plugin after the following ones.";
|
||||||
};
|
};
|
||||||
|
setup = mkOption {
|
||||||
setup = mkOption {
|
type = lines;
|
||||||
type = lines;
|
default = "";
|
||||||
default = "";
|
description = "Lua code to run during setup.";
|
||||||
description = "Lua code to run during setup.";
|
example = "require('aerial').setup {}";
|
||||||
example = "require('aerial').setup {}";
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
|
||||||
in {
|
in {
|
||||||
inherit extraPluginType fromInputs;
|
inherit extraPluginType;
|
||||||
|
|
||||||
pluginsOpt = {
|
pluginsOpt = {
|
||||||
description,
|
description,
|
||||||
example,
|
|
||||||
default ? [],
|
default ? [],
|
||||||
}:
|
}:
|
||||||
mkOption {
|
mkOption {
|
||||||
inherit example description default;
|
inherit description default;
|
||||||
type = pluginsType;
|
type = pluginsType;
|
||||||
};
|
};
|
||||||
|
|
||||||
luaInline = lib.mkOptionType {
|
# opts is a attrset of options, example:
|
||||||
name = "luaInline";
|
# ```
|
||||||
check = x: lib.nvim.lua.isLuaInline x;
|
# mkPluginSetupOption "telescope" {
|
||||||
};
|
# file_ignore_patterns = mkOption {
|
||||||
|
# description = "...";
|
||||||
/*
|
# type = types.listOf types.str;
|
||||||
opts is a attrset of options, example:
|
# default = [];
|
||||||
```
|
# };
|
||||||
mkPluginSetupOption "telescope" {
|
# layout_config.horizontal = mkOption {...};
|
||||||
file_ignore_patterns = mkOption {
|
# }
|
||||||
description = "...";
|
# ```
|
||||||
type = types.listOf types.str;
|
|
||||||
default = [];
|
|
||||||
};
|
|
||||||
layout_config.horizontal = mkOption {...};
|
|
||||||
}
|
|
||||||
```
|
|
||||||
*/
|
|
||||||
mkPluginSetupOption = pluginName: opts:
|
mkPluginSetupOption = pluginName: opts:
|
||||||
mkOption {
|
mkOption {
|
||||||
description = ''
|
description = "Option table to pass into the setup function of " + pluginName;
|
||||||
Option table to pass into the setup function of ${pluginName}
|
|
||||||
|
|
||||||
You can pass in any additional options even if they're
|
|
||||||
not listed in the docs
|
|
||||||
'';
|
|
||||||
|
|
||||||
default = {};
|
default = {};
|
||||||
type = submodule {
|
type = types.submodule {
|
||||||
freeformType = attrsOf anything;
|
freeformType = with types; attrsOf anything;
|
||||||
options = opts;
|
options = opts;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
let
|
{lib}: let
|
||||||
inherit (builtins) isInt isBool toJSON toString;
|
inherit (builtins) isInt isBool toJSON;
|
||||||
in rec {
|
in rec {
|
||||||
# yes? no.
|
# yes? no.
|
||||||
yesNo = value:
|
yesNo = value:
|
||||||
|
@ -16,7 +16,7 @@ in rec {
|
||||||
# convert a literal value to a vim compliant value
|
# convert a literal value to a vim compliant value
|
||||||
valToVim = val:
|
valToVim = val:
|
||||||
if (isInt val)
|
if (isInt val)
|
||||||
then (toString val)
|
then (builtins.toString val)
|
||||||
else
|
else
|
||||||
(
|
(
|
||||||
if (isBool val)
|
if (isBool val)
|
||||||
|
|
|
@ -1,14 +1,11 @@
|
||||||
{
|
{
|
||||||
|
pkgs,
|
||||||
config,
|
config,
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (builtins) toJSON;
|
inherit (builtins) toJSON;
|
||||||
inherit (lib.nvim.lua) toLuaObject;
|
inherit (lib) mkIf nvim mkLuaBinding mkMerge;
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
|
||||||
inherit (lib.nvim.dag) entryAnywhere;
|
|
||||||
inherit (lib.lists) optionals;
|
|
||||||
inherit (lib.nvim.binds) mkLuaBinding;
|
|
||||||
|
|
||||||
cfg = config.vim.assistant.copilot;
|
cfg = config.vim.assistant.copilot;
|
||||||
|
|
||||||
|
@ -28,47 +25,55 @@ in {
|
||||||
vim.startPlugins =
|
vim.startPlugins =
|
||||||
[
|
[
|
||||||
"copilot-lua"
|
"copilot-lua"
|
||||||
# cfg.copilotNodePackage
|
cfg.copilotNodePackage
|
||||||
]
|
]
|
||||||
++ optionals (cfg.cmp.enable) [
|
++ lib.optionals (cfg.cmp.enable) [
|
||||||
"copilot-cmp"
|
"copilot-cmp"
|
||||||
];
|
];
|
||||||
|
|
||||||
vim.luaConfigRC.copilot = entryAnywhere ''
|
vim.luaConfigRC.copilot = nvim.dag.entryAnywhere ''
|
||||||
require("copilot").setup(${toLuaObject cfg.setupOpts})
|
require("copilot").setup({
|
||||||
|
-- available options: https://github.com/zbirenbaum/copilot.lua
|
||||||
|
copilot_node_command = "${cfg.copilotNodeCommand}",
|
||||||
|
panel = {
|
||||||
|
enabled = ${lib.boolToString (!cfg.cmp.enable)},
|
||||||
|
keymap = {
|
||||||
|
jump_prev = false,
|
||||||
|
jump_next = false,
|
||||||
|
accept = false,
|
||||||
|
refresh = false,
|
||||||
|
open = false,
|
||||||
|
},
|
||||||
|
layout = {
|
||||||
|
position = "${cfg.panel.position}",
|
||||||
|
ratio = ${toString cfg.panel.ratio},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
suggestion = {
|
||||||
|
enabled = ${lib.boolToString (!cfg.cmp.enable)},
|
||||||
|
keymap = {
|
||||||
|
accept = false,
|
||||||
|
accept_word = false,
|
||||||
|
accept_line = false,
|
||||||
|
next = false,
|
||||||
|
prev = false,
|
||||||
|
dismiss = false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
${lib.optionalString (cfg.cmp.enable) ''
|
${lib.optionalString (cfg.cmp.enable) ''
|
||||||
require("copilot_cmp").setup()
|
require("copilot_cmp").setup()
|
||||||
''}
|
''}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# Disable plugin handled keymaps.
|
|
||||||
# Setting it here so that it doesn't show up in user docs
|
|
||||||
vim.assistant.copilot.setupOpts = {
|
|
||||||
panel.keymap = {
|
|
||||||
jump_prev = lib.mkDefault false;
|
|
||||||
jump_next = lib.mkDefault false;
|
|
||||||
accept = lib.mkDefault false;
|
|
||||||
refresh = lib.mkDefault false;
|
|
||||||
open = lib.mkDefault false;
|
|
||||||
};
|
|
||||||
suggestion.keymap = {
|
|
||||||
accept = lib.mkDefault false;
|
|
||||||
accept_word = lib.mkDefault false;
|
|
||||||
accept_line = lib.mkDefault false;
|
|
||||||
next = lib.mkDefault false;
|
|
||||||
prev = lib.mkDefault false;
|
|
||||||
dismiss = lib.mkDefault false;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
vim.maps.normal = mkMerge [
|
vim.maps.normal = mkMerge [
|
||||||
(mkLuaBinding cfg.mappings.panel.jumpPrev (wrapPanelBinding "require(\"copilot.panel\").jump_prev" cfg.mappings.panel.jumpPrev) "[copilot] Accept suggestion")
|
(mkLuaBinding cfg.mappings.panel.jumpPrev (wrapPanelBinding "require(\"copilot.panel\").jump_prev" cfg.mappings.panel.jumpPrev) "[copilot] Accept suggestion")
|
||||||
(mkLuaBinding cfg.mappings.panel.jumpNext (wrapPanelBinding "require(\"copilot.panel\").jump_next" cfg.mappings.panel.jumpNext) "[copilot] Accept suggestion")
|
(mkLuaBinding cfg.mappings.panel.jumpNext (wrapPanelBinding "require(\"copilot.panel\").jump_next" cfg.mappings.panel.jumpNext) "[copilot] Accept suggestion")
|
||||||
(mkLuaBinding cfg.mappings.panel.accept (wrapPanelBinding ''require("copilot.panel").accept'' cfg.mappings.panel.accept) "[copilot] Accept suggestion")
|
(mkLuaBinding cfg.mappings.panel.accept (wrapPanelBinding ''require("copilot.panel").accept'' cfg.mappings.panel.accept) "[copilot] Accept suggestion")
|
||||||
(mkLuaBinding cfg.mappings.panel.refresh (wrapPanelBinding "require(\"copilot.panel\").refresh" cfg.mappings.panel.refresh) "[copilot] Accept suggestion")
|
(mkLuaBinding cfg.mappings.panel.refresh (wrapPanelBinding "require(\"copilot.panel\").refresh" cfg.mappings.panel.refresh) "[copilot] Accept suggestion")
|
||||||
(mkLuaBinding cfg.mappings.panel.open (wrapPanelBinding ''
|
(mkLuaBinding cfg.mappings.panel.open (wrapPanelBinding ''
|
||||||
function() require("copilot.panel").open({ position = "${cfg.setupOpts.panel.layout.position}", ratio = ${toString cfg.setupOpts.panel.layout.ratio}, }) end
|
function() require("copilot.panel").open({ position = "${cfg.panel.position}", ratio = ${toString cfg.panel.ratio}, }) end
|
||||||
''
|
''
|
||||||
cfg.mappings.panel.open) "[copilot] Accept suggestion")
|
cfg.mappings.panel.open) "[copilot] Accept suggestion")
|
||||||
];
|
];
|
113
modules/assistant/copilot/copilot.nix
Normal file
113
modules/assistant/copilot/copilot.nix
Normal file
|
@ -0,0 +1,113 @@
|
||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib) mkEnableOption mkOption types;
|
||||||
|
|
||||||
|
cfg = config.vim.assistant.copilot;
|
||||||
|
in {
|
||||||
|
options.vim.assistant.copilot = {
|
||||||
|
enable = mkEnableOption "GitHub Copilot AI assistant";
|
||||||
|
cmp.enable = mkEnableOption "nvim-cmp integration for GitHub Copilot";
|
||||||
|
|
||||||
|
panel = {
|
||||||
|
position = mkOption {
|
||||||
|
type = types.enum [
|
||||||
|
"bottom"
|
||||||
|
"top"
|
||||||
|
"left"
|
||||||
|
"right"
|
||||||
|
];
|
||||||
|
default = "bottom";
|
||||||
|
description = "Panel position";
|
||||||
|
};
|
||||||
|
ratio = mkOption {
|
||||||
|
type = types.float;
|
||||||
|
default = 0.4;
|
||||||
|
description = "Panel size";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
mappings = {
|
||||||
|
panel = {
|
||||||
|
jumpPrev = mkOption {
|
||||||
|
type = types.nullOr types.str;
|
||||||
|
default = "[[";
|
||||||
|
description = "Jump to previous suggestion";
|
||||||
|
};
|
||||||
|
jumpNext = mkOption {
|
||||||
|
type = types.nullOr types.str;
|
||||||
|
default = "]]";
|
||||||
|
description = "Jump to next suggestion";
|
||||||
|
};
|
||||||
|
accept = mkOption {
|
||||||
|
type = types.nullOr types.str;
|
||||||
|
default = "<CR>";
|
||||||
|
description = "Accept suggestion";
|
||||||
|
};
|
||||||
|
refresh = mkOption {
|
||||||
|
type = types.nullOr types.str;
|
||||||
|
default = "gr";
|
||||||
|
description = "Refresh suggestions";
|
||||||
|
};
|
||||||
|
open = mkOption {
|
||||||
|
type = types.nullOr types.str;
|
||||||
|
default = "<M-CR>";
|
||||||
|
description = "Open suggestions";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
suggestion = {
|
||||||
|
accept = mkOption {
|
||||||
|
type = types.nullOr types.str;
|
||||||
|
default = "<M-l>";
|
||||||
|
description = "Accept suggetion";
|
||||||
|
};
|
||||||
|
acceptWord = mkOption {
|
||||||
|
type = types.nullOr types.str;
|
||||||
|
default = null;
|
||||||
|
description = "Accept next word";
|
||||||
|
};
|
||||||
|
acceptLine = mkOption {
|
||||||
|
type = types.nullOr types.str;
|
||||||
|
default = null;
|
||||||
|
description = "Accept next line";
|
||||||
|
};
|
||||||
|
prev = mkOption {
|
||||||
|
type = types.nullOr types.str;
|
||||||
|
default = "<M-[>";
|
||||||
|
description = "Previous suggestion";
|
||||||
|
};
|
||||||
|
next = mkOption {
|
||||||
|
type = types.nullOr types.str;
|
||||||
|
default = "<M-]>";
|
||||||
|
description = "Next suggestion";
|
||||||
|
};
|
||||||
|
dismiss = mkOption {
|
||||||
|
type = types.nullOr types.str;
|
||||||
|
default = "<C-]>";
|
||||||
|
description = "Dismiss suggestion";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
copilotNodeCommand = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "${lib.getExe cfg.copilotNodePackage}";
|
||||||
|
description = ''
|
||||||
|
The command that will be executed to initiate nodejs for GitHub Copilot.
|
||||||
|
Recommended to leave as default.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
copilotNodePackage = mkOption {
|
||||||
|
type = with types; nullOr package;
|
||||||
|
default = pkgs.nodejs-slim;
|
||||||
|
description = ''
|
||||||
|
The nodeJS package that will be used for GitHub Copilot. If you are using a custom node command
|
||||||
|
you may want to set this option to null so that the package is not pulled from nixpkgs.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
{
|
_: {
|
||||||
imports = [
|
imports = [
|
||||||
./copilot.nix
|
./copilot.nix
|
||||||
./config.nix
|
./config.nix
|
6
modules/assistant/default.nix
Normal file
6
modules/assistant/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
_: {
|
||||||
|
imports = [
|
||||||
|
./copilot
|
||||||
|
# ./tabnine.nix # removed until I find a way around the initialisation script the plugin requires
|
||||||
|
];
|
||||||
|
}
|
54
modules/assistant/tabnine/config.nix
Normal file
54
modules/assistant/tabnine/config.nix
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (builtins) toJSON;
|
||||||
|
inherit (lib) mkIf mkMerge mkExprBinding boolToString nvim;
|
||||||
|
|
||||||
|
cfg = config.vim.assistant.tabnine;
|
||||||
|
in {
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
vim.startPlugins = ["tabnine-nvim"];
|
||||||
|
|
||||||
|
vim.maps.insert = mkMerge [
|
||||||
|
(mkExprBinding cfg.mappings.accept ''
|
||||||
|
function()
|
||||||
|
local state = require("tabnine.state")
|
||||||
|
local completion = require("tabnine.completion")
|
||||||
|
|
||||||
|
if not state.completions_cache then
|
||||||
|
return "${toJSON cfg.mappings.accept}"
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.schedule(completion.accept)
|
||||||
|
end
|
||||||
|
'' "orzel")
|
||||||
|
(mkExprBinding cfg.mappings.dismiss ''
|
||||||
|
function()
|
||||||
|
local state = require("tabnine.state")
|
||||||
|
local completion = require("tabnine.completion")
|
||||||
|
|
||||||
|
if not state.completions_cache then
|
||||||
|
return "${toJSON cfg.mappings.dismiss}"
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.schedule(function()
|
||||||
|
completion.clear()
|
||||||
|
state.completions_cache = nil
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
'' "orzel")
|
||||||
|
];
|
||||||
|
|
||||||
|
vim.luaConfigRC.tabnine-nvim = nvim.dag.entryAnywhere ''
|
||||||
|
require('tabnine').setup({
|
||||||
|
disable_auto_comment = ${boolToString cfg.disable_auto_comment},
|
||||||
|
accept_keymap = null,
|
||||||
|
dismiss_keymap = null,
|
||||||
|
debounce_ms = ${cfg.debounce_ms},
|
||||||
|
exclude_filetypes = ${cfg.exclude_filetypes},
|
||||||
|
})
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
_: {
|
||||||
imports = [
|
imports = [
|
||||||
./chatgpt.nix
|
|
||||||
./config.nix
|
./config.nix
|
||||||
|
./tabnine.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
30
modules/assistant/tabnine/tabnine.nix
Normal file
30
modules/assistant/tabnine/tabnine.nix
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
{lib, ...}: let
|
||||||
|
inherit (lib) mkEnableOption mkOption types mkMappingOption;
|
||||||
|
in {
|
||||||
|
options.vim.assistant.tabnine = {
|
||||||
|
enable = mkEnableOption "Tabnine assistant";
|
||||||
|
|
||||||
|
disable_auto_comment = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = true;
|
||||||
|
description = "Disable auto comment";
|
||||||
|
};
|
||||||
|
|
||||||
|
mappings = {
|
||||||
|
accept = mkMappingOption "Accept [Tabnine]" "<Tab>";
|
||||||
|
dismiss = mkMappingOption "Dismiss [Tabnine]" "<C-]>";
|
||||||
|
};
|
||||||
|
|
||||||
|
debounce_ms = mkOption {
|
||||||
|
type = types.int;
|
||||||
|
default = 800;
|
||||||
|
description = "Debounce ms";
|
||||||
|
};
|
||||||
|
|
||||||
|
exclude_filetypes = mkOption {
|
||||||
|
type = types.listOf types.str;
|
||||||
|
default = ["TelescopePrompt" "NvimTree" "alpha"];
|
||||||
|
description = "Exclude filetypes";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
{
|
_: {
|
||||||
imports = [
|
imports = [
|
||||||
./nvim-autopairs
|
./nvim-autopairs
|
||||||
];
|
];
|
26
modules/autopairs/nvim-autopairs/config.nix
Normal file
26
modules/autopairs/nvim-autopairs/config.nix
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib) mkIf nvim optionalString boolToString;
|
||||||
|
|
||||||
|
cfg = config.vim.autopairs;
|
||||||
|
in {
|
||||||
|
config =
|
||||||
|
mkIf (cfg.enable)
|
||||||
|
{
|
||||||
|
vim.startPlugins = ["nvim-autopairs"];
|
||||||
|
|
||||||
|
vim.luaConfigRC.autopairs = nvim.dag.entryAnywhere ''
|
||||||
|
require("nvim-autopairs").setup{}
|
||||||
|
${optionalString (config.vim.autocomplete.type == "nvim-compe") ''
|
||||||
|
require('nvim-autopairs.completion.compe').setup({
|
||||||
|
map_cr = ${boolToString cfg.nvim-compe.map_cr},
|
||||||
|
map_complete = ${boolToString cfg.nvim-compe.map_complete},
|
||||||
|
auto_select = ${boolToString cfg.nvim-compe.auto_select},
|
||||||
|
})
|
||||||
|
''}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
{
|
_: {
|
||||||
imports = [
|
imports = [
|
||||||
./config.nix
|
./config.nix
|
||||||
./nvim-autopairs.nix
|
./nvim-autopairs.nix
|
35
modules/autopairs/nvim-autopairs/nvim-autopairs.nix
Normal file
35
modules/autopairs/nvim-autopairs/nvim-autopairs.nix
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
{lib, ...}: let
|
||||||
|
inherit (lib) mkEnableOption mkOption types;
|
||||||
|
in {
|
||||||
|
options.vim = {
|
||||||
|
autopairs = {
|
||||||
|
enable = mkEnableOption "autopairs" // {default = false;};
|
||||||
|
|
||||||
|
type = mkOption {
|
||||||
|
type = types.enum ["nvim-autopairs"];
|
||||||
|
default = "nvim-autopairs";
|
||||||
|
description = "Set the autopairs type. Options: nvim-autopairs [nvim-autopairs]";
|
||||||
|
};
|
||||||
|
|
||||||
|
nvim-compe = {
|
||||||
|
map_cr = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = true;
|
||||||
|
description = ''map <CR> on insert mode'';
|
||||||
|
};
|
||||||
|
|
||||||
|
map_complete = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = true;
|
||||||
|
description = "auto insert `(` after select function or method item";
|
||||||
|
};
|
||||||
|
|
||||||
|
auto_select = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = "auto select first item";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
185
modules/basic/config.nix
Normal file
185
modules/basic/config.nix
Normal file
|
@ -0,0 +1,185 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (builtins) concatStringsSep;
|
||||||
|
inherit (lib) optionalString mkIf nvim;
|
||||||
|
|
||||||
|
cfg = config.vim;
|
||||||
|
in {
|
||||||
|
config = {
|
||||||
|
vim.startPlugins = ["plenary-nvim"] ++ lib.optionals (cfg.spellChecking.enableProgrammingWordList) ["vim-dirtytalk"];
|
||||||
|
|
||||||
|
vim.maps.normal =
|
||||||
|
mkIf cfg.disableArrows {
|
||||||
|
"<up>" = {
|
||||||
|
action = "<nop>";
|
||||||
|
|
||||||
|
noremap = false;
|
||||||
|
};
|
||||||
|
"<down>" = {
|
||||||
|
action = "<nop>";
|
||||||
|
|
||||||
|
noremap = false;
|
||||||
|
};
|
||||||
|
"<left>" = {
|
||||||
|
action = "<nop>";
|
||||||
|
noremap = false;
|
||||||
|
};
|
||||||
|
"<right>" = {
|
||||||
|
action = "<nop>";
|
||||||
|
noremap = false;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
// mkIf cfg.mapLeaderSpace {
|
||||||
|
"<space>" = {
|
||||||
|
action = "<nop>";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
vim.maps.insert = mkIf cfg.disableArrows {
|
||||||
|
"<up>" = {
|
||||||
|
action = "<nop>";
|
||||||
|
noremap = false;
|
||||||
|
};
|
||||||
|
"<down>" = {
|
||||||
|
action = "<nop>";
|
||||||
|
noremap = false;
|
||||||
|
};
|
||||||
|
"<left>" = {
|
||||||
|
action = "<nop>";
|
||||||
|
noremap = false;
|
||||||
|
};
|
||||||
|
"<right>" = {
|
||||||
|
action = "<nop>";
|
||||||
|
noremap = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
vim.configRC.basic = nvim.dag.entryAfter ["globalsScript"] ''
|
||||||
|
" Settings that are set for everything
|
||||||
|
set encoding=utf-8
|
||||||
|
set mouse=${cfg.mouseSupport}
|
||||||
|
set tabstop=${toString cfg.tabWidth}
|
||||||
|
set shiftwidth=${toString cfg.tabWidth}
|
||||||
|
set softtabstop=${toString cfg.tabWidth}
|
||||||
|
set expandtab
|
||||||
|
set cmdheight=${toString cfg.cmdHeight}
|
||||||
|
set updatetime=${toString cfg.updateTime}
|
||||||
|
set shortmess+=c
|
||||||
|
set tm=${toString cfg.mapTimeout}
|
||||||
|
set hidden
|
||||||
|
set cursorlineopt=${toString cfg.cursorlineOpt}
|
||||||
|
set scrolloff=${toString cfg.scrollOffset}
|
||||||
|
|
||||||
|
${optionalString cfg.debugMode.enable ''
|
||||||
|
" Debug mode settings
|
||||||
|
set verbose=${toString cfg.debugMode.level}
|
||||||
|
set verbosefile=${cfg.debugMode.logFile}
|
||||||
|
''}
|
||||||
|
|
||||||
|
${optionalString cfg.splitBelow ''
|
||||||
|
set splitbelow
|
||||||
|
''}
|
||||||
|
|
||||||
|
${optionalString cfg.splitRight ''
|
||||||
|
set splitright
|
||||||
|
''}
|
||||||
|
|
||||||
|
${optionalString cfg.showSignColumn ''
|
||||||
|
set signcolumn=yes
|
||||||
|
''}
|
||||||
|
|
||||||
|
${optionalString cfg.autoIndent ''
|
||||||
|
set autoindent
|
||||||
|
''}
|
||||||
|
|
||||||
|
${optionalString cfg.preventJunkFiles ''
|
||||||
|
set noswapfile
|
||||||
|
set nobackup
|
||||||
|
set nowritebackup
|
||||||
|
''}
|
||||||
|
|
||||||
|
${optionalString (cfg.bell == "none") ''
|
||||||
|
set noerrorbells
|
||||||
|
set novisualbell
|
||||||
|
''}
|
||||||
|
|
||||||
|
${optionalString (cfg.bell == "on") ''
|
||||||
|
set novisualbell
|
||||||
|
''}
|
||||||
|
|
||||||
|
${optionalString (cfg.bell == "visual") ''
|
||||||
|
set noerrorbells
|
||||||
|
''}
|
||||||
|
|
||||||
|
${optionalString (cfg.lineNumberMode == "relative") ''
|
||||||
|
set relativenumber
|
||||||
|
''}
|
||||||
|
|
||||||
|
${optionalString (cfg.lineNumberMode == "number") ''
|
||||||
|
set number
|
||||||
|
''}
|
||||||
|
|
||||||
|
${optionalString (cfg.lineNumberMode == "relNumber") ''
|
||||||
|
set number relativenumber
|
||||||
|
''}
|
||||||
|
|
||||||
|
${optionalString cfg.useSystemClipboard ''
|
||||||
|
set clipboard+=unnamedplus
|
||||||
|
''}
|
||||||
|
|
||||||
|
${optionalString cfg.mapLeaderSpace ''
|
||||||
|
let mapleader=" "
|
||||||
|
let maplocalleader=" "
|
||||||
|
''}
|
||||||
|
|
||||||
|
${optionalString cfg.syntaxHighlighting ''
|
||||||
|
syntax on
|
||||||
|
''}
|
||||||
|
|
||||||
|
${optionalString (!cfg.wordWrap) ''
|
||||||
|
set nowrap
|
||||||
|
''}
|
||||||
|
|
||||||
|
${optionalString cfg.hideSearchHighlight ''
|
||||||
|
set nohlsearch
|
||||||
|
set incsearch
|
||||||
|
''}
|
||||||
|
|
||||||
|
${optionalString cfg.colourTerm ''
|
||||||
|
set termguicolors
|
||||||
|
set t_Co=256
|
||||||
|
''}
|
||||||
|
|
||||||
|
${optionalString (!cfg.enableEditorconfig) ''
|
||||||
|
let g:editorconfig = v:false
|
||||||
|
''}
|
||||||
|
|
||||||
|
${optionalString cfg.spellChecking.enable ''
|
||||||
|
set spell
|
||||||
|
set spelllang=${concatStringsSep "," cfg.spellChecking.languages}${optionalString cfg.spellChecking.enableProgrammingWordList ",programming"}
|
||||||
|
''}
|
||||||
|
|
||||||
|
${optionalString (cfg.leaderKey != null) ''
|
||||||
|
let mapleader = "${toString cfg.leaderKey}"
|
||||||
|
''}
|
||||||
|
|
||||||
|
${optionalString (cfg.searchCase == "ignore") ''
|
||||||
|
set nosmartcase
|
||||||
|
set ignorecase
|
||||||
|
''}
|
||||||
|
|
||||||
|
${optionalString (cfg.searchCase == "smart") ''
|
||||||
|
set smartcase
|
||||||
|
set ignorecase
|
||||||
|
''}
|
||||||
|
|
||||||
|
${optionalString (cfg.searchCase == "sensitive") ''
|
||||||
|
set nosmartcase
|
||||||
|
set noignorecase
|
||||||
|
''}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
_: {
|
||||||
imports = [
|
imports = [
|
||||||
./config.nix
|
./config.nix
|
||||||
./options.nix
|
./module.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
200
modules/basic/module.nix
Normal file
200
modules/basic/module.nix
Normal file
|
@ -0,0 +1,200 @@
|
||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib) mkEnableOption mkOption;
|
||||||
|
inherit (lib.types) types;
|
||||||
|
in {
|
||||||
|
options.vim = {
|
||||||
|
package = mkOption {
|
||||||
|
type = types.package;
|
||||||
|
default = pkgs.neovim-unwrapped;
|
||||||
|
description = ''
|
||||||
|
The neovim package to use. You will need to use an unwrapped package for this option to work as intended.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
debugMode = {
|
||||||
|
enable = mkEnableOption "debug mode";
|
||||||
|
level = mkOption {
|
||||||
|
type = types.int;
|
||||||
|
default = 20;
|
||||||
|
description = "Set the debug level";
|
||||||
|
};
|
||||||
|
|
||||||
|
logFile = mkOption {
|
||||||
|
type = types.path;
|
||||||
|
default = "/tmp/nvim.log";
|
||||||
|
description = "Set the log file";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
enableLuaLoader = mkEnableOption "experimental Lua module loader to speed up the start up process";
|
||||||
|
|
||||||
|
leaderKey = mkOption {
|
||||||
|
type = with types; nullOr str;
|
||||||
|
default = null;
|
||||||
|
description = "The leader key to be used internally";
|
||||||
|
};
|
||||||
|
|
||||||
|
spellChecking = {
|
||||||
|
enable = mkEnableOption "neovim's built-in spellchecking";
|
||||||
|
enableProgrammingWordList = mkEnableOption "vim-dirtytalk, a wordlist for programmers, that includes programming words";
|
||||||
|
languages = mkOption {
|
||||||
|
type = with types; listOf str;
|
||||||
|
description = "The languages to be used for spellchecking";
|
||||||
|
default = ["en"];
|
||||||
|
example = ["en" "de"];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
colourTerm = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = true;
|
||||||
|
description = "Set terminal up for 256 colours";
|
||||||
|
};
|
||||||
|
|
||||||
|
disableArrows = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = "Set to prevent arrow keys from moving cursor";
|
||||||
|
};
|
||||||
|
|
||||||
|
hideSearchHighlight = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = "Hide search highlight so it doesn't stay highlighted";
|
||||||
|
};
|
||||||
|
|
||||||
|
scrollOffset = mkOption {
|
||||||
|
type = types.int;
|
||||||
|
default = 8;
|
||||||
|
description = "Start scrolling this number of lines from the top or bottom of the page.";
|
||||||
|
};
|
||||||
|
|
||||||
|
wordWrap = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = true;
|
||||||
|
description = "Enable word wrapping.";
|
||||||
|
};
|
||||||
|
|
||||||
|
syntaxHighlighting = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = true;
|
||||||
|
description = "Enable syntax highlighting";
|
||||||
|
};
|
||||||
|
|
||||||
|
mapLeaderSpace = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = true;
|
||||||
|
description = "Map the space key to leader key";
|
||||||
|
};
|
||||||
|
|
||||||
|
useSystemClipboard = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = "Make use of the clipboard for default yank and paste operations. Don't use * and +";
|
||||||
|
};
|
||||||
|
|
||||||
|
mouseSupport = mkOption {
|
||||||
|
type = with types; enum ["a" "n" "v" "i" "c"];
|
||||||
|
default = "a";
|
||||||
|
description = ''
|
||||||
|
Set modes for mouse support.
|
||||||
|
|
||||||
|
* a - all
|
||||||
|
* n - normal
|
||||||
|
* v - visual
|
||||||
|
* i - insert
|
||||||
|
* c - command
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
lineNumberMode = mkOption {
|
||||||
|
type = with types; enum ["relative" "number" "relNumber" "none"];
|
||||||
|
default = "relNumber";
|
||||||
|
description = ''
|
||||||
|
How line numbers are displayed. Available options are
|
||||||
|
none, relative, number, relNumber
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
preventJunkFiles = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = "Prevent swapfile, backupfile from being created";
|
||||||
|
};
|
||||||
|
|
||||||
|
tabWidth = mkOption {
|
||||||
|
type = types.int;
|
||||||
|
default = 4;
|
||||||
|
description = "Set the width of tabs";
|
||||||
|
};
|
||||||
|
|
||||||
|
autoIndent = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = true;
|
||||||
|
description = "Enable auto indent";
|
||||||
|
};
|
||||||
|
|
||||||
|
cmdHeight = mkOption {
|
||||||
|
type = types.int;
|
||||||
|
default = 1;
|
||||||
|
description = "Height of the command pane";
|
||||||
|
};
|
||||||
|
|
||||||
|
updateTime = mkOption {
|
||||||
|
type = types.int;
|
||||||
|
default = 300;
|
||||||
|
description = "The number of milliseconds till Cursor Hold event is fired";
|
||||||
|
};
|
||||||
|
|
||||||
|
showSignColumn = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = true;
|
||||||
|
description = "Show the sign column";
|
||||||
|
};
|
||||||
|
|
||||||
|
bell = mkOption {
|
||||||
|
type = types.enum ["none" "visual" "on"];
|
||||||
|
default = "none";
|
||||||
|
description = "Set how bells are handled. Options: on, visual or none";
|
||||||
|
};
|
||||||
|
|
||||||
|
mapTimeout = mkOption {
|
||||||
|
type = types.int;
|
||||||
|
default = 500;
|
||||||
|
description = "Timeout in ms that neovim will wait for mapped action to complete";
|
||||||
|
};
|
||||||
|
|
||||||
|
splitBelow = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = true;
|
||||||
|
description = "New splits will open below instead of on top";
|
||||||
|
};
|
||||||
|
|
||||||
|
splitRight = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = true;
|
||||||
|
description = "New splits will open to the right";
|
||||||
|
};
|
||||||
|
enableEditorconfig = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = true;
|
||||||
|
description = "Follow editorconfig rules in current directory";
|
||||||
|
};
|
||||||
|
|
||||||
|
cursorlineOpt = mkOption {
|
||||||
|
type = types.enum ["line" "screenline" "number" "both"];
|
||||||
|
default = "line";
|
||||||
|
description = "Highlight the text line of the cursor with CursorLine hl-CursorLine";
|
||||||
|
};
|
||||||
|
|
||||||
|
searchCase = mkOption {
|
||||||
|
type = types.enum ["ignore" "smart" "sensitive"];
|
||||||
|
default = "sensitive";
|
||||||
|
description = "Set the case sensitivity of search";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,6 +1,5 @@
|
||||||
{lib, ...}: let
|
{lib, ...}: let
|
||||||
inherit (lib.options) mkEnableOption;
|
inherit (lib) mkEnableOption mkMappingOption;
|
||||||
inherit (lib.nvim.binds) mkMappingOption;
|
|
||||||
in {
|
in {
|
||||||
options.vim.comments.comment-nvim = {
|
options.vim.comments.comment-nvim = {
|
||||||
enable = mkEnableOption "smart and powerful comment plugin for neovim comment-nvim";
|
enable = mkEnableOption "smart and powerful comment plugin for neovim comment-nvim";
|
|
@ -3,13 +3,13 @@
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
inherit (lib) mkIf mkMerge mkExprBinding mkBinding nvim;
|
||||||
inherit (lib.nvim.binds) mkExprBinding mkBinding;
|
|
||||||
inherit (lib.nvim.dag) entryAnywhere;
|
|
||||||
|
|
||||||
cfg = config.vim.comments.comment-nvim;
|
cfg = config.vim.comments.comment-nvim;
|
||||||
self = import ./comment-nvim.nix {inherit lib;};
|
self = import ./comment-nvim.nix {
|
||||||
inherit (self.options.vim.comments.comment-nvim) mappings;
|
inherit lib;
|
||||||
|
};
|
||||||
|
mappings = self.options.vim.comments.comment-nvim.mappings;
|
||||||
in {
|
in {
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
vim.startPlugins = [
|
vim.startPlugins = [
|
||||||
|
@ -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.luaConfigRC.comment-nvim = entryAnywhere ''
|
vim.luaConfigRC.comment-nvim = nvim.dag.entryAnywhere ''
|
||||||
require('Comment').setup({
|
require('Comment').setup({
|
||||||
mappings = { basic = false, extra = false, },
|
mappings = { basic = false, extra = false, },
|
||||||
})
|
})
|
|
@ -1,4 +1,4 @@
|
||||||
{
|
_: {
|
||||||
imports = [
|
imports = [
|
||||||
./config.nix
|
./config.nix
|
||||||
./comment-nvim.nix
|
./comment-nvim.nix
|
|
@ -1,4 +1,4 @@
|
||||||
{
|
_: {
|
||||||
imports = [
|
imports = [
|
||||||
./comment-nvim
|
./comment-nvim
|
||||||
];
|
];
|
|
@ -1,4 +1,4 @@
|
||||||
{
|
_: {
|
||||||
imports = [
|
imports = [
|
||||||
./nvim-cmp
|
./nvim-cmp
|
||||||
];
|
];
|
|
@ -4,11 +4,8 @@
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (builtins) toJSON;
|
inherit (builtins) toJSON;
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
inherit (lib) addDescriptionsToMappings concatMapStringsSep attrNames concatStringsSep mapAttrsToList mkIf mkSetLuaBinding mkMerge optionalString;
|
||||||
inherit (lib.attrsets) attrNames mapAttrsToList;
|
inherit (lib.nvim) dag;
|
||||||
inherit (lib.strings) concatMapStringsSep concatStringsSep optionalString;
|
|
||||||
inherit (lib.nvim.binds) addDescriptionsToMappings mkSetLuaBinding;
|
|
||||||
inherit (lib.nvim.dag) entryAnywhere entryAfter;
|
|
||||||
|
|
||||||
cfg = config.vim.autocomplete;
|
cfg = config.vim.autocomplete;
|
||||||
lspkindEnabled = config.vim.lsp.enable && config.vim.lsp.lspkind.enable;
|
lspkindEnabled = config.vim.lsp.enable && config.vim.lsp.lspkind.enable;
|
||||||
|
@ -36,8 +33,8 @@
|
||||||
|
|
||||||
dagPlacement =
|
dagPlacement =
|
||||||
if lspkindEnabled
|
if lspkindEnabled
|
||||||
then entryAfter ["lspkind"]
|
then dag.entryAfter ["lspkind"]
|
||||||
else entryAnywhere;
|
else dag.entryAnywhere;
|
||||||
in {
|
in {
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
vim.startPlugins = [
|
vim.startPlugins = [
|
||||||
|
@ -188,6 +185,7 @@ in {
|
||||||
vim_item.menu = ({
|
vim_item.menu = ({
|
||||||
${builtMaps}
|
${builtMaps}
|
||||||
})[entry.source.name]
|
})[entry.source.name]
|
||||||
|
print(vim_item.menu)
|
||||||
return vim_item
|
return vim_item
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -197,7 +195,7 @@ in {
|
||||||
|
|
||||||
local cmp = require'cmp'
|
local cmp = require'cmp'
|
||||||
cmp.setup({
|
cmp.setup({
|
||||||
${optionalString config.vim.ui.borders.enable ''
|
${optionalString (config.vim.ui.borders.enable) ''
|
||||||
-- explicitly enabled by setting ui.borders.enable = true
|
-- explicitly enabled by setting ui.borders.enable = true
|
||||||
-- TODO: try to get nvim-cmp to follow global border style
|
-- TODO: try to get nvim-cmp to follow global border style
|
||||||
window = {
|
window = {
|
||||||
|
@ -218,7 +216,6 @@ in {
|
||||||
|
|
||||||
completion = {
|
completion = {
|
||||||
completeopt = 'menu,menuone,noinsert',
|
completeopt = 'menu,menuone,noinsert',
|
||||||
${optionalString (!cfg.alwaysComplete) "autocomplete = false"}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
formatting = {
|
formatting = {
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue