2024-07-08 15:07:24 +05:00
|
|
|
{
|
|
|
|
lib,
|
2024-07-18 15:49:05 +05:00
|
|
|
bonLib,
|
2024-07-08 15:07:24 +05:00
|
|
|
self,
|
2024-07-18 15:49:05 +05:00
|
|
|
check ? true,
|
2024-07-08 15:07:24 +05:00
|
|
|
...
|
2024-07-18 15:49:05 +05:00
|
|
|
}: let
|
|
|
|
moduleList = [
|
2024-07-08 15:07:24 +05:00
|
|
|
./misc/bonfire/default.nix
|
|
|
|
./services/papermc.nix
|
|
|
|
./services/qbittorrent-nox.nix
|
|
|
|
./services/spoofdpi.nix
|
2024-08-09 11:35:33 +05:00
|
|
|
./services/zapret.nix
|
2024-10-09 22:39:53 +05:00
|
|
|
./services/conduit.nix
|
2024-07-08 15:07:24 +05:00
|
|
|
];
|
2024-06-20 00:16:28 +05:00
|
|
|
|
2024-07-08 15:07:24 +05:00
|
|
|
configModule = {
|
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}: {
|
|
|
|
config = {
|
2024-07-18 15:49:05 +05:00
|
|
|
# module type checking
|
2024-07-08 15:07:24 +05:00
|
|
|
_module.check = check;
|
2024-07-18 15:49:05 +05:00
|
|
|
# extra arguments
|
|
|
|
_module.args = {
|
|
|
|
bonPkgs = self.packages.${pkgs.system};
|
2024-10-09 22:39:53 +05:00
|
|
|
bonLib = lib.mkDefault bonLib;
|
2024-07-18 15:49:05 +05:00
|
|
|
};
|
2024-06-20 00:16:28 +05:00
|
|
|
};
|
2024-07-08 15:07:24 +05:00
|
|
|
};
|
2024-07-18 15:49:05 +05:00
|
|
|
|
|
|
|
importedModules =
|
|
|
|
map (path: {...}: {
|
|
|
|
# imports provide path for each module needed for documentation
|
|
|
|
# inject module configuration
|
|
|
|
imports = [path configModule];
|
|
|
|
})
|
|
|
|
moduleList;
|
|
|
|
|
|
|
|
importedModuleNames = map (path: bonLib.nameFromPath path) moduleList;
|
|
|
|
|
|
|
|
bonfireModule = {
|
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}: {
|
|
|
|
# collect all modules
|
2024-10-09 22:39:53 +05:00
|
|
|
imports = moduleList ++ [configModule];
|
2024-07-18 15:49:05 +05:00
|
|
|
};
|
|
|
|
in
|
|
|
|
lib.listToAttrs (
|
|
|
|
lib.zipListsWith (name: value: {inherit name value;}) importedModuleNames importedModules
|
|
|
|
)
|
|
|
|
// {
|
|
|
|
bonfire = bonfireModule;
|
|
|
|
default = bonfireModule;
|
|
|
|
}
|