mirror of
https://github.com/nix-community/nixvim.git
synced 2025-08-02 00:54:48 +02:00
Enable creation of other config files than init.lua (#246)
This commit is contained in:
parent
bc468178ae
commit
a6eec507cc
8 changed files with 283 additions and 115 deletions
|
@ -1,10 +1,18 @@
|
|||
{
|
||||
modules: {
|
||||
lib,
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkEnableOption mkOption mkOptionType mkForce mkMerge mkIf types;
|
||||
in {
|
||||
topLevelModules =
|
||||
[
|
||||
./modules/output.nix
|
||||
(import ./modules/files.nix (modules pkgs))
|
||||
]
|
||||
++ (modules pkgs);
|
||||
|
||||
helpers = mkOption {
|
||||
type = mkOptionType {
|
||||
name = "helpers";
|
||||
|
@ -14,4 +22,16 @@ in {
|
|||
description = "Use this option to access the helpers";
|
||||
default = import ../plugins/helpers.nix {inherit (pkgs) lib;};
|
||||
};
|
||||
|
||||
configFiles = let
|
||||
cfg = config.programs.nixvim;
|
||||
in
|
||||
lib.mapAttrs'
|
||||
(
|
||||
_: file:
|
||||
lib.nameValuePair
|
||||
"nvim/${file.path}"
|
||||
{text = file.content;}
|
||||
)
|
||||
cfg.files;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue