feat: add `viAlias` and `vimAlias` mkNeovimPkg options

main
LeMarsu 2024-05-31 02:36:46 +02:00
parent 2903d288e2
commit 359462b075
3 changed files with 23 additions and 1 deletions

View File

@ -19,6 +19,7 @@ A [neovim] plugin and configuration management plugin, highly inspired by [lazy]
- [`:Sloth` command](#sloth-command) - [`:Sloth` command](#sloth-command)
- [`list` subcommand](#list-subcommand) - [`list` subcommand](#list-subcommand)
- [`load` subcommand](#load-subcommand) - [`load` subcommand](#load-subcommand)
- [`version` subcommand](#version-subcommand)
- [API](#api) - [API](#api)
<!-- TOC --> <!-- TOC -->
@ -91,6 +92,8 @@ Once installed, you can call the `sloth-flake.lib.mkNeovimPkg` to build your neo
```nix ```nix
sloth-flake.lib.mkNeovimPkg { sloth-flake.lib.mkNeovimPkg {
inherit pkgs; inherit pkgs;
viAlias = true;
vimAlias = true;
runtime = { runtime = {
version = "0.1"; version = "0.1";
src = sloth-flake.lib.sourcesWith ./. [ src = sloth-flake.lib.sourcesWith ./. [
@ -132,6 +135,8 @@ Here's a list of all accepted arguments
| `runtime` | `{}` | Your Runtime configuration (see below) | | `runtime` | `{}` | Your Runtime configuration (see below) |
| `dependencies` | `[]` | A list of your dependencies (see below) | | `dependencies` | `[]` | A list of your dependencies (see below) |
| `dependenciesExtraArgs` | `{}` | Extra arguments to load your dependencies in other files | | `dependenciesExtraArgs` | `{}` | Extra arguments to load your dependencies in other files |
| `viAlias` | `false` | Wether to create a `vi` alias to run neovim |
| `vimAlias` | `false` | Wether to create a `vim` alias to run neovim |
The Runtime configuration object accepts the following properties: The Runtime configuration object accepts the following properties:
@ -231,6 +236,12 @@ Summary: Load lazy plugins.
Usage: `Sloth load <plugin> [plugin [...]]` Usage: `Sloth load <plugin> [plugin [...]]`
- `plugin`: a plugin to load - `plugin`: a plugin to load
##### `version` subcommand
Summary: Return Sloth version
Usage: `Sloth version`
#### API #### API
The lua API is not really defined yet. This documentation will be completed then. The lua API is not really defined yet. This documentation will be completed then.

View File

@ -7,6 +7,8 @@
dependencies ? [], dependencies ? [],
dependenciesExtraArgs ? {}, dependenciesExtraArgs ? {},
runtime ? {}, runtime ? {},
viAlias ? false,
vimAlias ? false,
... ...
} @ config: let } @ config: let
inherit (builtins) map; inherit (builtins) map;
@ -42,6 +44,9 @@
plugins = extractPlugins plugins; plugins = extractPlugins plugins;
} }
// {luaRcContent = customRC;}; // {luaRcContent = customRC;};
pkg = pkgs.wrapNeovimUnstable package (removeAttrs neovimConfig ["manifestRc" "neovimRcContent"]); params =
removeAttrs neovimConfig ["manifestRc" "neovimRcContent"]
// {inherit viAlias vimAlias;};
pkg = pkgs.wrapNeovimUnstable package params;
in in
builtins.seq (types.mkNeovimPkgOptions config) pkg builtins.seq (types.mkNeovimPkgOptions config) pkg

View File

@ -86,5 +86,11 @@
# Runtime configuration # Runtime configuration
runtime = runtimeType; runtime = runtimeType;
# Create a vi alias
viAlias = option bool;
# Create a vim alias
vimAlias = option bool;
}; };
} }