From d4035b8fce7eb833267ba04aea8cfd827e82bc21 Mon Sep 17 00:00:00 2001 From: Mel Date: Thu, 31 Oct 2024 15:28:03 +0100 Subject: Add YCM extra conf. to allow Nix formatting from nil Signed-off-by: Mel --- modules/vim.nix | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'modules') diff --git a/modules/vim.nix b/modules/vim.nix index ceceac5..1913197 100644 --- a/modules/vim.nix +++ b/modules/vim.nix @@ -1,4 +1,9 @@ -{ pkgs, auxiliaryPkgs, ... }: +{ + lib, + pkgs, + auxiliaryPkgs, + ... +}: let configs = [ @@ -6,7 +11,19 @@ let ../configs/plugins.vimrc ]; - customRC = with builtins; foldl' (r: f: r + (readFile f)) "" configs; + configVars = { + "@ycm_extra_conf@" = ../configs/.ycm_extra_conf.py; + }; + + processRCFile = + f: + with builtins; + (replaceStrings + (lib.attrNames configVars) + (map toString (lib.attrValues configVars)) + (readFile f)); + + customRC = builtins.foldl' (r: f: r + (processRCFile f)) "" configs; vim-configured = with pkgs; -- cgit 1.4.1