From 0d821154aaac085ba23bd602b684001b4c85b4a7 Mon Sep 17 00:00:00 2001 From: Minijackson Date: Wed, 16 Jun 2021 23:03:45 +0200 Subject: vim: use lua generator for variables and LSP config --- common/vim.nix | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'common') diff --git a/common/vim.nix b/common/vim.nix index 850eaf3..83ac31b 100644 --- a/common/vim.nix +++ b/common/vim.nix @@ -5,6 +5,8 @@ inputs: let inherit (pkgs.unstable) vimPlugins wrapNeovim; + luaFormat = inputs.self.lib.generators.lua { }; + neovim-unwrapped = inputs.neovim-master.defaultPackage.${config.nixpkgs.system}; cfg = config.vim; @@ -18,7 +20,7 @@ let ${(concatStringsSep "\n" (mapAttrsToList - (variable: value: "vim.g.${variable} = ${value}") + (variable: value: "vim.g.${variable} = ${luaFormat.generate value}") cfg.variables))} -- vim.lua from the NixOS configuration @@ -104,13 +106,9 @@ in options.vim = with lib; { variables = mkOption { - type = types.attrsOf types.str; + type = types.attrsOf luaFormat.type; default = {}; - description = '' - Extra global variables to add at the beginning of the vim configuration. - - Remember to escape strings with single-quotes. - ''; + description = "Extra global variables to add at the beginning of the vim configuration."; }; extraPlugins = mkOption { @@ -148,9 +146,9 @@ in vim = { wrappedPackage = myNeovim; variables = { - dominant_color = "'${config.theme.colors.dominant}'"; - ripgrep_path = "'${pkgs.ripgrep}/bin/rg'"; - fd_path = "'${pkgs.fd}/bin/fd'"; + dominant_color = "${config.theme.colors.dominant}"; + ripgrep_path = "${pkgs.ripgrep}/bin/rg"; + fd_path = "${pkgs.fd}/bin/fd"; }; }; -- cgit v1.2.3