1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-22 10:19:39 +01:00

programs.neovim: add extraLuaConfig (#3639)

* programs.neovim: add extraLuaConfig

Add a configuration option to add custom lua configuration lines to
`lua.init`.

* apply review: formatting

* apply review: fix test
This commit is contained in:
Guillaume Desforges 2023-02-05 12:09:26 +01:00 committed by GitHub
parent 9f4268e6b6
commit 9621e9ab80
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 37 additions and 1 deletions

View file

@ -261,6 +261,17 @@ in {
'';
};
extraLuaConfig = mkOption {
type = types.lines;
default = "";
example = ''
vim.opt.nobackup = true
'';
description = ''
Custom lua lines.
'';
};
extraPackages = mkOption {
type = with types; listOf package;
default = [ ];
@ -394,7 +405,8 @@ in {
"vim.cmd [[source ${
pkgs.writeText "nvim-init-home-manager.vim"
neovimConfig.neovimRcContent
}]]" + lib.optionalString hasLuaConfig
}]]" + config.programs.neovim.extraLuaConfig
+ lib.optionalString hasLuaConfig
config.programs.neovim.generatedConfigs.lua;
in mkIf (luaRcContent != "") { text = luaRcContent; };