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:
Matt Sturgeon 2024-07-02 13:30:29 +01:00
parent 3d96960348
commit d2afb176ff
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299
16 changed files with 129 additions and 159 deletions

View file

@ -1,8 +1,4 @@
{
modules,
self,
getHelpers,
}:
{ self, getHelpers }:
{
pkgs,
config,
@ -20,7 +16,7 @@ let
types
;
helpers = getHelpers pkgs false;
shared = import ./_shared.nix { inherit modules helpers; } args;
shared = import ./_shared.nix helpers args;
cfg = config.programs.nixvim;
files = shared.configFiles // {
"nvim/sysinit.lua".text = cfg.initContent;
@ -34,6 +30,7 @@ in
shorthandOnlyDefinesConfig = true;
specialArgs = {
nixosConfig = config;
defaultPkgs = pkgs;
inherit helpers;
};
modules = [ ./modules/nixos.nix ] ++ shared.topLevelModules;