From 1ba910f8de3b15a72ade247c034df703a9566e90 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Fri, 31 Mar 2023 18:05:28 +0300 Subject: [PATCH] adapt to flake-parts --- lib/module/default.nix | 82 +++++++++++++++++++++--------------------- 1 file changed, 42 insertions(+), 40 deletions(-) diff --git a/lib/module/default.nix b/lib/module/default.nix index b26a97e..9942ea6 100644 --- a/lib/module/default.nix +++ b/lib/module/default.nix @@ -1,45 +1,47 @@ # Home Manager module -{ - self, - config, - pkgs, - lib ? pkgs.lib, - ... -}: let - cfg = config.programs.neovim-flake; - set = self.packages.maximal {mainConfig = cfg.settings;}; -in - with lib; { - meta.maintainers = [maintainers.notashelf]; +{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]; - 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."; + 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]; }; }; - - config = mkIf cfg.enable { - home.packages = [set.neovim]; - }; - } +}