modules: add helpers to display init.lua and its store path

This commit is contained in:
raf 2024-07-20 14:46:24 +03:00
commit 8e6fe1873e
Signed by: NotAShelf
GPG key ID: AF26552424E53993

View file

@ -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.writeShellScriptBin "print-nvf-config" ''
cat << EOF
${vimOptions.builtLuaConfigRC}
EOF
'';
printConfigPath = pkgs.writeShellScriptBin "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";
};
}