From 73530c939b9d916bab5c6328a3ffb4620a2cb19b Mon Sep 17 00:00:00 2001 From: Joshua Potter Date: Sun, 19 Nov 2023 21:00:33 -0700 Subject: [PATCH] Add support for lean. --- jrpotter/default.nix | 2 ++ jrpotter/neovim/default.nix | 14 ++++---------- jrpotter/neovim/lang/lean.nix | 26 ++++++++++++++++++++++++++ jrpotter/neovim/utils.nix | 11 +++++++++++ 4 files changed, 43 insertions(+), 10 deletions(-) create mode 100644 jrpotter/neovim/lang/lean.nix create mode 100644 jrpotter/neovim/utils.nix diff --git a/jrpotter/default.nix b/jrpotter/default.nix index 6f23e58..090a98f 100644 --- a/jrpotter/default.nix +++ b/jrpotter/default.nix @@ -13,7 +13,9 @@ packages = with pkgs; [ anki-bin bitwarden + elan firefox + gnumake mullvad-vpn python3 wezterm diff --git a/jrpotter/neovim/default.nix b/jrpotter/neovim/default.nix index d26d7b4..16e0056 100644 --- a/jrpotter/neovim/default.nix +++ b/jrpotter/neovim/default.nix @@ -1,13 +1,6 @@ -{ config, pkgs, lib, ... }: +args @ { config, pkgs, lib, ... }: let - pluginGit = rev: repo: pkgs.vimUtils.buildVimPluginFrom2Nix { - pname = "${lib.strings.sanitizeDerivationName repo}"; - version = builtins.substring 0 7 rev; - src = builtins.fetchGit { - url = "https://github.com/${repo}.git"; - rev = rev; - }; - }; + utils = import ./utils.nix args; lualine-nvim = { plugin = pkgs.vimPlugins.lualine-nvim; @@ -24,7 +17,7 @@ let }; nvim-dap = { - plugin = pluginGit + plugin = utils.pluginGit "e154fdb6d70b3765d71f296e718b29d8b7026a63" "mfussenegger/nvim-dap"; config = config.programs.neovim.nvim-dap; @@ -72,6 +65,7 @@ in }; imports = [ + ./lang/lean.nix ./lang/lua.nix ./lang/nix.nix ./lang/python.nix diff --git a/jrpotter/neovim/lang/lean.nix b/jrpotter/neovim/lang/lean.nix new file mode 100644 index 0000000..1dbd8b1 --- /dev/null +++ b/jrpotter/neovim/lang/lean.nix @@ -0,0 +1,26 @@ +args @ { pkgs, ... }: +let + utils = import ../utils.nix args; + + lean-nvim = { + plugin = utils.pluginGit + "47ff75ce2fcc319fe7d8e031bc42a75473919b93" + "Julian/lean.nvim"; + config = '' + lua << EOF + require('lean').setup { + abbreviations = { builtin = true }, + mappings = true, + } + EOF + ''; + }; +in +{ + programs.neovim = { + plugins = [ + lean-nvim + pkgs.vimPlugins.plenary-nvim + ]; + }; +} diff --git a/jrpotter/neovim/utils.nix b/jrpotter/neovim/utils.nix new file mode 100644 index 0000000..60e0be9 --- /dev/null +++ b/jrpotter/neovim/utils.nix @@ -0,0 +1,11 @@ +{ pkgs, lib, ... }: +{ + pluginGit = rev: repo: pkgs.vimUtils.buildVimPluginFrom2Nix { + pname = "${lib.strings.sanitizeDerivationName repo}"; + version = builtins.substring 0 7 rev; + src = builtins.fetchGit { + url = "https://github.com/${repo}.git"; + rev = rev; + }; + }; +}