summary refs log tree commit diff
path: root/modules
diff options
context:
space:
mode:
authorMel <einebeere@gmail.com>2024-10-31 15:28:03 +0100
committerMel <einebeere@gmail.com>2024-10-31 15:28:03 +0100
commitd4035b8fce7eb833267ba04aea8cfd827e82bc21 (patch)
treea3369ac3d938651f2b557bf60407b5cf49f54994 /modules
parent424559ba8cc03a1015c7bbe9baa459fab6694094 (diff)
downloadminerals-d4035b8fce7eb833267ba04aea8cfd827e82bc21.tar.zst
minerals-d4035b8fce7eb833267ba04aea8cfd827e82bc21.zip
Add YCM extra conf. to allow Nix formatting from nil
Signed-off-by: Mel <einebeere@gmail.com>
Diffstat (limited to 'modules')
-rw-r--r--modules/vim.nix21
1 files changed, 19 insertions, 2 deletions
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;