adapt to flake-parts

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

View file

@ -1,45 +1,47 @@
# Home Manager module # Home Manager module
{ {inputs, ...}: {
self, perSystem = {
config, system,
pkgs, config,
lib ? pkgs.lib, pkgs,
... lib ? pkgs.lib,
}: let ...
cfg = config.programs.neovim-flake; }:
set = self.packages.maximal {mainConfig = cfg.settings;}; with lib; let
in cfg = config.programs.neovim-flake;
with lib; { 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];
};
}