Skip to content

Commit 883b9ee

Browse files
committed
devops: nix-checks
1 parent efcd924 commit 883b9ee

5 files changed

Lines changed: 50 additions & 8 deletions

File tree

‎.github/workflows/test.yml‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ on:
55
branches: [main]
66

77
jobs:
8+
nix-checks:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- uses: cachix/install-nix-action@v31
13+
- run: nix flake check -Lv
14+
815
test:
916
runs-on: ubuntu-latest
1017
steps:

‎.luarc.json‎

Lines changed: 0 additions & 1 deletion
This file was deleted.

‎.luarc.json‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"workspace": {
3+
"library": [
4+
"$VIMRUNTIME"
5+
]
6+
}
7+
}

‎.stylua.toml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
line_endings = "Unix"
2+
indent_type = "Tabs"
3+
indent_width = 2
4+
quote_style = "AutoPreferDouble"
5+
call_parentheses = "Always"
6+
collapse_simple_statement = "Never"

‎flake.nix‎

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
};
77
outputs =
88
{
9+
self,
910
nixpkgs,
1011
flake-utils,
1112
gen-luarc,
@@ -20,21 +21,44 @@
2021
gen-luarc.overlays.default
2122
];
2223
};
23-
luarc = pkgs.mk-luarc-json {
24+
luarc = pkgs.mk-luarc {
2425
plugins = with pkgs.vimPlugins; [
2526
mini-nvim
2627
];
2728
};
29+
luarc-json = pkgs.luarc-to-json luarc;
30+
type-check =
31+
pkgs.runCommand "type-check"
32+
{
33+
nativeBuildInputs = [ pkgs.lua-language-server ];
34+
}
35+
''
36+
export HOME="$(mktemp -d)"
37+
cp -r ${self} source
38+
cd source
39+
lua-language-server --configpath ${luarc-json} --logpath "$HOME/log" --checklevel Error --check .
40+
touch $out
41+
'';
42+
stylua-check =
43+
pkgs.runCommand "stylua-check"
44+
{
45+
nativeBuildInputs = [ pkgs.stylua ];
46+
}
47+
''
48+
cd ${self}
49+
stylua --check .
50+
touch $out
51+
'';
2852
in
2953
{
3054
devShells.default = pkgs.mkShell {
3155
packages = with pkgs; [
3256
lua-language-server
57+
stylua
3358
];
34-
shellHook = # bash
35-
''
36-
ln -fs ${luarc} .luarc.json
37-
'';
59+
};
60+
checks = {
61+
inherit type-check stylua-check;
3862
};
3963
}
4064
);

‎lua/zen/init.lua‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,7 @@ local function setup(options)
250250
for _, integration in pairs(opts[position]) do
251251
---@diagnostic disable-next-line: undefined-field
252252
if type(integration) == "table" and integration.filetype == filetype then
253-
local new_width =
254-
math.max(opts[position].min_width, math.floor((vim.o.columns - opts.main.width) / 2))
253+
local new_width = math.max(opts[position].min_width, math.floor((vim.o.columns - opts.main.width) / 2))
255254
vim.api.nvim_win_set_width(buf_info[1].windows[1], new_width)
256255
return
257256
end

0 commit comments

Comments
 (0)