mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-24 20:54:56 +02:00
modules: refactor module bootstrapping
Let's simplify things by defining all modules in `./plugins`, `./modules` and `./wrappers/modules`. Instead of currying `pkgs` into a bootstrapping module, we can require `defaultPkgs` be provided as a special arg. This refactor allows us to completely remove `flake-modules/modules.nix`!
This commit is contained in:
parent
3d96960348
commit
d2afb176ff
16 changed files with 129 additions and 159 deletions
|
@ -1,26 +1,15 @@
|
|||
{ modules, helpers }:
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
helpers:
|
||||
{ lib, config, ... }:
|
||||
let
|
||||
inherit (lib)
|
||||
mkEnableOption
|
||||
mkOption
|
||||
mkOptionType
|
||||
mkForce
|
||||
mkMerge
|
||||
mkIf
|
||||
types
|
||||
;
|
||||
inherit (lib) mkOption mkOptionType;
|
||||
cfg = config.programs.nixvim;
|
||||
in
|
||||
{
|
||||
topLevelModules = [
|
||||
../modules
|
||||
./modules/output.nix
|
||||
(import ./modules/files.nix (modules pkgs))
|
||||
] ++ (modules pkgs);
|
||||
./modules/files.nix
|
||||
];
|
||||
|
||||
helpers = mkOption {
|
||||
type = mkOptionType {
|
||||
|
@ -33,9 +22,6 @@ in
|
|||
};
|
||||
|
||||
configFiles =
|
||||
let
|
||||
cfg = config.programs.nixvim;
|
||||
in
|
||||
(lib.mapAttrs' (_: file: lib.nameValuePair "nvim/${file.path}" { text = file.content; }) cfg.files)
|
||||
// (lib.mapAttrs' (
|
||||
path: content: lib.nameValuePair "nvim/${path}" { text = content; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue