From b674635702ae341e24b2bd0e33ee7a2c28e99af6 Mon Sep 17 00:00:00 2001 From: Marc Jakobi Date: Thu, 22 Feb 2024 22:57:32 +0100 Subject: [PATCH] docs(readme): add usage example --- README.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/README.md b/README.md index c1988d2..90f4d63 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,36 @@ which takes an attrset with the following arguments: - Plugins: List of Neovim plugins and/or luarocks packages. Defaults to an empty list. +Example: + +Import this flake: + +```nix +#flake.nix +inputs.gen-luarc.url = "github:mrcjkb/nix-gen-luarc-json"; +``` + +Add the overlay: + +```nix +pkgs = import nixpkgs { + inherit system; + overlays = [ + gen-luarc.overlays.default + ]; +}; +``` + +Generate a `.luarc.json` in your `shellHook`: + +```nix +shellHook = let + luarc = pkgs.mk-luarc-json { plugins = with pkgs.vimPlugins; [ nvim-treesitter ]; }; +in /* bash */ '' + ln -fs {luarc} .luarc.json +''; +``` + ## License This flake is [licensed according to GPL version 2](./LICENSE),