From 359462b075f5ba7e80e51950af99601e795e81d9 Mon Sep 17 00:00:00 2001 From: LeMarsu Date: Fri, 31 May 2024 02:36:46 +0200 Subject: [PATCH] feat: add `viAlias` and `vimAlias` mkNeovimPkg options --- README.md | 11 +++++++++++ lib/mkNeovimPkg.nix | 7 ++++++- lib/types.nix | 6 ++++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 11b0cae..8bdf1a2 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,7 @@ A [neovim] plugin and configuration management plugin, highly inspired by [lazy] - [`:Sloth` command](#sloth-command) - [`list` subcommand](#list-subcommand) - [`load` subcommand](#load-subcommand) + - [`version` subcommand](#version-subcommand) - [API](#api) @@ -91,6 +92,8 @@ Once installed, you can call the `sloth-flake.lib.mkNeovimPkg` to build your neo ```nix sloth-flake.lib.mkNeovimPkg { inherit pkgs; + viAlias = true; + vimAlias = true; runtime = { version = "0.1"; src = sloth-flake.lib.sourcesWith ./. [ @@ -132,6 +135,8 @@ Here's a list of all accepted arguments | `runtime` | `{}` | Your Runtime configuration (see below) | | `dependencies` | `[]` | A list of your dependencies (see below) | | `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: @@ -231,6 +236,12 @@ Summary: Load lazy plugins. Usage: `Sloth load [plugin [...]]` - `plugin`: a plugin to load +##### `version` subcommand + +Summary: Return Sloth version + +Usage: `Sloth version` + #### API The lua API is not really defined yet. This documentation will be completed then. diff --git a/lib/mkNeovimPkg.nix b/lib/mkNeovimPkg.nix index 50fbbb2..2acdf0f 100644 --- a/lib/mkNeovimPkg.nix +++ b/lib/mkNeovimPkg.nix @@ -7,6 +7,8 @@ dependencies ? [], dependenciesExtraArgs ? {}, runtime ? {}, + viAlias ? false, + vimAlias ? false, ... } @ config: let inherit (builtins) map; @@ -42,6 +44,9 @@ plugins = extractPlugins plugins; } // {luaRcContent = customRC;}; - pkg = pkgs.wrapNeovimUnstable package (removeAttrs neovimConfig ["manifestRc" "neovimRcContent"]); + params = + removeAttrs neovimConfig ["manifestRc" "neovimRcContent"] + // {inherit viAlias vimAlias;}; + pkg = pkgs.wrapNeovimUnstable package params; in builtins.seq (types.mkNeovimPkgOptions config) pkg diff --git a/lib/types.nix b/lib/types.nix index fd54a11..e54edff 100644 --- a/lib/types.nix +++ b/lib/types.nix @@ -86,5 +86,11 @@ # Runtime configuration runtime = runtimeType; + + # Create a vi alias + viAlias = option bool; + + # Create a vim alias + vimAlias = option bool; }; }