trivionomicon/doctrine: add support for overriding the prefix

This commit is contained in:
Alejandro Soto 2025-08-24 18:49:13 -06:00
parent c651b8c470
commit 7daa3d91b3
3 changed files with 28 additions and 18 deletions

View file

@ -1,12 +1,16 @@
{
lib ? pkgs.lib,
pkgs,
namespace,
prefix ? "trivium",
namespace ? null,
}: let
doctrine = {
lib = import ./lib {inherit lib pkgs doctrine;};
prefix = "trivium";
inherit namespace;
};
inherit (pkgs) lib;
doctrine =
{
lib = import ./lib {inherit lib pkgs doctrine;};
inherit namespace prefix;
}
// lib.optionalAttrs (pkgs != null) {
inherit pkgs;
};
in
doctrine

View file

@ -13,8 +13,11 @@
closeLib = close {inherit lib;};
closeFull = close {inherit lib pkgs doctrine;};
in {
inherit close;
importAll = closeLib ./import-all.nix;
mkModule = closeFull ./mk-module.nix;
}
in
{
inherit close;
importAll = closeLib ./import-all.nix;
}
// lib.optionalAttrs (doctrine.namespace != null) {
mkModule = closeFull ./mk-module.nix;
}

View file

@ -11,14 +11,17 @@
requires ? [],
prefix ? doctrine.prefix,
namespace ? doctrine.namespace,
passthru ? {},
}: let
optionsSet = import options {
inherit config lib pkgs cfg name doctrine;
};
optionsSet = import options (passthru
// {
inherit config lib pkgs cfg name doctrine;
});
configSet = import configFiles.${namespace} {
inherit config lib pkgs doctrine cfg;
};
configSet = import configFiles.${namespace} (passthru
// {
inherit config lib pkgs doctrine cfg;
});
configFiles = lib.filterAttrs (k: v: v != null) {
inherit sys hm;