This commit is contained in:
Barrett Ruth 2026-03-04 14:15:37 -05:00
parent 2917c4c73f
commit afd27a269b
Signed by: barrett
GPG key ID: A6C96C9349D2FC81
3 changed files with 30 additions and 8 deletions

View file

@ -16,15 +16,26 @@
forEachSystem = f: nixpkgs.lib.genAttrs (import systems) (system: f nixpkgs.legacyPackages.${system});
in
{
formatter = forEachSystem (pkgs: pkgs.nixfmt-tree);
devShells = forEachSystem (pkgs: {
default = pkgs.mkShell {
default =
let
ts-plugin = pkgs.vimPlugins.nvim-treesitter.withPlugins (p: [ p.diff ]);
diff-grammar = pkgs.vimPlugins.nvim-treesitter-parsers.diff;
luaEnv = pkgs.luajit.withPackages (ps: with ps; [ busted nlua ]);
busted-with-grammar = pkgs.writeShellScriptBin "busted" ''
nvim_bin=$(which nvim)
tmpdir=$(mktemp -d)
trap 'rm -rf "$tmpdir"' EXIT
printf '#!/bin/sh\nexec "%s" --cmd "set rtp+=${ts-plugin}/runtime" --cmd "set rtp+=${diff-grammar}" "$@"\n' "$nvim_bin" > "$tmpdir/nvim"
chmod +x "$tmpdir/nvim"
PATH="$tmpdir:$PATH" exec ${luaEnv}/bin/busted "$@"
'';
in
pkgs.mkShell {
packages = [
(pkgs.luajit.withPackages (
ps: with ps; [
busted
nlua
]
))
busted-with-grammar
pkgs.prettier
pkgs.stylua
pkgs.selene