From 8b15271f6364286e11aa6c1f9fda8e02c3ec581b Mon Sep 17 00:00:00 2001 From: raf Date: Sat, 20 Jul 2024 13:01:40 +0000 Subject: [PATCH 1/3] modules: add helper scripts (#346) * modules: add helpers to display init.lua and its store path * docs: update 0.7 release notes * modules: use writeDashBin for helpers --- docs/release-notes/rl-0.7.md | 8 ++++++++ modules/default.nix | 24 ++++++++++++++++++++++-- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/docs/release-notes/rl-0.7.md b/docs/release-notes/rl-0.7.md index c1b05bc..e35549e 100644 --- a/docs/release-notes/rl-0.7.md +++ b/docs/release-notes/rl-0.7.md @@ -141,3 +141,11 @@ configuration formats. - Add [neo-tree.nvim] as an alternative file-tree plugin. It will be available under `vim.filetree.neo-tree`, similar to nvimtree. + +- Add `print-nvf-config` & `print-nvf-config-path` helper scripts to Neovim + closure. Both of those scripts have been automatically added to your PATH upon + using neovimConfig or `programs.nvf.enable`. + - `print-nvf-config` will display your `init.lua`, in full. + - `print-nvf-config-path` will display the path to _a clone_ of your + `init.lua`. This is not the path used by the Neovim wrapper, but an + identical clone. diff --git a/modules/default.nix b/modules/default.nix index fbcdb70..2099749 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -105,10 +105,30 @@ inputs: { inherit (vimOptions) viAlias vimAlias withRuby withNodeJs withPython3; inherit extraLuaPackages extraPython3Packages; }; + + # Additional helper scripts for printing and displaying nvf configuration + # in your commandline. + printConfig = pkgs.writers.writeDashBin "print-nvf-config" '' + cat << EOF + ${vimOptions.builtLuaConfigRC} + EOF + ''; + + printConfigPath = pkgs.writers.writeDashBin "print-nvf-config-path" '' + realpath ${pkgs.writeTextFile { + name = "nvf-init.lua"; + text = vimOptions.builtLuaConfigRC; + }} + ''; in { inherit (module) options config; inherit (module._module.args) pkgs; - # expose wrapped neovim-package - neovim = neovim-wrapped; + # Expose wrapped neovim-package for userspace + # or module consumption. + neovim = pkgs.symlinkJoin { + name = "nvf-with-helpers"; + paths = [neovim-wrapped printConfig printConfigPath]; + postBuild = "echo helpers added"; + }; } From 2b8d0af2e6b5a4e52c93ab86875c52eb5376abe4 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Sat, 20 Jul 2024 16:55:56 +0300 Subject: [PATCH 2/3] modules: add meta.mainProgram to symlinkJoined Neovim wrapper --- modules/default.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/default.nix b/modules/default.nix index 2099749..14c41c9 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -130,5 +130,10 @@ in { name = "nvf-with-helpers"; paths = [neovim-wrapped printConfig printConfigPath]; postBuild = "echo helpers added"; + + meta = { + description = "Wrapped version of Neovim with additional helper scripts"; + mainProgram = "nvim"; + }; }; } From 589b86d3781c2fba8d4d11698d127708aaaa663f Mon Sep 17 00:00:00 2001 From: Gerg-L <88247690+Gerg-L@users.noreply.github.com> Date: Sun, 21 Jul 2024 11:37:45 -0400 Subject: [PATCH 3/3] fix buildPlug patches, update mnw (#343) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * bald frog (gerg-l) * modules/default.nix: make patches work on built plugins * flake.lock: Update Flake lock file updates: • Updated input 'mnw': 'github:Gerg-L/mnw/302b18ddb8498aa9a7e0c01f7026e49d545e6898?narHash=sha256-4Z2FtCuL0lT%2BsM2gb1JMcXOUkeYrWeYZjjs1HuVTlOs%3D' (2024-07-14) → 'github:Gerg-L/mnw/4ea225024677e7c3a96080af8624fd3aa5dfa1b6?narHash=sha256-PF/FbgCUZ6mQrKp28G2YoVDlSThBy8AxIT9d2Ju3kTY%3D' (2024-07-20) --------- Co-authored-by: raf --- docs/release-notes/rl-0.7.md | 2 -- flake.lock | 6 +++--- modules/default.nix | 18 +++++++++++++----- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/docs/release-notes/rl-0.7.md b/docs/release-notes/rl-0.7.md index e35549e..87bd3b6 100644 --- a/docs/release-notes/rl-0.7.md +++ b/docs/release-notes/rl-0.7.md @@ -46,8 +46,6 @@ configuration formats. - Fix [](#opt-vim.ui.smartcolumn.setupOpts.custom_colorcolumn) using the wrong type `int` instead of the expected type `string`. -- Fix unused src and version attributes in `buildPlug`. - [horriblename](https://github.com/horriblename): - Fix broken treesitter-context keybinds in visual mode diff --git a/flake.lock b/flake.lock index 4601bc1..c5544f6 100644 --- a/flake.lock +++ b/flake.lock @@ -69,11 +69,11 @@ }, "mnw": { "locked": { - "lastModified": 1720927281, - "narHash": "sha256-4Z2FtCuL0lT+sM2gb1JMcXOUkeYrWeYZjjs1HuVTlOs=", + "lastModified": 1721440413, + "narHash": "sha256-PF/FbgCUZ6mQrKp28G2YoVDlSThBy8AxIT9d2Ju3kTY=", "owner": "Gerg-L", "repo": "mnw", - "rev": "302b18ddb8498aa9a7e0c01f7026e49d545e6898", + "rev": "4ea225024677e7c3a96080af8624fd3aa5dfa1b6", "type": "github" }, "original": { diff --git a/modules/default.nix b/modules/default.nix index 14c41c9..227cf20 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -36,11 +36,19 @@ inputs: { buildPlug = {pname, ...} @ attrs: let src = getAttr ("plugin-" + pname) inputs; in - pkgs.runCommand "${pname}-${src.shortRev or src.shortDirtyRev or "dirty"}" attrs - '' - mkdir -p $out - cp -r ${src}/. $out - ''; + pkgs.stdenvNoCC.mkDerivation ({ + inherit src; + version = src.shortRev or src.shortDirtyRev or "dirty"; + installPhase = '' + runHook preInstall + + mkdir -p $out + cp -r . $out + + runHook postInstall + ''; + } + // attrs); noBuildPlug = {pname, ...} @ attrs: let input = getAttr ("plugin-" + pname) inputs;