Files
home-manager/tests/modules/programs/stylua/example-config.nix
Rachit Kumar Verma 0a364342a6 stylua: init module
Stylua is deterministic formatter for Lua 5.1, 5.2, 5.3, 5.4, LuaJIT, Luau and CfxLua/FiveM Lua, built using full-moon. StyLua is inspired by the likes of prettier, it parses your Lua codebase, and prints it back out from scratch, enforcing a consistent code style.
2026-08-26 08:23:02 -05:00

21 lines
574 B
Nix

{ realPkgs, ... }: {
programs.stylua = {
enable = true;
settings = {
call_parentheses = "Always";
collapse_simple_statement = "Always";
column_width = 85;
indent_type = "Spaces";
indent_width = 2;
line_endings = "Unix";
quote_style = "AutoPreferSingle";
};
};
test.unstubs = [ (_self: _super: { inherit (realPkgs) stylua; }) ];
nmt.script = ''
assertFileContent "home-files/.config/stylua/stylua.toml" ${./expected-config.toml}
assertFileRegex "home-path/bin/stylua" "search-parent-directories"
'';
}