Fix(machines/create): use 'InventorySnapshot' as init argument

Inventory as a model is generally not json serializable
InventorySnapshot is the return value of InventoryStore.{read, write}
And should be used in API calls, because the other fields might not be compatible in general
This commit is contained in:
Johannes Kirschbauer
2025-05-28 14:09:30 +02:00
parent 104343a334
commit 4b5880d1cb

View File

@@ -7,8 +7,7 @@ from clan_lib.cmd import CmdOut, RunOpts, run
from clan_lib.errors import ClanError
from clan_lib.flake import Flake
from clan_lib.nix import nix_command, nix_metadata, nix_shell
from clan_lib.nix_models.clan import Inventory
from clan_lib.persist.inventory_store import InventoryStore
from clan_lib.persist.inventory_store import InventorySnapshot, InventoryStore
from clan_lib.templates import (
InputPrio,
TemplateName,
@@ -35,7 +34,7 @@ class CreateOptions:
src_flake: Flake | None = None
input_prio: InputPrio | None = None
setup_git: bool = True
initial: Inventory | None = None
initial: InventorySnapshot | None = None
update_clan: bool = True