Enable creation of other config files than init.lua (#246)

This commit is contained in:
Luc Chabassier 2023-04-20 22:41:37 +02:00 committed by GitHub
parent bc468178ae
commit a6eec507cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 283 additions and 115 deletions

View file

@ -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;
}