templates: fix usage with new select

This commit is contained in:
lassulus
2025-04-19 16:49:25 -07:00
committed by Michael Hoang
parent 5feccf4e57
commit 89adacebec

View File

@@ -95,10 +95,10 @@ def get_clan_nix_attrset(clan_dir: Flake | None = None) -> ClanExports:
raw_clan_exports: dict[str, Any] = {"self": {"clan": {}}, "inputs": {"clan": {}}} raw_clan_exports: dict[str, Any] = {"self": {"clan": {}}, "inputs": {"clan": {}}}
try: maybe_templates = clan_dir.select("?clan.?templates")
raw_clan_exports["self"] = clan_dir.select("clan.{templates}") if "clan" in maybe_templates:
except ClanCmdError as ex: raw_clan_exports["self"] = maybe_templates["clan"]
log.debug(ex) else:
log.info("Current flake does not export the 'clan' attribute") log.info("Current flake does not export the 'clan' attribute")
# FIXME: flake.select destroys lazy evaluation # FIXME: flake.select destroys lazy evaluation
@@ -112,7 +112,7 @@ def get_clan_nix_attrset(clan_dir: Flake | None = None) -> ClanExports:
# of import statements. # of import statements.
# This needs to be fixed in clan.select # This needs to be fixed in clan.select
# For now always define clan.templates or no clan attribute at all # For now always define clan.templates or no clan attribute at all
temp = clan_dir.select("inputs.*.{clan}.templates") temp = clan_dir.select("inputs.*.?clan.templates")
# FIXME: We need this because clan.select removes the templates attribute # FIXME: We need this because clan.select removes the templates attribute
# but not the clan and other attributes leading up to templates # but not the clan and other attributes leading up to templates