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,4 +1,3 @@
modules:
{
pkgs,
config,
@ -10,12 +9,15 @@ let
inherit (lib) types;
fileModuleType = types.submoduleWith {
shorthandOnlyDefinesConfig = true;
specialArgs.helpers = helpers;
specialArgs = {
inherit helpers;
defaultPkgs = pkgs;
};
modules = [
(
{ name, config, ... }:
{
imports = modules;
imports = [ ../../modules ];
options.plugin = lib.mkOption {
type = types.package;
description = "A derivation with the content of the file in it";