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