clan-cli: Fix clan flakes create not working in nix shell

This commit is contained in:
Qubasa
2025-02-01 12:16:06 +07:00
parent 1248adfd45
commit 1fb676affb

View File

@@ -1,6 +1,5 @@
import json
import logging
import os
import shutil
import stat
from dataclasses import dataclass, field
@@ -63,10 +62,12 @@ class ClanExports(TypedDict):
def get_clan_nix_attrset(clan_dir: FlakeId | None = None) -> ClanExports:
# Check if the clan directory is provided, otherwise use the environment variable
if not clan_dir:
clan_core_path = os.environ.get("CLAN_CORE_PATH")
if not clan_core_path:
msg = "Environment var CLAN_CORE_PATH is not set, this shouldn't happen"
raise ClanError(msg)
# TODO: Quickfix, templates dir seems to be missing in CLAN_CORE_PATH??
clan_core_path = "git+https://git.clan.lol/clan/clan-core"
# clan_core_path = os.environ.get("CLAN_CORE_PATH")
# if not clan_core_path:
# msg = "Environment var CLAN_CORE_PATH is not set, this shouldn't happen"
# raise ClanError(msg)
clan_dir = FlakeId(clan_core_path)