2024-02-22 13:32:26 -08:00
|
|
|
# nix-gen-luarc-json
|
2024-02-22 13:48:54 -08:00
|
|
|
|
2024-02-22 13:32:26 -08:00
|
|
|
Generate a .luarc.json for Lua/Neovim devShells
|
2024-02-22 13:45:09 -08:00
|
|
|
|
2024-02-22 13:48:54 -08:00
|
|
|
## Usage
|
|
|
|
|
|
|
|
Apply this flake's overlay.
|
|
|
|
It provides a `mk-luarc-json` function,
|
|
|
|
which takes an attrset with the following arguments:
|
|
|
|
|
|
|
|
- `nvim`: The neovim package. Defaults to `neovim-unwrapped`.
|
2024-02-22 14:27:40 -08:00
|
|
|
- `plugins`: List of Neovim plugins and/or luarocks packages.
|
2024-02-22 13:48:54 -08:00
|
|
|
Defaults to an empty list.
|
2024-02-22 14:27:40 -08:00
|
|
|
- `lua-version`: Defaults to `"5.1"`.
|
2024-02-23 03:27:34 -08:00
|
|
|
- `disabled-diagnostics`: Defaults to an empty list..
|
2024-02-22 13:48:54 -08:00
|
|
|
|
2024-02-22 13:57:32 -08:00
|
|
|
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
|
|
|
|
'';
|
|
|
|
```
|
|
|
|
|
2024-02-22 13:45:09 -08:00
|
|
|
## License
|
|
|
|
|
|
|
|
This flake is [licensed according to GPL version 2](./LICENSE),
|
|
|
|
with the following exception:
|
|
|
|
|
|
|
|
The license applies only to the Nix infrastructure provided by this
|
|
|
|
repository, including any modifications made to it.
|
|
|
|
Any software that uses this flake may be licensed under any
|
|
|
|
[OSI approved open source license](https://opensource.org/licenses/),
|
|
|
|
without being subject to the GPL version 2 license of this template.
|