summaryrefslogtreecommitdiff
path: root/users/seth/programs/neovim/default.nix
diff options
context:
space:
mode:
authorseth <[email protected]>2023-08-17 13:46:41 -0400
committerseth <[email protected]>2023-08-17 13:55:47 -0400
commit6ca79241fe6a45ca4468e4c54c778df116c0b14f (patch)
treeca6bbd7eaec86125c0e59a2553922ea4ef4a2b9b /users/seth/programs/neovim/default.nix
parent76127171e4ed7abcb2a14039f358e117aac20181 (diff)
users/seth: make everything a module
Diffstat (limited to 'users/seth/programs/neovim/default.nix')
-rw-r--r--users/seth/programs/neovim/default.nix130
1 files changed, 71 insertions, 59 deletions
diff --git a/users/seth/programs/neovim/default.nix b/users/seth/programs/neovim/default.nix
index 995d154..fe7edd3 100644
--- a/users/seth/programs/neovim/default.nix
+++ b/users/seth/programs/neovim/default.nix
@@ -1,62 +1,74 @@
-{pkgs, ...}: {
- programs.neovim = {
- enable = true;
- defaultEditor = true;
- extraPackages = with pkgs; [
- actionlint
- alejandra
- beautysh
- codespell
- deadnix
- just
- nil
- nodePackages.alex
- shellcheck
- statix
- stylua
- sumneko-lua-language-server
- ];
- plugins = with pkgs.vimPlugins; [
- bufferline-nvim
- catppuccin-nvim
- cmp-nvim-lsp
- cmp-buffer
- cmp_luasnip
- cmp-path
- editorconfig-nvim
- # TODO: don't pin when deprecation notice
- # is no longer in nixpkgs
- (fidget-nvim.overrideAttrs (_: {
- src = pkgs.fetchFromGitHub {
- owner = "j-hui";
- repo = "fidget.nvim";
- rev = "41f327b53c7977d47aee56f05e0bdbb4b994c5eb";
- hash = "sha256-v9qARsW8Gozit4Z3+igiemjI467QgRhwM+crqwO9r6U=";
- };
- }))
- gitsigns-nvim
- leap-nvim
- lualine-nvim
- luasnip
- nvim-autopairs
- nvim-cmp
- nvim-lspconfig
- null-ls-nvim
- nvim-tree-lua
- nvim-treesitter.withAllGrammars
- nvim-web-devicons
- pkgs.vim-just
- plenary-nvim
- telescope-nvim
- trouble-nvim
- ];
- extraLuaConfig = ''
- require("getchoo")
- '';
- };
+{
+ config,
+ lib,
+ pkgs,
+ ...
+}: let
+ cfg = config.getchoo.programs.neovim;
+ inherit (lib) mkEnableOption mkIf;
+in {
+ options.getchoo.programs.neovim.enable = mkEnableOption "neovim" // {default = true;};
+
+ config = mkIf cfg.enable {
+ programs.neovim = {
+ enable = true;
+ defaultEditor = true;
+ extraPackages = with pkgs; [
+ actionlint
+ alejandra
+ beautysh
+ codespell
+ deadnix
+ just
+ nil
+ nodePackages.alex
+ shellcheck
+ statix
+ stylua
+ sumneko-lua-language-server
+ ];
+ plugins = with pkgs.vimPlugins; [
+ bufferline-nvim
+ catppuccin-nvim
+ cmp-nvim-lsp
+ cmp-buffer
+ cmp_luasnip
+ cmp-path
+ editorconfig-nvim
+ # TODO: don't pin when deprecation notice
+ # is no longer in nixpkgs
+ (fidget-nvim.overrideAttrs (_: {
+ src = pkgs.fetchFromGitHub {
+ owner = "j-hui";
+ repo = "fidget.nvim";
+ rev = "41f327b53c7977d47aee56f05e0bdbb4b994c5eb";
+ hash = "sha256-v9qARsW8Gozit4Z3+igiemjI467QgRhwM+crqwO9r6U=";
+ };
+ }))
+ gitsigns-nvim
+ leap-nvim
+ lualine-nvim
+ luasnip
+ nvim-autopairs
+ nvim-cmp
+ nvim-lspconfig
+ null-ls-nvim
+ nvim-tree-lua
+ nvim-treesitter.withAllGrammars
+ nvim-web-devicons
+ pkgs.vim-just
+ plenary-nvim
+ telescope-nvim
+ trouble-nvim
+ ];
+ extraLuaConfig = ''
+ require("getchoo")
+ '';
+ };
- xdg.configFile."nvim/lua/getchoo" = {
- source = ./config;
- recursive = true;
+ xdg.configFile."nvim/lua/getchoo" = {
+ source = ./config;
+ recursive = true;
+ };
};
}