From 89c0cc0373f3ae094d41cf1bdbabea0445cdb7ed Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Fri, 31 Mar 2023 17:42:05 +0300 Subject: [PATCH] self.packages.maximal instead of pkgs.neovim-maximal --- lib/module/default.nix | 45 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 lib/module/default.nix diff --git a/lib/module/default.nix b/lib/module/default.nix new file mode 100644 index 0000000..4648966 --- /dev/null +++ b/lib/module/default.nix @@ -0,0 +1,45 @@ +# Home Manager module +{ + self, + config, + pkgs, + lib ? pkgs.lib, + ... +}: let + cfg = config.programs.neovim-flake; + set = self.packages.neovim-maximal {mainConfig = cfg.settings;}; +in + with lib; { + meta.maintainers = [maintainers.notashelf]; + + options.programs.neovim-flake = { + enable = mkEnableOption "A NeoVim IDE with a focus on configurability and extensibility."; + + settings = mkOption { + type = types.attrsOf types.anything; + default = {}; + example = literalExpression '' + { + vim.viAlias = false; + vim.vimAlias = true; + vim.lsp = { + enable = true; + formatOnSave = true; + lightbulb.enable = true; + lspsaga.enable = false; + nvimCodeActionMenu.enable = true; + trouble.enable = true; + lspSignature.enable = true; + rust.enable = false; + nix = true; + }; + } + ''; + description = "Attribute set of neoflake preferences."; + }; + }; + + config = mkIf cfg.enable { + home.packages = [set.neovim]; + }; + }