feat(nvim): format init.lua

nixos
Moritz Böhme 2023-08-10 18:40:41 +02:00
parent c8f53dfe2e
commit 3180e64085
Signed by: moritz
GPG Key ID: 970C6E89EB0547A9
1 changed files with 12 additions and 5 deletions

View File

@ -63,9 +63,7 @@ let
); );
lazySpecs = listToStringMultiLine id (map lazySpecFromPlugin cfg.plugins); lazySpecs = listToStringMultiLine id (map lazySpecFromPlugin cfg.plugins);
lazy = '' lazy = ''
require("lazy").setup({ require("lazy").setup(${lazySpecs})
${lazySpecs}
})
''; '';
in in
{ {
@ -213,7 +211,17 @@ in
else neovide else neovide
) )
]; ];
xdg.configFile."nvim/init.lua" = {
source =
let
text = lib.concatLines [ (builtins.readFile ./options.lua) lazy ];
in
pkgs.runCommand "init.lua" { inherit text; } ''
touch $out
echo -n "$text" > $out
${getExe pkgs.stylua} $out
'';
};
programs.neovim = { programs.neovim = {
enable = true; enable = true;
package = pkgs.neovim-nightly; package = pkgs.neovim-nightly;
@ -221,7 +229,6 @@ in
vimdiffAlias = true; vimdiffAlias = true;
withNodeJs = true; withNodeJs = true;
withPython3 = true; withPython3 = true;
extraLuaConfig = lib.concatLines [ (builtins.readFile ./options.lua) lazy ];
extraPython3Packages = ps: extraPython3Packages = ps:
let let
plugins = map (getAttr "plugin") cfg.plugins; plugins = map (getAttr "plugin") cfg.plugins;