Compare commits
No commits in common. "409f726d4aee9212aab0dec44f0fabecc2c46536" and "e4a989664303d812eb4d18a98cd1ebf44e29463e" have entirely different histories.
409f726d4a
...
e4a9896643
5 changed files with 26 additions and 148 deletions
1
.envrc
1
.envrc
|
@ -1 +0,0 @@
|
||||||
use flake .# -Lv
|
|
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -1,3 +1,2 @@
|
||||||
.luarc.json
|
.luarc.json
|
||||||
result-*
|
result/
|
||||||
.direnv
|
|
||||||
|
|
|
@ -9,6 +9,8 @@ It provides a `mk-luarc-json` function,
|
||||||
which takes an attrset with the following arguments:
|
which takes an attrset with the following arguments:
|
||||||
|
|
||||||
- `nvim`: The neovim package. Defaults to `neovim-unwrapped`.
|
- `nvim`: The neovim package. Defaults to `neovim-unwrapped`.
|
||||||
|
- `neodev-types`: neodev.nvim types to add to the `workspace.library`.
|
||||||
|
Defaults to `"stable"`.
|
||||||
- `plugins`: List of Neovim plugins and/or luarocks packages.
|
- `plugins`: List of Neovim plugins and/or luarocks packages.
|
||||||
Defaults to an empty list.
|
Defaults to an empty list.
|
||||||
- `lua-version`: Defaults to `"5.1"`.
|
- `lua-version`: Defaults to `"5.1"`.
|
||||||
|
|
112
flake.lock
112
flake.lock
|
@ -1,31 +1,15 @@
|
||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
"flake-compat": {
|
|
||||||
"flake": false,
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1696426674,
|
|
||||||
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
|
|
||||||
"owner": "edolstra",
|
|
||||||
"repo": "flake-compat",
|
|
||||||
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "edolstra",
|
|
||||||
"repo": "flake-compat",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"flake-parts": {
|
"flake-parts": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs-lib": "nixpkgs-lib"
|
"nixpkgs-lib": "nixpkgs-lib"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1717285511,
|
"lastModified": 1706830856,
|
||||||
"narHash": "sha256-iKzJcpdXih14qYVcZ9QC9XuZYnPc6T8YImb6dX166kw=",
|
"narHash": "sha256-a0NYyp+h9hlb7ddVz4LUn1vT/PLwqfrWYcHMvFB1xYg=",
|
||||||
"owner": "hercules-ci",
|
"owner": "hercules-ci",
|
||||||
"repo": "flake-parts",
|
"repo": "flake-parts",
|
||||||
"rev": "2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8",
|
"rev": "b253292d9c0a5ead9bc98c4e9a26c6312e27d69f",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -34,73 +18,13 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"git-hooks": {
|
|
||||||
"inputs": {
|
|
||||||
"flake-compat": "flake-compat",
|
|
||||||
"gitignore": "gitignore",
|
|
||||||
"nixpkgs": [
|
|
||||||
"nixpkgs"
|
|
||||||
],
|
|
||||||
"nixpkgs-stable": "nixpkgs-stable"
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1723803910,
|
|
||||||
"narHash": "sha256-yezvUuFiEnCFbGuwj/bQcqg7RykIEqudOy/RBrId0pc=",
|
|
||||||
"owner": "cachix",
|
|
||||||
"repo": "git-hooks.nix",
|
|
||||||
"rev": "bfef0ada09e2c8ac55bbcd0831bd0c9d42e651ba",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "cachix",
|
|
||||||
"repo": "git-hooks.nix",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"gitignore": {
|
|
||||||
"inputs": {
|
|
||||||
"nixpkgs": [
|
|
||||||
"git-hooks",
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1709087332,
|
|
||||||
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
|
|
||||||
"owner": "hercules-ci",
|
|
||||||
"repo": "gitignore.nix",
|
|
||||||
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "hercules-ci",
|
|
||||||
"repo": "gitignore.nix",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"luvit-meta": {
|
|
||||||
"flake": false,
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1705776742,
|
|
||||||
"narHash": "sha256-zAAptV/oLuLAAsa2zSB/6fxlElk4+jNZd/cPr9oxFig=",
|
|
||||||
"owner": "Bilal2453",
|
|
||||||
"repo": "luvit-meta",
|
|
||||||
"rev": "ce76f6f6cdc9201523a5875a4471dcfe0186eb60",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "Bilal2453",
|
|
||||||
"repo": "luvit-meta",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1718714799,
|
"lastModified": 1708475490,
|
||||||
"narHash": "sha256-FUZpz9rg3gL8NVPKbqU8ei1VkPLsTIfAJ2fdAf5qjak=",
|
"narHash": "sha256-g1v0TsWBQPX97ziznfJdWhgMyMGtoBFs102xSYO4syU=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "c00d587b1a1afbf200b1d8f0b0e4ba9deb1c7f0e",
|
"rev": "0e74ca98a74bc7270d28838369593635a5db3260",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -112,28 +36,18 @@
|
||||||
},
|
},
|
||||||
"nixpkgs-lib": {
|
"nixpkgs-lib": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1717284937,
|
"dir": "lib",
|
||||||
"narHash": "sha256-lIbdfCsf8LMFloheeE6N31+BMIeixqyQWbSr2vk79EQ=",
|
"lastModified": 1706550542,
|
||||||
"type": "tarball",
|
"narHash": "sha256-UcsnCG6wx++23yeER4Hg18CXWbgNpqNXcHIo5/1Y+hc=",
|
||||||
"url": "https://github.com/NixOS/nixpkgs/archive/eb9ceca17df2ea50a250b6b27f7bf6ab0186f198.tar.gz"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"type": "tarball",
|
|
||||||
"url": "https://github.com/NixOS/nixpkgs/archive/eb9ceca17df2ea50a250b6b27f7bf6ab0186f198.tar.gz"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nixpkgs-stable": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1720386169,
|
|
||||||
"narHash": "sha256-NGKVY4PjzwAa4upkGtAMz1npHGoRzWotlSnVlqI40mo=",
|
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "194846768975b7ad2c4988bdb82572c00222c0d7",
|
"rev": "97b17f32362e475016f942bbdfda4a4a72a8a652",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
"dir": "lib",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"ref": "nixos-24.05",
|
"ref": "nixos-unstable",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
|
@ -141,8 +55,6 @@
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-parts": "flake-parts",
|
"flake-parts": "flake-parts",
|
||||||
"git-hooks": "git-hooks",
|
|
||||||
"luvit-meta": "luvit-meta",
|
|
||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
56
flake.nix
56
flake.nix
|
@ -4,22 +4,12 @@
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
|
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
|
||||||
flake-parts.url = "github:hercules-ci/flake-parts";
|
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||||
luvit-meta = {
|
|
||||||
url = "github:Bilal2453/luvit-meta";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
git-hooks = {
|
|
||||||
url = "github:cachix/git-hooks.nix";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = inputs @ {
|
outputs = inputs @ {
|
||||||
self,
|
self,
|
||||||
nixpkgs,
|
nixpkgs,
|
||||||
flake-parts,
|
flake-parts,
|
||||||
luvit-meta,
|
|
||||||
git-hooks,
|
|
||||||
}:
|
}:
|
||||||
flake-parts.lib.mkFlake {inherit inputs;} {
|
flake-parts.lib.mkFlake {inherit inputs;} {
|
||||||
systems = [
|
systems = [
|
||||||
|
@ -38,49 +28,28 @@
|
||||||
luarc = pkgs.mk-luarc-json {
|
luarc = pkgs.mk-luarc-json {
|
||||||
plugins = with pkgs.vimPlugins; [telescope-nvim fidget-nvim];
|
plugins = with pkgs.vimPlugins; [telescope-nvim fidget-nvim];
|
||||||
};
|
};
|
||||||
git-hooks-check = git-hooks.lib.${system}.run {
|
|
||||||
src = self;
|
|
||||||
hooks = {
|
|
||||||
alejandra.enable = true;
|
|
||||||
editorconfig-checker.enable = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
in {
|
in {
|
||||||
devShells.default = pkgs.mkShell {
|
devShells.default = pkgs.mkShell {
|
||||||
name = "gen-luarc devShell";
|
|
||||||
buildInputs = self.checks.${system}.git-hooks-check.enabledPackages;
|
|
||||||
shellHook = ''
|
shellHook = ''
|
||||||
ln -fs ${pkgs.luarc-to-json luarc} .luarc.json
|
ln -fs ${pkgs.luarc-to-json luarc} .luarc.json
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
checks = rec {
|
|
||||||
default = git-hooks-check;
|
|
||||||
inherit git-hooks-check;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
flake = {
|
flake = {
|
||||||
overlays.default = final: prev: let
|
overlays.default = final: prev: {
|
||||||
inherit (final) lib;
|
|
||||||
in {
|
|
||||||
mk-luarc = {
|
mk-luarc = {
|
||||||
# list of plugins that have a /lua directory
|
# list of plugins that have a /lua directory
|
||||||
nvim ? final.neovim-unwrapped,
|
nvim ? final.neovim-unwrapped,
|
||||||
|
neodev-types ? "stable",
|
||||||
plugins ? [],
|
plugins ? [],
|
||||||
meta ? {
|
|
||||||
luvit = true;
|
|
||||||
},
|
|
||||||
lua-version ? "5.1",
|
lua-version ? "5.1",
|
||||||
disabled-diagnostics ? [],
|
disabled-diagnostics ? [],
|
||||||
globals ? [],
|
|
||||||
}: let
|
}: let
|
||||||
pluginPackages =
|
|
||||||
map (x: x.plugin or x)
|
|
||||||
plugins;
|
|
||||||
partitions = builtins.partition (plugin:
|
partitions = builtins.partition (plugin:
|
||||||
plugin.vimPlugin
|
builtins.hasAttr "vimPlugin" plugin
|
||||||
or false
|
&& plugin.vimPlugin
|
||||||
|| plugin.pname or "" == "nvim-treesitter")
|
|| plugin.pname == "nvim-treesitter")
|
||||||
pluginPackages;
|
plugins;
|
||||||
nvim-plugins = partitions.right;
|
nvim-plugins = partitions.right;
|
||||||
rocks = partitions.wrong;
|
rocks = partitions.wrong;
|
||||||
plugin-luadirs = builtins.map (plugin: "${plugin}/lua") nvim-plugins;
|
plugin-luadirs = builtins.map (plugin: "${plugin}/lua") nvim-plugins;
|
||||||
|
@ -88,24 +57,21 @@
|
||||||
pkg-sharedirs = builtins.map (pkg: "${pkg}/share/lua/${lua-version}") rocks;
|
pkg-sharedirs = builtins.map (pkg: "${pkg}/share/lua/${lua-version}") rocks;
|
||||||
in {
|
in {
|
||||||
runtime.version = "LuaJIT";
|
runtime.version = "LuaJIT";
|
||||||
runtime.path = ["?/nvim/init.lua" "?/nvim/lua/?.lua"];
|
|
||||||
Lua = {
|
Lua = {
|
||||||
globals =
|
globals = [
|
||||||
[
|
"vim"
|
||||||
"vim"
|
];
|
||||||
]
|
|
||||||
++ globals;
|
|
||||||
workspace = {
|
workspace = {
|
||||||
library =
|
library =
|
||||||
[
|
[
|
||||||
"${nvim}/share/nvim/runtime/lua"
|
"${nvim}/share/nvim/runtime/lua"
|
||||||
|
"${final.vimPlugins.neodev-nvim}/types/${neodev-types}"
|
||||||
"\${3rd}/busted/library"
|
"\${3rd}/busted/library"
|
||||||
"\${3rd}/luassert/library"
|
"\${3rd}/luassert/library"
|
||||||
]
|
]
|
||||||
++ plugin-luadirs
|
++ plugin-luadirs
|
||||||
++ pkg-libdirs
|
++ pkg-libdirs
|
||||||
++ pkg-sharedirs
|
++ pkg-sharedirs;
|
||||||
++ (lib.optional (meta.luvit or false) "${luvit-meta}/library");
|
|
||||||
ignoreDir = [
|
ignoreDir = [
|
||||||
".git"
|
".git"
|
||||||
".github"
|
".github"
|
||||||
|
|
Loading…
Reference in a new issue