Fix(clan.nix): create public attributes from 'clan', dont expose them from clanInternals
ClanInternals is already exposed at the toplevel the API can access anything This also deduplicated 'templates' and 'modules' into 'clan.modules' and 'clan.templates' repsectively Only this one path is its source
This commit is contained in:
@@ -13,16 +13,15 @@ let
|
|||||||
|
|
||||||
publicAttrs = import ../lib/build-clan/public.nix;
|
publicAttrs = import ../lib/build-clan/public.nix;
|
||||||
# Create output options only for listed attributes
|
# Create output options only for listed attributes
|
||||||
|
# TODO: Refactor this into an explicit module, so we can have description and other attributes to be listed in flake-parts
|
||||||
outputModule = {
|
outputModule = {
|
||||||
clan = lib.genAttrs publicAttrs.clan (
|
clan = lib.genAttrs publicAttrs.clan (
|
||||||
name:
|
name: config.clan.${name} or (throw "Output: clan.${name} not found.")
|
||||||
config.clan.clanInternals.${name}
|
|
||||||
or (throw "Output: clanInternals.${name} not found. Check: ${config.file}")
|
|
||||||
);
|
);
|
||||||
topLevel = {
|
topLevel = {
|
||||||
options = lib.genAttrs publicAttrs.topLevel (_: lib.mkOption { });
|
options = lib.genAttrs publicAttrs.topLevel (_: lib.mkOption { });
|
||||||
config = lib.genAttrs publicAttrs.topLevel (
|
config = lib.genAttrs publicAttrs.topLevel (
|
||||||
name: config.clan.${name} or (throw "Output: clan.${name} not found. See: ${config.file}")
|
name: config.clan.${name} or (throw "Output: clan.${name} not found.")
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -150,7 +150,9 @@ in
|
|||||||
inventory._inventoryFile = file;
|
inventory._inventoryFile = file;
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
inventory = inventoryLoaded;
|
# Weirdly this works only if it is a function
|
||||||
|
# This seems to be a bug in nixpkgs
|
||||||
|
inventory = _: lib.setDefaultModuleLocation file inventoryLoaded;
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
This list is used to guarantee equivalent attribute sets for both flake-parts and buildClan users.
|
This list is used to guarantee equivalent attribute sets for both flake-parts and buildClan users.
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
# flake.clan.{name} <- clanInternals.{name}
|
# flake.clan.{name} <- clan.{name}
|
||||||
clan = [
|
clan = [
|
||||||
"templates"
|
"templates"
|
||||||
"modules"
|
"modules"
|
||||||
|
|||||||
Reference in New Issue
Block a user