From afd15ca69f9ca8e890eb6cf0817c51f3b557b7c0 Mon Sep 17 00:00:00 2001 From: Marc Jakobi Date: Mon, 19 Aug 2024 19:53:14 +0200 Subject: [PATCH] feat: add luvit-meta (#3) * chore: add .envrc * feat: add luvit-meta --- .envrc | 1 + .gitignore | 3 ++- flake.lock | 17 +++++++++++++++++ flake.nix | 15 +++++++++++++-- 4 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 .envrc diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..c4ed2f3 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake .# -Lv diff --git a/.gitignore b/.gitignore index ac89d24..d2d46ae 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .luarc.json -result/ +result-* +.direnv diff --git a/flake.lock b/flake.lock index dc27398..88d7214 100644 --- a/flake.lock +++ b/flake.lock @@ -18,6 +18,22 @@ "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": { "locked": { "lastModified": 1718714799, @@ -49,6 +65,7 @@ "root": { "inputs": { "flake-parts": "flake-parts", + "luvit-meta": "luvit-meta", "nixpkgs": "nixpkgs" } } diff --git a/flake.nix b/flake.nix index 37f0280..ea6f15e 100644 --- a/flake.nix +++ b/flake.nix @@ -4,12 +4,17 @@ inputs = { nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; flake-parts.url = "github:hercules-ci/flake-parts"; + luvit-meta = { + url = "github:Bilal2453/luvit-meta"; + flake = false; + }; }; outputs = inputs @ { self, nixpkgs, flake-parts, + luvit-meta, }: flake-parts.lib.mkFlake {inherit inputs;} { systems = [ @@ -36,11 +41,16 @@ }; }; flake = { - overlays.default = final: prev: { + overlays.default = final: prev: let + lib = final.lib; + in { mk-luarc = { # list of plugins that have a /lua directory nvim ? final.neovim-unwrapped, plugins ? [], + meta ? { + luvit = true; + }, lua-version ? "5.1", disabled-diagnostics ? [], }: let @@ -77,7 +87,8 @@ ] ++ plugin-luadirs ++ pkg-libdirs - ++ pkg-sharedirs; + ++ pkg-sharedirs + ++ (lib.optional (meta.luvit or false) "${luvit-meta}/library"); ignoreDir = [ ".git" ".github"