working example

This commit is contained in:
mewoocat 2025-12-22 14:28:43 -06:00
commit 95f36449a7
2 changed files with 12 additions and 7 deletions

View file

@ -77,4 +77,7 @@ in {
}; };
}; };
}; };
# maybe put generic function to set indent for provided langs
# Then we can just call it with the lib arg
} }

View file

@ -4,12 +4,13 @@
lib, lib,
... ...
}: let }: let
inherit (builtins) attrNames; inherit (builtins) attrNames toString;
inherit (lib) concatStringsSep; inherit (lib) concatStringsSep;
inherit (lib.meta) getExe; inherit (lib.meta) getExe;
inherit (lib.options) mkEnableOption mkOption; inherit (lib.options) mkEnableOption mkOption;
inherit (lib.modules) mkIf mkMerge; inherit (lib.modules) mkIf mkMerge;
inherit (lib.types) enum; inherit (lib.types) enum;
inherit (lib.types) int;
inherit (lib.nvim.types) mkGrammarOption diagnostics deprecatedSingleOrListOf; inherit (lib.nvim.types) mkGrammarOption diagnostics deprecatedSingleOrListOf;
inherit (lib.nvim.attrsets) mapListToAttrs; inherit (lib.nvim.attrsets) mapListToAttrs;
@ -167,8 +168,8 @@ in {
}; };
}) })
vim = { {
autocmds = [ vim.autocmds = [
{ {
desc = "Sets indent for nix files"; desc = "Sets indent for nix files";
event = ["BufEnter"]; event = ["BufEnter"];
@ -178,14 +179,15 @@ in {
]; ];
callback = lib.generators.mkLuaInline '' callback = lib.generators.mkLuaInline ''
function() function()
vim.opt.tabstop = ${cfg.indentSize} vim.opt.tabstop = ${toString cfg.indentSize}
vim.opt.softtabstop = ${cfg.indentSize} vim.opt.softtabstop = ${toString cfg.indentSize}
vim.opt.shiftwidth = ${cfg.indentSize} vim.opt.shiftwidth = ${toString cfg.indentSize}
end end
''; '';
once = true; once = true;
} }
]; ];
} }
])
]);
} }