Refactor(clan_lib): move nix bound classes out of the cli folder

This commit is contained in:
Johannes Kirschbauer
2025-05-13 17:35:54 +02:00
parent 8b1d1f9c25
commit 45b12cdce6
14 changed files with 29 additions and 43 deletions

View File

@@ -0,0 +1,37 @@
# DO NOT EDIT THIS FILE MANUALLY. IT IS GENERATED.
# This file was generated by running `pkgs/clan-cli/clan_cli/inventory/update.sh`
#
# ruff: noqa: N815
# ruff: noqa: N806
# ruff: noqa: F401
# fmt: off
from typing import Any, Literal, NotRequired, TypedDict
class MachineDeploy(TypedDict):
targetHost: NotRequired[str]
class Machine(TypedDict):
deploy: NotRequired[MachineDeploy]
description: NotRequired[str]
icon: NotRequired[str]
machineClass: NotRequired[Literal["nixos", "darwin"]]
name: NotRequired[str]
tags: NotRequired[list[str]]
class Meta(TypedDict):
name: str
description: NotRequired[str]
icon: NotRequired[str]
Service = dict[str, Any]
class Inventory(TypedDict):
machines: NotRequired[dict[str, Machine]]
meta: NotRequired[Meta]
modules: NotRequired[dict[str, Any]]
services: NotRequired[dict[str, Service]]
tags: NotRequired[dict[str, Any]]

View File

@@ -0,0 +1,8 @@
#!/usr/bin/env bash
set -euo pipefail
jsonSchema=$(nix build .#schemas.inventory-schema-abstract --print-out-paths)/schema.json
SCRIPT_DIR=$(dirname "$0")
cd "$SCRIPT_DIR"
nix run .#classgen -- "$jsonSchema" "./inventory.py"