Skip to content

devops: nix-checks - #2

Closed
sand4rt wants to merge 1 commit into
mainfrom
ci
Closed

sand4rt wants to merge 1 commit into
mainfrom
ci

Conversation

@sand4rt

@sand4rt sand4rt commented Apr 12, 2026

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings April 12, 2026 13:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds Nix-based CI checks for Lua formatting and Lua Language Server type checking, and wires them into GitHub Actions via nix flake check.

Changes:

  • Extend flake.nix with checks for lua-language-server --check and stylua --check, and include required tools in the devShell.
  • Add a repository .stylua.toml configuration and run the checks in CI (nix flake check).
  • Minor Lua formatting adjustment in lua/zen/init.lua.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.

File Description
lua/zen/init.lua Formatting-only change to match style/formatter output.
flake.nix Adds Nix flake checks for Lua type-checking and Stylua formatting; updates devShell packages.
.stylua.toml Introduces Stylua configuration used by the new formatting check.
.github/workflows/test.yml Adds a nix-checks job to run nix flake check in CI.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread flake.nix
Comment on lines +24 to 62
luarc = pkgs.mk-luarc {
plugins = with pkgs.vimPlugins; [
mini-nvim
];
};
luarc-json = pkgs.luarc-to-json (
luarc
// {
diagnostics = luarc.diagnostics // {
globals = [ "MiniTest" ];
};
}
);
type-check =
pkgs.runCommand "type-check"
{
nativeBuildInputs = [ pkgs.lua-language-server ];
}
''
export HOME="$(mktemp -d)"
cp -r ${self} source
cd source
lua-language-server --configpath ${luarc-json} --logpath "$HOME/log" --check .
touch $out
'';
stylua-check =
pkgs.runCommand "stylua-check"
{
nativeBuildInputs = [ pkgs.stylua ];
}
''
cd ${self}
stylua --check .
touch $out
'';
in
{
devShells.default = pkgs.mkShell {
packages = with pkgs; [

Copilot AI Apr 12, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The devShell previously ensured the repo had an up-to-date .luarc.json (via a shellHook symlink). After switching to mk-luarc/luarc-to-json, the shellHook is removed, but the repo still contains a committed .luarc.json that doesn’t match the config used by the new type-check (which includes plugin libs). This can lead to inconsistent Lua LS diagnostics between local development and nix flake check. Consider either restoring a devShell step to expose the generated JSON at .luarc.json or updating/removing the committed .luarc.json so local and CI use the same config source.

Copilot uses AI. Check for mistakes.
@sand4rt sand4rt closed this Apr 12, 2026
@sand4rt
sand4rt deleted the ci branch April 12, 2026 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants