This is my flakeless configuration for macOS using nix
{ ... }:
{
  programs.nixvim.plugins.lsp.servers.lua-ls = {
    enable = true;
    extraOptions = {
      settings = {
        Lua = {
          runtime = {
            version = "LuaJIT";
          };
          diagnostics = {
            globals = [ "vim" ];
          };
          telemetry = {
            enable = false;
          };
        };
      };
    };
  };
}