From 1c0b31cc10584ca356ffe52dfe9669d4d9bb3846 Mon Sep 17 00:00:00 2001 From: diniamo Date: Sat, 10 Aug 2024 16:52:14 +0200 Subject: [PATCH] improve helper functions --- modules/default.nix | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/modules/default.nix b/modules/default.nix index 2bd72d7..fc996e4 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -127,20 +127,11 @@ inputs: { inherit extraLuaPackages extraPython3Packages; }; + dummyInit = pkgs.writeText "nvf-init.lua" vimOptions.builtLuaConfigRC; # Additional helper scripts for printing and displaying nvf configuration # in your commandline. - printConfig = pkgs.writers.writeDashBin "nvf-print-config" '' - cat << EOF - ${vimOptions.builtLuaConfigRC} - EOF - ''; - - printConfigPath = pkgs.writers.writeDashBin "nvf-print-config-path" '' - realpath ${pkgs.writeTextFile { - name = "nvf-init.lua"; - text = vimOptions.builtLuaConfigRC; - }} - ''; + printConfig = pkgs.writers.writeDashBin "nvf-print-config" "cat ${dummyInit}"; + printConfigPath = pkgs.writers.writeDashBin "nvf-print-config-path" "echo -n ${dummyInit}"; in { inherit (module) options config; inherit (module._module.args) pkgs; @@ -150,7 +141,7 @@ in { neovim = pkgs.symlinkJoin { name = "nvf-with-helpers"; paths = [neovim-wrapped printConfig printConfigPath]; - postBuild = "echo helpers added"; + postBuild = "echo Helpers added"; meta = { description = "Wrapped version of Neovim with additional helper scripts";