feat!: do not format by default

main
Moritz Böhme 2023-10-27 17:38:49 +02:00
parent 1dc6361600
commit 408ab5cad3
Signed by: moritz
GPG Key ID: 970C6E89EB0547A9
1 changed files with 4 additions and 2 deletions

View File

@ -54,17 +54,19 @@ let
require("lazy").setup(${lazySpecs}) require("lazy").setup(${lazySpecs})
''; '';
lazy = formatted =
pkgs.runCommand "lazy.lua" { inherit text; } '' pkgs.runCommand "lazy.lua" { inherit text; } ''
touch $out touch $out
echo -n "$text" > $out echo -n "$text" > $out
${getExe pkgs.stylua} $out ${getExe pkgs.stylua} $out
''; '';
lazy = if cfg.format then readFile formatted else text;
in in
{ {
options.programs.neovim.lazy = { options.programs.neovim.lazy = {
enable = mkEnableOption "lazy.nvim"; enable = mkEnableOption "lazy.nvim";
format = mkEnableOption "format";
plugins = mkOption plugins = mkOption
{ {
default = [ ]; default = [ ];
@ -219,7 +221,7 @@ in
config = mkIf cfg.enable { config = mkIf cfg.enable {
programs.neovim = { programs.neovim = {
extraLuaConfig = readFile lazy; extraLuaConfig = lazy;
extraPython3Packages = ps: extraPython3Packages = ps:
let let
plugins = map (getAttr "plugin") cfg.plugins; plugins = map (getAttr "plugin") cfg.plugins;