From a468f25500b4c83f2837924cbd9ad076a0a2d0ee Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Fri, 31 Mar 2023 18:17:06 +0300 Subject: [PATCH] use config.packages --- lib/module/default.nix | 81 ++++++++++++++++++++---------------------- 1 file changed, 39 insertions(+), 42 deletions(-) diff --git a/lib/module/default.nix b/lib/module/default.nix index 9942ea6..1a5c3a9 100644 --- a/lib/module/default.nix +++ b/lib/module/default.nix @@ -1,47 +1,44 @@ # Home Manager module -{inputs, ...}: { - perSystem = { - system, - config, - pkgs, - lib ? pkgs.lib, - ... - }: - with lib; let - cfg = config.programs.neovim-flake; - set = self'.packages.maximal {mainConfig = cfg.settings;}; - in { - meta.maintainers = [maintainers.notashelf]; +{ + pkgs, + config, + lib ? pkgs.lib, + ... +}: +with lib; let + cfg = config.programs.neovim-flake; + set = config.packages.maximal {mainConfig = cfg.settings;}; +in { + meta.maintainers = [maintainers.notashelf]; - options.programs.neovim-flake = { - enable = mkEnableOption "A NeoVim IDE with a focus on configurability and extensibility."; + 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]; - }; + 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]; + }; }