Repository navigation
Expand file tree
/
Copy pathflake.nix
More file actions
65 lines (62 loc) · 1.84 KB
/
Copy pathflake.nix
File metadata and controls
65 lines (62 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
{
description = "diffs-collection.nvim — comparisons, review, and conflicts";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
systems.url = "github:nix-systems/default";
diffs-src = {
url = "github:barrettruth/diffs.nvim/9c408315f1ae70c26e21541df6e216b8946fe46e";
flake = false;
};
};
outputs =
{
nixpkgs,
systems,
diffs-src,
...
}:
let
forEachSystem =
f: nixpkgs.lib.genAttrs (import systems) (system: f nixpkgs.legacyPackages.${system});
in
{
formatter = forEachSystem (pkgs: pkgs.nixfmt-tree);
devShells = forEachSystem (
pkgs:
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 "$@"
'';
commonPackages = [
busted-with-grammar
pkgs.just
pkgs.biome
pkgs.stylua
pkgs.selene
pkgs.lua-language-server
pkgs.neovim
];
in
{
default = pkgs.mkShell {
packages = commonPackages;
DIFFS_NVIM_PATH = "${diffs-src}";
VIMRUNTIME = "${pkgs.neovim}/share/nvim/runtime";
};
}
);
};
}