diff --git a/pkgs/clan-cli/clan_cli/clan/create.py b/pkgs/clan-cli/clan_cli/clan/create.py index d07eff10f..c4a3ae916 100644 --- a/pkgs/clan-cli/clan_cli/clan/create.py +++ b/pkgs/clan-cli/clan_cli/clan/create.py @@ -11,8 +11,7 @@ from clan_lib.flake import Flake from clan_lib.nix import nix_command, nix_metadata, nix_shell from clan_lib.nix_models.inventory import Inventory from clan_lib.persist.inventory_store import InventoryStore - -from clan_cli.templates import ( +from clan_lib.templates import ( InputPrio, TemplateName, copy_from_nixstore, diff --git a/pkgs/clan-cli/clan_cli/clan/list.py b/pkgs/clan-cli/clan_cli/clan/list.py index 7594a6311..ff80c20f1 100644 --- a/pkgs/clan-cli/clan_cli/clan/list.py +++ b/pkgs/clan-cli/clan_cli/clan/list.py @@ -1,7 +1,7 @@ import argparse import logging -from clan_cli.templates import list_templates +from clan_lib.templates import list_templates log = logging.getLogger(__name__) diff --git a/pkgs/clan-cli/clan_cli/machines/create.py b/pkgs/clan-cli/clan_cli/machines/create.py index c9b4f228a..c758b0216 100644 --- a/pkgs/clan-cli/clan_cli/machines/create.py +++ b/pkgs/clan-cli/clan_cli/machines/create.py @@ -17,16 +17,16 @@ from clan_lib.nix_models.inventory import ( ) from clan_lib.persist.inventory_store import InventoryStore from clan_lib.persist.util import apply_patch - -from clan_cli.completions import add_dynamic_completer, complete_tags -from clan_cli.machines.list import list_machines -from clan_cli.templates import ( +from clan_lib.templates import ( InputPrio, TemplateName, copy_from_nixstore, get_template, ) +from clan_cli.completions import add_dynamic_completer, complete_tags +from clan_cli.machines.list import list_machines + log = logging.getLogger(__name__) diff --git a/pkgs/clan-cli/clan_cli/tests/test_clan_nix_attrset.py b/pkgs/clan-cli/clan_cli/tests/test_clan_nix_attrset.py index 68619963c..a732c69f9 100644 --- a/pkgs/clan-cli/clan_cli/tests/test_clan_nix_attrset.py +++ b/pkgs/clan-cli/clan_cli/tests/test_clan_nix_attrset.py @@ -5,7 +5,13 @@ from pathlib import Path from typing import Any import pytest -from clan_cli.templates import ( +from clan_cli.tests.fixtures_flakes import FlakeForTest +from clan_lib.cmd import run +from clan_lib.flake import Flake +from clan_lib.git import commit_file +from clan_lib.locked_open import locked_open +from clan_lib.nix import nix_command +from clan_lib.templates import ( ClanExports, InputName, TemplateName, @@ -14,12 +20,6 @@ from clan_cli.templates import ( get_template, list_templates, ) -from clan_cli.tests.fixtures_flakes import FlakeForTest -from clan_lib.cmd import run -from clan_lib.flake import Flake -from clan_lib.git import commit_file -from clan_lib.locked_open import locked_open -from clan_lib.nix import nix_command # Function to write clan attributes to a file diff --git a/pkgs/clan-cli/clan_lib/dirs/__init__.py b/pkgs/clan-cli/clan_lib/dirs/__init__.py index c00519ede..c7e9f9be5 100644 --- a/pkgs/clan-cli/clan_lib/dirs/__init__.py +++ b/pkgs/clan-cli/clan_lib/dirs/__init__.py @@ -65,7 +65,7 @@ def clan_templates(template_type: TemplateType | None = None) -> Path: if template_path.exists(): return template_path - template_path = module_root() / "templates" + template_path = module_root() / "clan_core_templates" if template_type is not None: template_path /= template_type.value diff --git a/pkgs/clan-cli/clan_cli/templates.py b/pkgs/clan-cli/clan_lib/templates/__init__.py similarity index 100% rename from pkgs/clan-cli/clan_cli/templates.py rename to pkgs/clan-cli/clan_lib/templates/__init__.py diff --git a/pkgs/clan-cli/default.nix b/pkgs/clan-cli/default.nix index a8a1ba7e7..f6cd2dc14 100644 --- a/pkgs/clan-cli/default.nix +++ b/pkgs/clan-cli/default.nix @@ -73,7 +73,7 @@ let --replace-fail '@select_hash@' "$(jq -r '.nodes."nix-select".locked.narHash' ${../../flake.lock})" ln -sf ${nixpkgs'} $out/clan_lib/nixpkgs ln -sf ${nix-select} $out/clan_lib/select - cp -r ${../../templates} $out/clan_lib/templates + cp -r ${../../templates} $out/clan_lib/clan_core_templates ''; sourceWithoutTests = cliSource ( diff --git a/pkgs/clan-cli/pyproject.toml b/pkgs/clan-cli/pyproject.toml index b60ed1ea6..621200187 100644 --- a/pkgs/clan-cli/pyproject.toml +++ b/pkgs/clan-cli/pyproject.toml @@ -21,12 +21,12 @@ exclude = ["clan_lib.nixpkgs*", "result"] [tool.setuptools.package-data] clan_cli = [ "py.typed", - "templates/**/*", "vms/mimetypes/**/*", "webui/assets/**/*", "flash/*.sh", ] clan_lib = [ + "clan_core_templates/**/*", "**/allowed-packages.json", ]