Refactor(clan_lib): move nix bound classes out of the cli folder
This commit is contained in:
37
pkgs/clan-cli/clan_lib/nix_models/inventory.py
Normal file
37
pkgs/clan-cli/clan_lib/nix_models/inventory.py
Normal 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]]
|
||||
8
pkgs/clan-cli/clan_lib/nix_models/update.sh
Executable file
8
pkgs/clan-cli/clan_lib/nix_models/update.sh
Executable 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"
|
||||
Reference in New Issue
Block a user