mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2025-01-07 07:49:49 +01:00
home-manager: use proper submodule type for settings
This commit is contained in:
parent
3b73bc0e01
commit
c7f4dd19ca
2 changed files with 14 additions and 10 deletions
|
@ -31,7 +31,7 @@
|
|||
};
|
||||
|
||||
homeManagerModules = {
|
||||
nvf = import ./flake/modules/home-manager.nix self.packages lib;
|
||||
nvf = import ./flake/modules/home-manager.nix self.packages lib inputs;
|
||||
default = self.homeManagerModules.nvf;
|
||||
neovim-flake =
|
||||
lib.warn ''
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Home Manager module
|
||||
packages: lib: {
|
||||
packages: lib: inputs: {
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
|
@ -8,15 +8,19 @@ packages: lib: {
|
|||
inherit (lib.modules) mkIf mkAliasOptionModule;
|
||||
inherit (lib.lists) optional;
|
||||
inherit (lib.options) mkOption mkEnableOption literalExpression;
|
||||
inherit (lib.types) attrsOf anything bool;
|
||||
inherit (lib.nvim) neovimConfiguration;
|
||||
inherit (lib.nvim.types) anythingConcatLists;
|
||||
inherit (lib.types) anything bool submoduleWith;
|
||||
|
||||
cfg = config.programs.nvf;
|
||||
|
||||
neovimConfigured = neovimConfiguration {
|
||||
inherit pkgs;
|
||||
modules = [cfg.settings];
|
||||
nvfModule = submoduleWith {
|
||||
description = "Nvf module";
|
||||
class = "nvf";
|
||||
specialArgs = {
|
||||
inherit pkgs lib inputs;
|
||||
};
|
||||
modules = [
|
||||
{imports = import ../../modules/modules.nix {inherit pkgs lib;};}
|
||||
];
|
||||
};
|
||||
in {
|
||||
imports = [
|
||||
|
@ -55,7 +59,7 @@ in {
|
|||
};
|
||||
|
||||
settings = mkOption {
|
||||
type = attrsOf anythingConcatLists;
|
||||
type = nvfModule;
|
||||
default = {};
|
||||
description = "Attribute set of nvf preferences.";
|
||||
example = literalExpression ''
|
||||
|
@ -78,7 +82,7 @@ in {
|
|||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
programs.nvf.finalPackage = neovimConfigured.neovim;
|
||||
programs.nvf.finalPackage = config.programs.nvf.settings.vim.build.finalPackage;
|
||||
|
||||
home = {
|
||||
sessionVariables = mkIf cfg.defaultEditor {EDITOR = "nvim";};
|
||||
|
|
Loading…
Reference in a new issue