use config.packages

This commit is contained in:
NotAShelf 2023-03-31 18:17:06 +03:00
parent 1ba910f8de
commit c818cc108e
No known key found for this signature in database
GPG key ID: F0D14CCB5ED5AA22

View file

@ -1,47 +1,44 @@
# Home Manager module # Home Manager module
{inputs, ...}: { {
perSystem = { pkgs,
system, config,
config, lib ? pkgs.lib,
pkgs, ...
lib ? pkgs.lib, }:
... with lib; let
}: cfg = config.programs.neovim-flake;
with lib; let set = config.packages.maximal {mainConfig = cfg.settings;};
cfg = config.programs.neovim-flake; in {
set = self'.packages.maximal {mainConfig = cfg.settings;}; meta.maintainers = [maintainers.notashelf];
in {
meta.maintainers = [maintainers.notashelf];
options.programs.neovim-flake = { options.programs.neovim-flake = {
enable = mkEnableOption "A NeoVim IDE with a focus on configurability and extensibility."; enable = mkEnableOption "A NeoVim IDE with a focus on configurability and extensibility.";
settings = mkOption { settings = mkOption {
type = types.attrsOf types.anything; type = types.attrsOf types.anything;
default = {}; default = {};
example = literalExpression '' example = literalExpression ''
{ {
vim.viAlias = false; vim.viAlias = false;
vim.vimAlias = true; vim.vimAlias = true;
vim.lsp = { vim.lsp = {
enable = true; enable = true;
formatOnSave = true; formatOnSave = true;
lightbulb.enable = true; lightbulb.enable = true;
lspsaga.enable = false; lspsaga.enable = false;
nvimCodeActionMenu.enable = true; nvimCodeActionMenu.enable = true;
trouble.enable = true; trouble.enable = true;
lspSignature.enable = true; lspSignature.enable = true;
rust.enable = false; rust.enable = false;
nix = true; nix = true;
}; };
} }
''; '';
description = "Attribute set of neoflake preferences."; description = "Attribute set of neoflake preferences.";
};
};
config = mkIf cfg.enable {
home.packages = [set.neovim];
};
}; };
};
config = mkIf cfg.enable {
home.packages = [set.neovim];
};
} }