30 lines
543 B
Nix
30 lines
543 B
Nix
{
|
|
name,
|
|
hm ? null,
|
|
sys ? null,
|
|
options ? null,
|
|
lib,
|
|
config,
|
|
pkgs,
|
|
doctrine,
|
|
}: let
|
|
optionsSet = import options {
|
|
inherit config lib pkgs cfg name doctrine;
|
|
};
|
|
|
|
configFiles = {
|
|
inherit sys hm;
|
|
};
|
|
|
|
cfg = config.${doctrine.prefix}.${name};
|
|
in {
|
|
config = lib.mkIf cfg.enable (import configFiles.${doctrine.namespace} {
|
|
inherit config lib pkgs doctrine cfg;
|
|
});
|
|
|
|
options =
|
|
lib.optionalAttrs (options != null) optionsSet.${doctrine.namespace}
|
|
// {
|
|
enable = lib.mkEnableOption name;
|
|
};
|
|
}
|