From 4177ace1e85a5a9c353a03f25725ad6d85a8e469 Mon Sep 17 00:00:00 2001 From: Emi Simpson Date: Tue, 31 Jan 2023 20:07:21 -0500 Subject: [PATCH] Add coqtail for nvim --- configs/home.nogui.nix | 2 +- configs/programs/neovim.nix | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/configs/home.nogui.nix b/configs/home.nogui.nix index 7bde792..a5dd60d 100644 --- a/configs/home.nogui.nix +++ b/configs/home.nogui.nix @@ -88,7 +88,7 @@ w3m ]; }; - programs.neovim = import programs/neovim.nix pkgs; + programs.neovim = import programs/neovim.nix {inherit pkgs lib;}; programs.gpg.enable = true; programs.jq.enable = true; programs.tmux = { diff --git a/configs/programs/neovim.nix b/configs/programs/neovim.nix index eb731ac..58e1079 100644 --- a/configs/programs/neovim.nix +++ b/configs/programs/neovim.nix @@ -1,5 +1,6 @@ with builtins; +{pkgs, lib}: let mkSettings = s: concatStringsSep @@ -73,8 +74,19 @@ let {"KEY BINGINGS" = mkMappings mappings;} {"MANUAL SETTINGS" = extra;} ]; + + # Via https://gist.github.com/nat-418/d76586da7a5d113ab90578ed56069509 + fromGitHub = ref: repo: pkgs.vimUtils.buildVimPluginFrom2Nix { + pname = "${lib.strings.sanitizeDerivationName repo}"; + version = ref; + src = builtins.fetchGit { + url = "https://github.com/${repo}.git"; + ref = ref; + }; + }; + in -pkgs: { +{ enable = true; plugins = with pkgs.vimPlugins; [ editorconfig-nvim @@ -88,6 +100,7 @@ pkgs: { nvim-treesitter.withAllGrammars nvim-ts-rainbow nvim-lspconfig + (fromGitHub "HEAD" "whonore/Coqtail") ]; extraConfig = mkConfig { settings = {