From a5d7313abb8741ff2c3f3735e1b9a03f50d4e6ca Mon Sep 17 00:00:00 2001 From: alfarel Date: Tue, 25 Feb 2025 21:24:43 -0500 Subject: [PATCH] utility/direnv-vim: init --- docs/release-notes/rl-0.8.md | 2 ++ modules/plugins/utility/default.nix | 1 + modules/plugins/utility/direnv/config.nix | 13 +++++++++++++ modules/plugins/utility/direnv/default.nix | 6 ++++++ modules/plugins/utility/direnv/direnv.nix | 5 +++++ npins/sources.json | 12 ++++++++++++ 6 files changed, 39 insertions(+) create mode 100644 modules/plugins/utility/direnv/config.nix create mode 100644 modules/plugins/utility/direnv/default.nix create mode 100644 modules/plugins/utility/direnv/direnv.nix diff --git a/docs/release-notes/rl-0.8.md b/docs/release-notes/rl-0.8.md index 85f21580..5cf939be 100644 --- a/docs/release-notes/rl-0.8.md +++ b/docs/release-notes/rl-0.8.md @@ -204,6 +204,8 @@ for automatic creation of parent directories when editing a nested file. - Add [nix-develop.nvim](https://github.com/figsoda/nix-develop.nvim) plugin for in-neovim `nix develop`, `nix shell` and more. +- Add [direnv.vim](https://github.com/direnv/direnv.vim) plugin + for automatic syncing of nvim shell environment with direnv's. [TheColorman](https://github.com/TheColorman) diff --git a/modules/plugins/utility/default.nix b/modules/plugins/utility/default.nix index 6a4b4a7e..0f0956fb 100644 --- a/modules/plugins/utility/default.nix +++ b/modules/plugins/utility/default.nix @@ -3,6 +3,7 @@ ./binds ./ccc ./diffview + ./direnv ./fzf-lua ./gestures ./icon-picker diff --git a/modules/plugins/utility/direnv/config.nix b/modules/plugins/utility/direnv/config.nix new file mode 100644 index 00000000..b2211deb --- /dev/null +++ b/modules/plugins/utility/direnv/config.nix @@ -0,0 +1,13 @@ +{ + config, + lib, + ... +}: let + inherit (lib.modules) mkIf; + + cfg = config.vim.utility.direnv; +in { + vim = mkIf cfg.enable { + startPlugins = ["direnv-vim"]; + }; +} diff --git a/modules/plugins/utility/direnv/default.nix b/modules/plugins/utility/direnv/default.nix new file mode 100644 index 00000000..7a489920 --- /dev/null +++ b/modules/plugins/utility/direnv/default.nix @@ -0,0 +1,6 @@ +{ + imports = [ + ./config.nix + ./direnv.nix + ]; +} diff --git a/modules/plugins/utility/direnv/direnv.nix b/modules/plugins/utility/direnv/direnv.nix new file mode 100644 index 00000000..98d3f1f6 --- /dev/null +++ b/modules/plugins/utility/direnv/direnv.nix @@ -0,0 +1,5 @@ +{lib, ...}: let + inherit (lib.options) mkEnableOption; +in { + options.vim.utility.direnv.enable = mkEnableOption "syncing nvim shell environment with direnv's using `direnv.vim`"; +} diff --git a/npins/sources.json b/npins/sources.json index 8a4e555e..b69bf509 100644 --- a/npins/sources.json +++ b/npins/sources.json @@ -315,6 +315,18 @@ "url": "https://github.com/sindrets/diffview.nvim/archive/4516612fe98ff56ae0415a259ff6361a89419b0a.tar.gz", "hash": "0brabpd02596hg98bml118bx6z2sly98kf1cr2p0xzybiinb4zs9" }, + "direnv-vim": { + "type": "Git", + "repository": { + "type": "GitHub", + "owner": "direnv", + "repo": "direnv.vim" + }, + "branch": "master", + "revision": "ab2a7e08dd630060cd81d7946739ac7442a4f269", + "url": "https://github.com/direnv/direnv.vim/archive/ab2a7e08dd630060cd81d7946739ac7442a4f269.tar.gz", + "hash": "1hhwfnaj9ibz17ggxvhzrkinghfy51fqfa0bs482z484jpvjc31g" + }, "dracula": { "type": "Git", "repository": {